Debian bug report logs - #1534 adduser problems with home directories Package: adduser ; Reported by: Ian Jackson ; 28 days old. ----------------------------------------------------------------------- Message received at debian-bugs: From cus.cam.ac.uk!iwj10 Tue Oct 3 06:13:40 1995 Return-Path: Received: from pixar.com by mongo.pixar.com with smtp (Smail3.1.28.1 #15) id m0t07AC-000GAEC; Tue, 3 Oct 95 06:13 PDT Received: from bootes.cus.cam.ac.uk by pixar.com with SMTP id AA19630 (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Tue, 3 Oct 1995 06:13:20 -0700 Received: by bootes.cus.cam.ac.uk (Smail-3.1.29.0 #36) id m0t06p6-000C0aC; Tue, 3 Oct 95 13:51 BST Received: by chiark id (Debian /\oo/\ Smail3.1.29.1 #29.33); Tue, 3 Oct 95 13:50 BST Message-Id: Date: Tue, 3 Oct 95 13:50 BST From: Ian Jackson To: Debian bugs submission address Subject: adduser problems with home directories Package: adduser Version: 1.94-1 Firstly, it doesn't honour the --home option except when creating `system' users. This is clearly silly. If I say adduser --home /u2/fred fred then I want fred's home directory to be /u2/fred. Secondly, it doesn't set the setgid bit on home directories that it creates (when usergroups is enabled - clearly when it's disabled it shouldn't do it). Thirdly, I notice it makes many system calls without checking the error returns. Below is a patch that solves the first two problems. I have not bothered to produce a patch for the manpage (which says that the --home option only works with --system). Fixing the third problem will be quite a lot of work. Ian. --- adduser Tue Oct 3 03:23:52 1995 +++ /usr/local/sbin/adduser Tue Oct 3 13:39:53 1995 @@ -602,7 +602,11 @@ ## add the new user to the passwd file ## print "Updating password file... " if ($verbose); - $home_dir = $config{"home"} . "/" . $new_name; + if ($special_home) { + $home_dir = $special_home; + } else { + $home_dir = $config{"home"} . "/" . $new_name; + } &add_user_to_file($new_name, $new_uid, $new_gid, @@ -651,6 +655,7 @@ } mkdir ($home_dir, $dir_mode); chown ($new_uid, $new_gid, $home_dir); + chmod ($dir_mode, $home_dir); print "done.\n" if ($verbose); ## ----------------------------------------------------------------------- Acknowledgement sent to Ian Jackson : New bug report received and forwarded. Full text available. ----------------------------------------------------------------------- Report forwarded to debian-devel@pixar.com : Bug#1534 ; Package adduser . Full text available. ----------------------------------------------------------------------- Ian Jackson / iwj10@thor.cam.ac.uk , with the debian-bugs tracking mechanism This page last modified 07:43:01 GMT Wed 01 Nov