adduser does not behave as documented in man page

Bug #1490777 reported by Edward Gow
6
This bug affects 1 person
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://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: adduser 3.113ubuntu2
ProcVersionSignature: Ubuntu 3.13.0-49.81~precise1-generic 3.13.11-ckt17
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
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: adduser
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Edward Gow (elgow) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.