From owner-freebsd-bugs Sat Feb 10 04:40:06 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id EAA13090 for bugs-outgoing; Sat, 10 Feb 1996 04:40:06 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id EAA13055 Sat, 10 Feb 1996 04:40:04 -0800 (PST) Resent-Date: Sat, 10 Feb 1996 04:40:04 -0800 (PST) Resent-Message-Id: <199602101240.EAA13055@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, masafumi@tky007.tth.expo96.ad.jp Received: from mail.tky007.tth.expo96.ad.jp (root@tky007.tth.expo96.ad.jp [133.246.32.58]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id EAA10676 for ; Sat, 10 Feb 1996 04:33:32 -0800 (PST) Received: (from masafumi@localhost) by mail.tky007.tth.expo96.ad.jp (8.6.12/3.4W2-SMTP) id VAA01461; Sat, 10 Feb 1996 21:33:59 +0900 Message-Id: <199602101233.VAA01461@mail.tky007.tth.expo96.ad.jp> Date: Sat, 10 Feb 1996 21:33:59 +0900 From: Masafumi NAKANE Reply-To: masafumi@tky007.tth.expo96.ad.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/1014: adduser doesn't chown in some occasion Sender: owner-bugs@freebsd.org Precedence: bulk >Number: 1014 >Category: bin >Synopsis: adduser doesn't chown in some occasion >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Feb 10 04:40:02 PST 1996 >Last-Modified: >Originator: Masafumi NAKANE >Organization: >Release: FreeBSD 2.1.0-RELEASE i386 >Environment: >Description: When one tries to add new user with adduser script and specifies no dot files directory, adduser script doesn't chown a home directory of the new user, thus, resulting in creating the directory owned by root, or whoever executes the adduser script. >How-To-Repeat: Execute add user, specify 'no` for dot file directory, and add new user. >Fix: Following patch should fix the problem. Please note that I'm not frequent user of perl and, thus, it is quite possible that my code isn't written in standard way accepted by perl programmers. *** adduser.perl.orig Sun Oct 22 20:44:16 1995 --- adduser.perl Sat Feb 10 21:19:29 1996 *************** *** 938,944 **** return 0; } ! return mkdir("$homedir",0755) if $dotdir eq "no"; # copy files from $dotdir to $homedir # rename 'dot.foo' files to '.foo' --- 938,948 ---- return 0; } ! if ($dotdir eq "no") { ! return 0 unless mkdir("$homedir",0755); ! system("chown -R $name:$group $homedir"); ! return 1; ! } # copy files from $dotdir to $homedir # rename 'dot.foo' files to '.foo' >Audit-Trail: >Unformatted: