On 2/1/06, George Georgalis <[EMAIL PROTECTED]> wrote:
> Situation, when that is run as tested (login shell), all is fine.
> a umask of 007 is applied to files created. But when it's deposited
> in the $PATH directory and run as "doit.sh" it uses the system umask.

I just tried it, and it uses user umask when I do it.  In fact, I had
a script in my path called umask-script that was executable by user,
but owned by root:root.  The file creates one empty file.  The file
was created with user's mask, whether run as a command in the PATH or
as a ./script.

... login as root ...
root$ umask
0022
root$ echo "touch a-umasked-file" >> /home/user/.bin/umask-script
root$ chmod 777 /home/user/.bin/umask-script

... login as user ...
user$ umask 007
user$ ./.bin/umask-script
user$ ls -l a-umasked-file
-rw-rw----  1 root root     0 Feb  1 20:33 a-umasked-file
user$ rm a-umasked-file
user$ umask-script
user$ ls -l a-umasked-file
-rw-rw----  1 root root     0 Feb  1 22:03 a-umasked-file

Maybe I'm doing something different?

-todd


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to