If I have a file/folder that a user does not have permission to and I try to rename it, it removes the entire parent folder. At that point it is only visible in a ls. (Not a ls -l, file, more, cd). It happens on every filesystem. This is Aix 5.3
$ cd test
$ ls -la
total 0
drwxr-xr-x 2 root system 256 May 10 18:26 .
drwxr-xr-x 3 dell sysadmin 256 May 10 18:26 ..
-rw-r--r-- 1 root system 0 May 10 18:26 new
$ mv new new.old
mv: cannot rename new to new.old:
Permission denied
$ pwd
/home/dell/test
$ ls
test
$ ls -la
./test not found
total 0
drwxr-xr-x 2 root system 256 May 10 18:26 .
drwxr-xr-x 3 dell sysadmin 256 May 10 18:26 ..
Is the FS maybe corrupted? Check first in errpt whether anything has been reported and / or unmount the FS and check it with fsck... Do you have the latest SPs for either TL10,11 or 12 installed? These introduced the possibility to corrupt JFS2 file systems by a simple "mv" command and should for now be avoided...
nothing in errpt. I unmounted, ran fsck which came back clean. But strangely once I do that, the problem goes away for awhile but then eventually returns.
I suspect it MAY have something to do with the directory's name... "test"...
...which is the name if the shell command used in an 'if' statement (see man test)
Try re-running the test again.
But before doing so, run a
ls -ld /home/dell/test
and use "full paths" to everything...
In other words:
$ cd /home/dell/test
$ ls -la /home/dell/test
$ ls -ld /home/dell/test
$ mv /home/dell/test/new /home/dell/test/new.old
$ pwd
$ ls -la
$ ls -ld /home/dell/test
It happens no matter what the file is called. Question: If you mount a filesystem over a directory, do the underlying directory permissions have any real effect? The reason is that if we umount the filesystem and chmod 777 to the underlying directory and then remount the fs, the problem goes away for awhile.