Public bug reported:

Application: /usr/sbin/useradd

Doing:
 THE_ID=70000
 THE_NAME=aaaaa
 groupadd --gid $THE_ID $THE_NAME
 useradd --uid $THE_ID --gid $THE_ID --home-dir /home/$THE_NAME --create-home 
$THE_NAME

is working fine, but when specifying a --root, the provided --gid is not
checked in the group file in the --root folder. Steps:

 BASE_FOLDER=$(mktemp -d)
 cd $BASE_FOLDER
 THE_ID=70000
 THE_NAME=aaaaa
 mkdir etc home
 touch etc/group etc/passwd etc/shadow
 groupadd --root $BASE_FOLDER --gid $THE_ID $THE_NAME
 useradd --root $BASE_FOLDER --uid $THE_ID --gid $THE_ID --home-dir 
/home/$THE_NAME --create-home $THE_NAME

Getting error
  useradd: group '70000' does not exist

checking the group file, the group exists:
grep aaaaa $BASE_FOLDER/etc/group
  aaaaa:x:70000:


------

Description:    Ubuntu 18.04.1 LTS
Release:        18.04

passwd:
  Installed: 1:4.5-1ubuntu1
  Candidate: 1:4.5-1ubuntu1
  Version table:
 *** 1:4.5-1ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

** Affects: shadow (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1785389

Title:
  useradd is not looking for --gid in --root

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1785389/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to