1 year ago

#340503

test-img

Linda Derezinski

Trying to figure out why empty files like /tmp/fc007620c1c8dcca are being created

Example of the empty files created in /tmp:

-rw-------  1 root  wheel     0B Mar 27 00:57 fc007620c1c8dcca
-rw-------  1 root  wheel     0B Mar 27 01:00 fc007620c1c95a20
-rw-------  1 root  wheel     0B Mar 27 01:01 fc007620c1c9c4e3 

This is on a Macbook Pro running OSX 12.3

I ran this for over 8 hours as root and about 80 empty files appeared. lsof never returned any information:

#! /usr/bin/env bash

function echomsg {
    echo "`date +%Y-%m-%dT%H:%M:%S` findingNemo: ${1}"
}

LASTFILENAME=nothing
counter=0
while true
do
    FILENAME=`ls -t /tmp/fc00* | head -1` 
    if [ $FILENAME == $LASTFILENAME ]; then
        counter=$((counter+1))
        if [ $counter -gt 100 ]; then
            counter=0
            echo -n "."
        fi
    else
        echo
        echomsg $FILENAME
        lsof $FILENAME
        LASTFILENAME=$FILENAME
    fi
done

bash

tmp

lsof

0 Answers

Your Answer

Accepted video resources