[Vserver] /dev/hdv1 , apache + umask trouble

From: Oliver Heinz <oliver.heinz_at_schunk.net>
Date: Tue 26 Jun 2007 - 13:52:04 BST
Message-Id: <200706261452.04773.oliver.heinz@schunk.net>

Hi,

after some testing it seems that I have some strange behaviour with the root
fs in guests.

I have an apache 1.3 running, with php4 scripts that do an file upload to the
filesystem. I wanted to change the umask for file creation and had different
behaviour for the resulting file being on the root fs (/dev/hdv1 which shows
as via mount ufs) and a seperate bind mount.

When the file ist created on the seperate mount umask works and i can set
whatever umask i want resulting in the corresponing mode.

When the file is created somewhere on the / ufs it's created with with mode
0600, no matter what umask I set - it's just completely ignored, SGID is also
ignored the resulting file is owned by the primary group of the
apache-process.

chmod in php does work fine, umask on the commanline does work too.

Has anybody ever experienced such strange behaviour?

TIA,
Oliver

php code:

...
umask (0002);
        if(is_uploaded_file($userfile) && move_uploaded_file($userfile,
$file_name))
..

result on seperate bind mount:
drwxrwsr-x 2 www-data wdvuser 4096 2007-06-26 13:54 .
drwxrwsr-x 7 ftp wdvuser 4096 2007-06-26 09:20 ..
-rw-rw-r-- 1 www-data wdvuser 5253 2007-06-26 13:54 logo.jpg

result on root fs (/dev/hdv1, ufs):
drwxrwsr-x 2 www-data wdvuser 4096 2007-06-26 14:39 .
drwxr-xr-x 6 root root 4096 2007-06-26 14:37 ..
-rw------- 1 www-data www-data 3624 2007-06-26 14:39 logo.jpg

mount output:
/dev/hdv1 on / type ufs (defaults)
/var/www/test type none (0)

fstab:
none /proc proc defaults,noexec,nosuid 0 0
none /dev/pts devpts gid=5,mode=620 0 0
/srv/www/test /var/www/test none bind

Versions:
                   Kernel: 2.6.19.7-grsec2.1.10-vs2.2.0
                   VS-API: 0x00020200
             util-vserver: 0.30.212; Jan 16 2007, 11:59:37

_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Tue Jun 26 14:40:07 2007

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Tue 26 Jun 2007 - 14:40:12 BST by hypermail 2.1.8