Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Feb 1996 21:33:59 +0900
From:      Masafumi NAKANE <masafumi@tky007.tth.expo96.ad.jp>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1014: adduser doesn't chown in some occasion
Message-ID:  <199602101233.VAA01461@mail.tky007.tth.expo96.ad.jp>
Resent-Message-ID: <199602101240.EAA13055@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602101233.VAA01461>