From owner-freebsd-questions@FreeBSD.ORG Thu Dec 22 18:48:30 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 844DE1065673 for ; Thu, 22 Dec 2011 18:48:30 +0000 (UTC) (envelope-from bmettee@pchotshots.com) Received: from mail.pchotshots.com (mail.pchotshots.com [12.172.123.237]) by mx1.freebsd.org (Postfix) with ESMTP id 19C228FC12 for ; Thu, 22 Dec 2011 18:48:29 +0000 (UTC) Received: (qmail 8529 invoked by uid 89); 22 Dec 2011 18:28:40 -0000 Received: from unknown (HELO ?12.172.123.228?) (bmettee@pchotshots.com@12.172.123.228) by mail.pchotshots.com with ESMTPA; 22 Dec 2011 18:28:40 -0000 Message-ID: <4EF37536.8080708@pchotshots.com> Date: Thu, 22 Dec 2011 13:21:42 -0500 From: Brad Mettee User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Thunderbird/3.1.16 MIME-Version: 1.0 To: Bastien Semene References: <4EF36FA9.9020908@cyanide-studio.com> In-Reply-To: <4EF36FA9.9020908@cyanide-studio.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: umask not applied X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2011 18:48:30 -0000 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.