diff options
author | Wolfram Schneider <wosch@FreeBSD.org> | 1997-09-20 19:59:54 +0000 |
---|---|---|
committer | Wolfram Schneider <wosch@FreeBSD.org> | 1997-09-20 19:59:54 +0000 |
commit | d401b90a66b9ee9f05cf92cedbbe13a8ac68c1b3 (patch) | |
tree | e67f6c4f37f06da32fd09d6c71bb2ac7ec621bc3 /adduser | |
parent | 1572c282e85da69851943bd7ad3c653344e25a09 (diff) | |
download | pw-darwin-d401b90a66b9ee9f05cf92cedbbe13a8ac68c1b3.tar.gz pw-darwin-d401b90a66b9ee9f05cf92cedbbe13a8ac68c1b3.tar.zst pw-darwin-d401b90a66b9ee9f05cf92cedbbe13a8ac68c1b3.zip |
Do not complain about non existing shell "/nonexistent"
Smarter error check if a uid is already in use.
Submitted by: "Eugene Radchenko" <genie@qsar.chem.msu.su>
Diffstat (limited to 'adduser')
-rw-r--r-- | adduser/adduser.perl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/adduser/adduser.perl b/adduser/adduser.perl index 9378bf8..56482b9 100644 --- a/adduser/adduser.perl +++ b/adduser/adduser.perl @@ -24,7 +24,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: adduser.perl,v 1.35 1997/08/26 22:47:51 wosch Exp $ +# $Id: adduser.perl,v 1.36 1997/09/20 18:26:22 wosch Exp $ # read variables @@ -249,7 +249,7 @@ sub passwd_read { if ($verbose && $sh && !$shell{&basename($sh)} && $p_username !~ /^(news|xten|bin|nobody|uucp)$/ && - $sh !~ /\/(pppd|sliplogin|nologin)$/); + $sh !~ /\/(pppd|sliplogin|nologin|nonexistent)$/); $uid{$p_uid} = $p_username; $pwgid{$p_gid} = $p_username; } @@ -369,12 +369,15 @@ sub new_users_id { ! $uid{$u_id_tmp}; if ($uid{$u_id_tmp}) { warn "Uid ``$u_id_tmp'' in use!\a\n"; + $uid_start = $u_id_tmp; + ($u_id, $g_id) = &next_id($name); + next; } else { warn "Wrong uid.\a\n"; } } # use calculated uid - return ($u_id_tmp, $g_id) if $u_id_tmp eq $u_id; + # return ($u_id_tmp, $g_id) if $u_id_tmp eq $u_id; # recalculate gid $uid_start = $u_id_tmp; return &next_id($name); |