umask not applied

Bastien Semene admin_freebsd at
Fri Dec 23 10:06:00 UTC 2011

Le 22/12/2011 19:21, Brad Mettee a écrit :
> On 12/22/2011 12:58 PM, Bastien Semene wrote:
>> Hi list,
>> I'm trying to apply a umask of "002" to user "user" (username changed 
>> for this example) while logged-in through ftpd.
>> I used login class "class" (class name changed for this example)
>> I edited /etc/login.conf and set at the bottom (there's no other 
>> entry for this user):
>> class::umask=0002:
>> then rebuilt the db :
>> #cap_mkdb /etc/login.conf
>> I assigned the user to this class:
>> #pw usermod user -L class
>> #pw usershow user
>> user:*:1003:80:class:0:0:bla bla:/home/user:/bin/sh
>> (group 80 is why I need this umask)
>> The user still creates folders with 755 permissions through ftpd.
>> So I switched to this user and watched the umask, it is still 0022.
>> I tried setting the umask on the fly :
>> $umask 0002
>> It works.
>> There's no user-defined umask in ~/.login or ~/.login_conf
>> I took care of typos and there is no error.
>> #uname -r
>> 8.2-RELEASE-p3
>> As what I read in the man pages I checked all the possibilities in 
>> the login mechanism, so if anyone has an idea it's welcome :)
>> Thanks !
> I'm not a pro FreeBSD user, but wouldn't the FTPD program be more 
> responsible for the user's login credentials since that's what they're 
> using that's causing the wrong permissions to be applied?
> From what I remember, FTPD verifies the users login, but doesn't 
> actually execute any login scripts associated with that user.
I did not said it explicitly but when I did a "switch user" I actually 
meant a "su" command from the shell (I deactivated user's ssh login 
You made me find the point about my use of the su command, I forgot to 
make a full login using "su - user" instead of "su user" ...
So, login class applies correctly.

In the ftpd(8) manual the -u documentation specifies that login.conf is 
read :
"The default file creation mode mask is set to umask, which is expected 
to be an octal numeric value.
Refer to umask(2) for details. This option may be overridden by 
login.conf(5). "

> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list