adduser does not behave as documented in man page
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
adduser (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The man page for the adduser utility clearly states the exit code behavior to be expected as:
EXIT VALUES
0 The user exists as specified. This can have 2 causes: The user was created by adduser or the user was already present on the system before adduser was invoked. If adduser was returning 0 , invoking adduser a second time with the same parameters as before also returns 0.
1 Creating the user or group failed because it was already present with other UID/GID than specified. The username or groupname was rejected because of a mismatch with the configured regular expressions, see adduser.conf(5). Adduser has been aborted by a signal.
Or for many other yet undocumented reasons which are printed to console then. You may then consider to remove --quiet to make adduser more verbose.
In actual operation, adduser returns 1 if the user already exists. The documented behavior would be preferable.
System details:
Description: Ubuntu 12.04.5 LTS
Release: 12.04
adduser:
Installed: 3.113ubuntu2
Candidate: 3.113ubuntu2
Version table:
*** 3.113ubuntu2 0
500 http://
100 /var/lib/
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: adduser 3.113ubuntu2
ProcVersionSign
Uname: Linux 3.13.0-49-generic x86_64
ApportVersion: 2.0.1-0ubuntu17.8
Architecture: amd64
Date: Mon Aug 31 16:43:48 2015
InstallationMedia: Ubuntu-Server 12.04.3 LTS "Precise Pangolin" - Release amd64 (20130820.2)
MarkForUpload: True
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: adduser
UpgradeStatus: No upgrade log present (probably fresh install)