On Wed, Feb 01, 2006 at 08:37:49PM -0800, Todd Walton wrote:
>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?

yeah, that looks like how I tested it. but put it in
/usr/local/bin and run umask-script ...system umask, no workaround
(note the umask may not be set to the user's default umask)

// George


-- 
George Georgalis, systems architect, administrator <IXOYE><
http://galis.org/ cell:646-331-2027 mailto:[EMAIL PROTECTED]


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

Reply via email to