From owner-freebsd-bugs Wed Jun 26 13:28:40 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1B59A37C576 for ; Wed, 26 Jun 2002 13:10:43 -0700 (PDT) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g5QKAYJU047288 for ; Wed, 26 Jun 2002 13:10:37 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g5QKAP9G047265; Wed, 26 Jun 2002 13:10:25 -0700 (PDT) Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117]) by hub.freebsd.org (Postfix) with ESMTP id 3F32237B79A for ; Wed, 26 Jun 2002 13:01:43 -0700 (PDT) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g5QJY4OT060554 for ; Wed, 26 Jun 2002 12:34:04 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.4/8.12.4/Submit) id g5QJY4UY060553; Wed, 26 Jun 2002 12:34:04 -0700 (PDT) Message-Id: <200206261934.g5QJY4UY060553@www.freebsd.org> Date: Wed, 26 Jun 2002 12:34:04 -0700 (PDT) From: "George V. Kouryachy" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/39893: setusercontext library call differs umask Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 39893 >Category: bin >Synopsis: setusercontext library call differs umask >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 26 13:10:15 PDT 2002 >Closed-Date: >Last-Modified: >Originator: George V. Kouryachy >Release: 4.6-RELEASE >Organization: Moscow State Univercity >Environment: FreeBSD phobos.cs.msu.su 4.6-RELEASE FreeBSD 4.6-RELEASE #6: Thu Jun 20 17:44:32 MSD 2002 toor@phobos.cs.msu.su:/usr/obj/usr/src/sys/PHOBOS i386 >Description: When calling setusercontext to the user, which have an 'umask=' entry in his login class in /etc/login.conf, some umasks are set incorrectly, E.g. when using "umask=407" (for incoming FTP not to store warez :) actually got d--xr-x--- instead of d-wxrwx--- permissions. >How-To-Repeat: Add test:umask=407:\ :tc=default: in /etc/login.conf, call cap_mkdb /etc/login.conf and do pw user add tmpuser -L test -m to create user. simple program: #include #include #include #include #include int main(int argc, char *argv[]) { struct passwd *pw; rmdir("/tmp/tmpdir"); pw = getpwnam("tmpuser"); setusercontext(NULL, pw, (uid_t)0, LOGIN_SETLOGIN|LOGIN_SETGROUP|LOGIN_SETPRIORITY| LOGIN_SETRESOURCES|LOGIN_SETUMASK); system("mkdir /tmp/tmpdir"); system("ls -al /tmp/tmpdir"); } will show total 4 d--xr-x--- 2 root wheel 512 26 июн 23:32 . drwxrwxrwt 8 root wheel 512 26 июн 23:32 .. >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message