From masafumi@tky007.tth.expo96.ad.jp  Sat Feb 10 04:33:34 1996
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 <FreeBSD-gnats-submit@freebsd.org>; 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 <masafumi@tky007.tth.expo96.ad.jp>
Reply-To: masafumi@tky007.tth.expo96.ad.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: adduser doesn't chown in some occasion
X-Send-Pr-Version: 3.2

>Number:         1014
>Category:       bin
>Synopsis:       adduser doesn't chown in some occasion
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 10 04:40:02 PST 1996
>Closed-Date:    Sat Feb 17 13:24:49 PST 1996
>Last-Modified:  Sat Feb 17 13:30:20 PST 1996
>Originator:     Masafumi NAKANE
>Release:        FreeBSD 2.1.0-RELEASE i386
>Organization:
>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'

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wosch 
State-Changed-When: Sat Feb 17 13:24:49 PST 1996 
State-Changed-Why:  
fixed in  revision 1.10 

>Unformatted:
