[Touch-packages] [Bug 1998169] Re: useradd command does not copy all of /etc/skel

2022-11-29 Thread Launchpad Bug Tracker
This bug was fixed in the package shadow - 1:4.8.1-1ubuntu5.20.04.4

---
shadow (1:4.8.1-1ubuntu5.20.04.4) focal-security; urgency=medium

  * SECURITY REGRESSION: useradd command does not copy all of /etc/skel
(LP: #1998169)
- debian/patches/CVE-2013-4235-pre1.patch: removed
- debian/patches/CVE-2013-4235-pre2.patch: removed
- debian/patches/CVE-2013-4235-1.patch: removed
- debian/patches/CVE-2013-4235-2.patch: removed
- debian/patches/CVE-2013-4235-3.patch: removed
- debian/patches/CVE-2013-4235-4.patch: removed
- debian/patches/CVE-2013-4235-5.patch: removed
- debian/patches/CVE-2013-4235-6.patch: removed
- debian/patches/CVE-2013-4235-7.patch: removed
- debian/patches/CVE-2013-4235-post1.patch: removed
- debian/patches/CVE-2013-4235-post2.patch: removed
- debian/patches/CVE-2013-4235-post3.patch: removed

 -- Camila Camargo de Matos   Tue,
29 Nov 2022 08:53:10 -0300

** Changed in: shadow (Ubuntu)
   Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/1998169

Title:
  useradd command does not copy all of /etc/skel

Status in shadow package in Ubuntu:
  Fix Released

Bug description:
  
  I know the useradd command is discouraged, but I wanted to report the bug to 
make the maintainers of the package aware.

  Recently there was an update of Ubuntu's passwd package which is
  sourced from shadow from version 4.8.1-1ubuntu5.20.04.2 to version
  4.8.1-1ubuntu5.20.04.3

  When using the useradd command, the /etc/skel directory with contents
  below, an only copies in one empty folder.

  
  ls -lah /etc/skel
  total 60K
  drwxrwxrwx  10 root user 4.0K Nov 28 18:33 .
  drwxr-xr-x 155 root root  12K Nov 28 19:12 ..
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .backgrounds
  -rwxrwxrwx   1 root user  220 Nov 28 18:23 .bash_logout
  -rwxrwxrwx   1 root user 3.7K Nov 28 18:23 .bashrc
  drwxrwxrwx   6 root user 4.0K Nov 28 18:23 .config
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 Desktop
  drwxrwxrwx   2 root user 4.0K Nov 28 18:30 .fonts_stuff
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .icons
  -rwxrwxrwx   1 root user  765 Nov 28 18:23 .profile
  drwxrwxrwx   2 root root 4.0K Nov 28 18:32 testfolderempty
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 .themes
  drwxrwxrwx  14 root user 4.0K Nov 28 18:23 WinAte
  
  ls -lah /home/user20
  total 12K
  drwx--  3 user20 user 4.0K Nov 28 19:12 .
  drwxr-xr-x 18 root   root 4.0K Nov 28 19:12 ..
  drwx--  2 user20 user 4.0K Nov 28 19:12 WinAte

  ls -lah /home/user20/WinAte/
  total 8.0K
  drwx-- 2 user20 user 4.0K Nov 28 19:12 .
  drwx-- 3 user20 user 4.0K Nov 28 19:12 ..

  
  I noticed in the strace calls for useradd that the kernel is returning the 
correct count of directories, but the useradd is clearly not copying all of 
them. Below is the strace output.
  

  strace useradd -k /etc/skel -g 900 -m -s /bin/bash -p a_password -c User20 
user20
  execve("/usr/sbin/useradd", ["useradd", "-k", "/etc/skel", "-g", "900", "-m", 
"-s", "/bin/bash", "-p", "P@ssw0rd!", "-c", "User20", "user20"], 0x7fffe10eba10 
/* 24 vars */) = 0
  brk(NULL)   = 0x5631ba1c2000
  arch_prctl(0x3001 /* ARCH_??? */, 0x7fff0e47bab0) = -1 EINVAL (Invalid 
argument)
  access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=98383, ...}) = 0
  mmap(NULL, 98383, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fea9b7bf000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libaudit.so.1", O_RDONLY|O_CLOEXEC) = 
3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3407\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=133200, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fea9b7bd000
  mmap(NULL, 176296, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b791000
  mprotect(0x7fea9b794000, 118784, PROT_NONE) = 0
  mmap(0x7fea9b794000, 32768, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fea9b794000
  mmap(0x7fea9b79c000, 81920, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0xb000) = 0x7fea9b79c000
  mmap(0x7fea9b7b1000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7fea9b7b1000
  mmap(0x7fea9b7b3000, 37032, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fea9b7b3000
  close(3)= 0
  openat(AT_FDCWD, 

[Touch-packages] [Bug 1998169] Re: useradd command does not copy all of /etc/skel

2022-11-29 Thread Camila Camargo de Matos
** Changed in: shadow (Ubuntu)
   Status: Fix Released => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/1998169

Title:
  useradd command does not copy all of /etc/skel

Status in shadow package in Ubuntu:
  In Progress

Bug description:
  
  I know the useradd command is discouraged, but I wanted to report the bug to 
make the maintainers of the package aware.

  Recently there was an update of Ubuntu's passwd package which is
  sourced from shadow from version 4.8.1-1ubuntu5.20.04.2 to version
  4.8.1-1ubuntu5.20.04.3

  When using the useradd command, the /etc/skel directory with contents
  below, an only copies in one empty folder.

  
  ls -lah /etc/skel
  total 60K
  drwxrwxrwx  10 root user 4.0K Nov 28 18:33 .
  drwxr-xr-x 155 root root  12K Nov 28 19:12 ..
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .backgrounds
  -rwxrwxrwx   1 root user  220 Nov 28 18:23 .bash_logout
  -rwxrwxrwx   1 root user 3.7K Nov 28 18:23 .bashrc
  drwxrwxrwx   6 root user 4.0K Nov 28 18:23 .config
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 Desktop
  drwxrwxrwx   2 root user 4.0K Nov 28 18:30 .fonts_stuff
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .icons
  -rwxrwxrwx   1 root user  765 Nov 28 18:23 .profile
  drwxrwxrwx   2 root root 4.0K Nov 28 18:32 testfolderempty
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 .themes
  drwxrwxrwx  14 root user 4.0K Nov 28 18:23 WinAte
  
  ls -lah /home/user20
  total 12K
  drwx--  3 user20 user 4.0K Nov 28 19:12 .
  drwxr-xr-x 18 root   root 4.0K Nov 28 19:12 ..
  drwx--  2 user20 user 4.0K Nov 28 19:12 WinAte

  ls -lah /home/user20/WinAte/
  total 8.0K
  drwx-- 2 user20 user 4.0K Nov 28 19:12 .
  drwx-- 3 user20 user 4.0K Nov 28 19:12 ..

  
  I noticed in the strace calls for useradd that the kernel is returning the 
correct count of directories, but the useradd is clearly not copying all of 
them. Below is the strace output.
  

  strace useradd -k /etc/skel -g 900 -m -s /bin/bash -p a_password -c User20 
user20
  execve("/usr/sbin/useradd", ["useradd", "-k", "/etc/skel", "-g", "900", "-m", 
"-s", "/bin/bash", "-p", "P@ssw0rd!", "-c", "User20", "user20"], 0x7fffe10eba10 
/* 24 vars */) = 0
  brk(NULL)   = 0x5631ba1c2000
  arch_prctl(0x3001 /* ARCH_??? */, 0x7fff0e47bab0) = -1 EINVAL (Invalid 
argument)
  access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=98383, ...}) = 0
  mmap(NULL, 98383, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fea9b7bf000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libaudit.so.1", O_RDONLY|O_CLOEXEC) = 
3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3407\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=133200, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fea9b7bd000
  mmap(NULL, 176296, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b791000
  mprotect(0x7fea9b794000, 118784, PROT_NONE) = 0
  mmap(0x7fea9b794000, 32768, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fea9b794000
  mmap(0x7fea9b79c000, 81920, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0xb000) = 0x7fea9b79c000
  mmap(0x7fea9b7b1000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7fea9b7b1000
  mmap(0x7fea9b7b3000, 37032, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fea9b7b3000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) 
= 3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@p\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=163200, ...}) = 0
  mmap(NULL, 174600, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b766000
  mprotect(0x7fea9b76c000, 135168, PROT_NONE) = 0
  mmap(0x7fea9b76c000, 102400, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fea9b76c000
  mmap(0x7fea9b785000, 28672, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0x1f000) = 0x7fea9b785000
  mmap(0x7fea9b78d000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7fea9b78d000
  mmap(0x7fea9b78f000, 6664, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fea9b78f000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libsemanage.so.1", 
O_RDONLY|O_CLOEXEC) = 3
  read(3, 

[Touch-packages] [Bug 1998169] Re: useradd command does not copy all of /etc/skel

2022-11-29 Thread Launchpad Bug Tracker
This bug was fixed in the package shadow - 1:4.5-1ubuntu2.5

---
shadow (1:4.5-1ubuntu2.5) bionic-security; urgency=medium

  * SECURITY REGRESSION: useradd command does not copy all of /etc/skel
(LP: #1998169)
- debian/patches/CVE-2013-4235-pre1.patch: removed
- debian/patches/CVE-2013-4235-pre2.patch: removed
- debian/patches/CVE-2013-4235-1.patch: removed
- debian/patches/CVE-2013-4235-2.patch: removed
- debian/patches/CVE-2013-4235-3.patch: removed
- debian/patches/CVE-2013-4235-4.patch: removed
- debian/patches/CVE-2013-4235-5.patch: removed
- debian/patches/CVE-2013-4235-6.patch: removed
- debian/patches/CVE-2013-4235-7.patch: removed
- debian/patches/CVE-2013-4235-post1.patch: removed
- debian/patches/CVE-2013-4235-post2.patch: removed
- debian/patches/CVE-2013-4235-post3.patch: removed

 -- Camila Camargo de Matos   Tue,
29 Nov 2022 09:25:19 -0300

** Changed in: shadow (Ubuntu)
   Status: Confirmed => Fix Released

** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2013-4235

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/1998169

Title:
  useradd command does not copy all of /etc/skel

Status in shadow package in Ubuntu:
  Fix Released

Bug description:
  
  I know the useradd command is discouraged, but I wanted to report the bug to 
make the maintainers of the package aware.

  Recently there was an update of Ubuntu's passwd package which is
  sourced from shadow from version 4.8.1-1ubuntu5.20.04.2 to version
  4.8.1-1ubuntu5.20.04.3

  When using the useradd command, the /etc/skel directory with contents
  below, an only copies in one empty folder.

  
  ls -lah /etc/skel
  total 60K
  drwxrwxrwx  10 root user 4.0K Nov 28 18:33 .
  drwxr-xr-x 155 root root  12K Nov 28 19:12 ..
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .backgrounds
  -rwxrwxrwx   1 root user  220 Nov 28 18:23 .bash_logout
  -rwxrwxrwx   1 root user 3.7K Nov 28 18:23 .bashrc
  drwxrwxrwx   6 root user 4.0K Nov 28 18:23 .config
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 Desktop
  drwxrwxrwx   2 root user 4.0K Nov 28 18:30 .fonts_stuff
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .icons
  -rwxrwxrwx   1 root user  765 Nov 28 18:23 .profile
  drwxrwxrwx   2 root root 4.0K Nov 28 18:32 testfolderempty
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 .themes
  drwxrwxrwx  14 root user 4.0K Nov 28 18:23 WinAte
  
  ls -lah /home/user20
  total 12K
  drwx--  3 user20 user 4.0K Nov 28 19:12 .
  drwxr-xr-x 18 root   root 4.0K Nov 28 19:12 ..
  drwx--  2 user20 user 4.0K Nov 28 19:12 WinAte

  ls -lah /home/user20/WinAte/
  total 8.0K
  drwx-- 2 user20 user 4.0K Nov 28 19:12 .
  drwx-- 3 user20 user 4.0K Nov 28 19:12 ..

  
  I noticed in the strace calls for useradd that the kernel is returning the 
correct count of directories, but the useradd is clearly not copying all of 
them. Below is the strace output.
  

  strace useradd -k /etc/skel -g 900 -m -s /bin/bash -p a_password -c User20 
user20
  execve("/usr/sbin/useradd", ["useradd", "-k", "/etc/skel", "-g", "900", "-m", 
"-s", "/bin/bash", "-p", "P@ssw0rd!", "-c", "User20", "user20"], 0x7fffe10eba10 
/* 24 vars */) = 0
  brk(NULL)   = 0x5631ba1c2000
  arch_prctl(0x3001 /* ARCH_??? */, 0x7fff0e47bab0) = -1 EINVAL (Invalid 
argument)
  access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=98383, ...}) = 0
  mmap(NULL, 98383, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fea9b7bf000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libaudit.so.1", O_RDONLY|O_CLOEXEC) = 
3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3407\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=133200, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fea9b7bd000
  mmap(NULL, 176296, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b791000
  mprotect(0x7fea9b794000, 118784, PROT_NONE) = 0
  mmap(0x7fea9b794000, 32768, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fea9b794000
  mmap(0x7fea9b79c000, 81920, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0xb000) = 0x7fea9b79c000
  mmap(0x7fea9b7b1000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7fea9b7b1000
  mmap(0x7fea9b7b3000, 37032, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fea9b7b3000
  close(3)= 

[Touch-packages] [Bug 1998169] Re: useradd command does not copy all of /etc/skel

2022-11-29 Thread Camila Camargo de Matos
Further investigation made by the security team has identified that
focal and lower are affected because glibc in these versions does not
include the following commit:
https://sourceware.org/git/?p=glibc.git;a=commit;h=752dd17443e55a4535cb9e6baa4e550ede383540.
Therefore, jammy and kinetic, which have also been updated do not have
this problem. Focal, bionic, xenial and trusty, however, do, and
therefore, the updates will be reverted in order to remove the
regression.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/1998169

Title:
  useradd command does not copy all of /etc/skel

Status in shadow package in Ubuntu:
  Confirmed

Bug description:
  
  I know the useradd command is discouraged, but I wanted to report the bug to 
make the maintainers of the package aware.

  Recently there was an update of Ubuntu's passwd package which is
  sourced from shadow from version 4.8.1-1ubuntu5.20.04.2 to version
  4.8.1-1ubuntu5.20.04.3

  When using the useradd command, the /etc/skel directory with contents
  below, an only copies in one empty folder.

  
  ls -lah /etc/skel
  total 60K
  drwxrwxrwx  10 root user 4.0K Nov 28 18:33 .
  drwxr-xr-x 155 root root  12K Nov 28 19:12 ..
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .backgrounds
  -rwxrwxrwx   1 root user  220 Nov 28 18:23 .bash_logout
  -rwxrwxrwx   1 root user 3.7K Nov 28 18:23 .bashrc
  drwxrwxrwx   6 root user 4.0K Nov 28 18:23 .config
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 Desktop
  drwxrwxrwx   2 root user 4.0K Nov 28 18:30 .fonts_stuff
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .icons
  -rwxrwxrwx   1 root user  765 Nov 28 18:23 .profile
  drwxrwxrwx   2 root root 4.0K Nov 28 18:32 testfolderempty
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 .themes
  drwxrwxrwx  14 root user 4.0K Nov 28 18:23 WinAte
  
  ls -lah /home/user20
  total 12K
  drwx--  3 user20 user 4.0K Nov 28 19:12 .
  drwxr-xr-x 18 root   root 4.0K Nov 28 19:12 ..
  drwx--  2 user20 user 4.0K Nov 28 19:12 WinAte

  ls -lah /home/user20/WinAte/
  total 8.0K
  drwx-- 2 user20 user 4.0K Nov 28 19:12 .
  drwx-- 3 user20 user 4.0K Nov 28 19:12 ..

  
  I noticed in the strace calls for useradd that the kernel is returning the 
correct count of directories, but the useradd is clearly not copying all of 
them. Below is the strace output.
  

  strace useradd -k /etc/skel -g 900 -m -s /bin/bash -p a_password -c User20 
user20
  execve("/usr/sbin/useradd", ["useradd", "-k", "/etc/skel", "-g", "900", "-m", 
"-s", "/bin/bash", "-p", "P@ssw0rd!", "-c", "User20", "user20"], 0x7fffe10eba10 
/* 24 vars */) = 0
  brk(NULL)   = 0x5631ba1c2000
  arch_prctl(0x3001 /* ARCH_??? */, 0x7fff0e47bab0) = -1 EINVAL (Invalid 
argument)
  access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=98383, ...}) = 0
  mmap(NULL, 98383, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fea9b7bf000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libaudit.so.1", O_RDONLY|O_CLOEXEC) = 
3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3407\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=133200, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fea9b7bd000
  mmap(NULL, 176296, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b791000
  mprotect(0x7fea9b794000, 118784, PROT_NONE) = 0
  mmap(0x7fea9b794000, 32768, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fea9b794000
  mmap(0x7fea9b79c000, 81920, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0xb000) = 0x7fea9b79c000
  mmap(0x7fea9b7b1000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7fea9b7b1000
  mmap(0x7fea9b7b3000, 37032, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fea9b7b3000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) 
= 3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@p\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=163200, ...}) = 0
  mmap(NULL, 174600, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b766000
  mprotect(0x7fea9b76c000, 135168, PROT_NONE) = 0
  mmap(0x7fea9b76c000, 102400, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fea9b76c000
  mmap(0x7fea9b785000, 28672, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0x1f000) = 0x7fea9b785000
  

[Touch-packages] [Bug 1998169] Re: useradd command does not copy all of /etc/skel

2022-11-29 Thread Camila Camargo de Matos
Initial analysis seems to indicate that this is happening due to a patch
added in the last update which is related to this commit:
https://github.com/shadow-
maint/shadow/commit/f3bdb28e57e5e38c1e89347976c7d61a181eec32. Checking
the manual for fchmodat in focal, it is possible to see the following:

AT_SYMLINK_NOFOLLOW
   If pathname is a symbolic link, do not dereference it: instead operate 
on the link itself.  This flag is not currently implemented.

The flags seems to not be currently implemented.

No further changes to the code have been made by upstream.

More investigation will be made and the last update will possibly be
reverted.

** Changed in: shadow (Ubuntu)
 Assignee: (unassigned) => Camila Camargo de Matos (ccdm94)

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/1998169

Title:
  useradd command does not copy all of /etc/skel

Status in shadow package in Ubuntu:
  Confirmed

Bug description:
  
  I know the useradd command is discouraged, but I wanted to report the bug to 
make the maintainers of the package aware.

  Recently there was an update of Ubuntu's passwd package which is
  sourced from shadow from version 4.8.1-1ubuntu5.20.04.2 to version
  4.8.1-1ubuntu5.20.04.3

  When using the useradd command, the /etc/skel directory with contents
  below, an only copies in one empty folder.

  
  ls -lah /etc/skel
  total 60K
  drwxrwxrwx  10 root user 4.0K Nov 28 18:33 .
  drwxr-xr-x 155 root root  12K Nov 28 19:12 ..
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .backgrounds
  -rwxrwxrwx   1 root user  220 Nov 28 18:23 .bash_logout
  -rwxrwxrwx   1 root user 3.7K Nov 28 18:23 .bashrc
  drwxrwxrwx   6 root user 4.0K Nov 28 18:23 .config
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 Desktop
  drwxrwxrwx   2 root user 4.0K Nov 28 18:30 .fonts_stuff
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .icons
  -rwxrwxrwx   1 root user  765 Nov 28 18:23 .profile
  drwxrwxrwx   2 root root 4.0K Nov 28 18:32 testfolderempty
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 .themes
  drwxrwxrwx  14 root user 4.0K Nov 28 18:23 WinAte
  
  ls -lah /home/user20
  total 12K
  drwx--  3 user20 user 4.0K Nov 28 19:12 .
  drwxr-xr-x 18 root   root 4.0K Nov 28 19:12 ..
  drwx--  2 user20 user 4.0K Nov 28 19:12 WinAte

  ls -lah /home/user20/WinAte/
  total 8.0K
  drwx-- 2 user20 user 4.0K Nov 28 19:12 .
  drwx-- 3 user20 user 4.0K Nov 28 19:12 ..

  
  I noticed in the strace calls for useradd that the kernel is returning the 
correct count of directories, but the useradd is clearly not copying all of 
them. Below is the strace output.
  

  strace useradd -k /etc/skel -g 900 -m -s /bin/bash -p a_password -c User20 
user20
  execve("/usr/sbin/useradd", ["useradd", "-k", "/etc/skel", "-g", "900", "-m", 
"-s", "/bin/bash", "-p", "P@ssw0rd!", "-c", "User20", "user20"], 0x7fffe10eba10 
/* 24 vars */) = 0
  brk(NULL)   = 0x5631ba1c2000
  arch_prctl(0x3001 /* ARCH_??? */, 0x7fff0e47bab0) = -1 EINVAL (Invalid 
argument)
  access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=98383, ...}) = 0
  mmap(NULL, 98383, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fea9b7bf000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libaudit.so.1", O_RDONLY|O_CLOEXEC) = 
3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3407\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=133200, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fea9b7bd000
  mmap(NULL, 176296, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b791000
  mprotect(0x7fea9b794000, 118784, PROT_NONE) = 0
  mmap(0x7fea9b794000, 32768, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fea9b794000
  mmap(0x7fea9b79c000, 81920, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0xb000) = 0x7fea9b79c000
  mmap(0x7fea9b7b1000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7fea9b7b1000
  mmap(0x7fea9b7b3000, 37032, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fea9b7b3000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) 
= 3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@p\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=163200, ...}) = 0
  mmap(NULL, 174600, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b766000
  

[Touch-packages] [Bug 1998169] Re: useradd command does not copy all of /etc/skel

2022-11-29 Thread David Fernandez Gonzalez
** Changed in: shadow (Ubuntu)
   Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/1998169

Title:
  useradd command does not copy all of /etc/skel

Status in shadow package in Ubuntu:
  Confirmed

Bug description:
  
  I know the useradd command is discouraged, but I wanted to report the bug to 
make the maintainers of the package aware.

  Recently there was an update of Ubuntu's passwd package which is
  sourced from shadow from version 4.8.1-1ubuntu5.20.04.2 to version
  4.8.1-1ubuntu5.20.04.3

  When using the useradd command, the /etc/skel directory with contents
  below, an only copies in one empty folder.

  
  ls -lah /etc/skel
  total 60K
  drwxrwxrwx  10 root user 4.0K Nov 28 18:33 .
  drwxr-xr-x 155 root root  12K Nov 28 19:12 ..
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .backgrounds
  -rwxrwxrwx   1 root user  220 Nov 28 18:23 .bash_logout
  -rwxrwxrwx   1 root user 3.7K Nov 28 18:23 .bashrc
  drwxrwxrwx   6 root user 4.0K Nov 28 18:23 .config
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 Desktop
  drwxrwxrwx   2 root user 4.0K Nov 28 18:30 .fonts_stuff
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .icons
  -rwxrwxrwx   1 root user  765 Nov 28 18:23 .profile
  drwxrwxrwx   2 root root 4.0K Nov 28 18:32 testfolderempty
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 .themes
  drwxrwxrwx  14 root user 4.0K Nov 28 18:23 WinAte
  
  ls -lah /home/user20
  total 12K
  drwx--  3 user20 user 4.0K Nov 28 19:12 .
  drwxr-xr-x 18 root   root 4.0K Nov 28 19:12 ..
  drwx--  2 user20 user 4.0K Nov 28 19:12 WinAte

  ls -lah /home/user20/WinAte/
  total 8.0K
  drwx-- 2 user20 user 4.0K Nov 28 19:12 .
  drwx-- 3 user20 user 4.0K Nov 28 19:12 ..

  
  I noticed in the strace calls for useradd that the kernel is returning the 
correct count of directories, but the useradd is clearly not copying all of 
them. Below is the strace output.
  

  strace useradd -k /etc/skel -g 900 -m -s /bin/bash -p a_password -c User20 
user20
  execve("/usr/sbin/useradd", ["useradd", "-k", "/etc/skel", "-g", "900", "-m", 
"-s", "/bin/bash", "-p", "P@ssw0rd!", "-c", "User20", "user20"], 0x7fffe10eba10 
/* 24 vars */) = 0
  brk(NULL)   = 0x5631ba1c2000
  arch_prctl(0x3001 /* ARCH_??? */, 0x7fff0e47bab0) = -1 EINVAL (Invalid 
argument)
  access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=98383, ...}) = 0
  mmap(NULL, 98383, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fea9b7bf000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libaudit.so.1", O_RDONLY|O_CLOEXEC) = 
3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3407\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=133200, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fea9b7bd000
  mmap(NULL, 176296, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b791000
  mprotect(0x7fea9b794000, 118784, PROT_NONE) = 0
  mmap(0x7fea9b794000, 32768, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fea9b794000
  mmap(0x7fea9b79c000, 81920, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0xb000) = 0x7fea9b79c000
  mmap(0x7fea9b7b1000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7fea9b7b1000
  mmap(0x7fea9b7b3000, 37032, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fea9b7b3000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) 
= 3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@p\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=163200, ...}) = 0
  mmap(NULL, 174600, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b766000
  mprotect(0x7fea9b76c000, 135168, PROT_NONE) = 0
  mmap(0x7fea9b76c000, 102400, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fea9b76c000
  mmap(0x7fea9b785000, 28672, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0x1f000) = 0x7fea9b785000
  mmap(0x7fea9b78d000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7fea9b78d000
  mmap(0x7fea9b78f000, 6664, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fea9b78f000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libsemanage.so.1", 
O_RDONLY|O_CLOEXEC) = 3
  read(3, 

[Touch-packages] [Bug 1998169] Re: useradd command does not copy all of /etc/skel

2022-11-28 Thread Chris Deckard
** Description changed:

  
  I know the useradd command is discouraged, but I wanted to report the bug to 
make the maintainers of the package aware.
  
- Recently there was an update of Ubuntu's passwd which is sourced from
- shadow from version 4.8.1-1ubuntu5.20.04.2 to version
+ Recently there was an update of Ubuntu's passwd package which is sourced
+ from shadow from version 4.8.1-1ubuntu5.20.04.2 to version
  4.8.1-1ubuntu5.20.04.3
  
+ When using the useradd command, the /etc/skel directory with contents
+ below, an only copies in one empty folder.
  
- When using the useradd command, the /etc/skel directory with contents 
  
  ls -lah /etc/skel
  total 60K
  drwxrwxrwx  10 root user 4.0K Nov 28 18:33 .
  drwxr-xr-x 155 root root  12K Nov 28 19:12 ..
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .backgrounds
  -rwxrwxrwx   1 root user  220 Nov 28 18:23 .bash_logout
  -rwxrwxrwx   1 root user 3.7K Nov 28 18:23 .bashrc
  drwxrwxrwx   6 root user 4.0K Nov 28 18:23 .config
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 Desktop
  drwxrwxrwx   2 root user 4.0K Nov 28 18:30 .fonts_stuff
  drwxrwxrwx   2 root user 4.0K Nov 28 18:23 .icons
  -rwxrwxrwx   1 root user  765 Nov 28 18:23 .profile
  drwxrwxrwx   2 root root 4.0K Nov 28 18:32 testfolderempty
  drwxrwxrwx   3 root user 4.0K Nov 28 18:23 .themes
  drwxrwxrwx  14 root user 4.0K Nov 28 18:23 WinAte
- 
- 
- only copies in the one empty folder.
  
  ls -lah /home/user20
  total 12K
  drwx--  3 user20 user 4.0K Nov 28 19:12 .
  drwxr-xr-x 18 root   root 4.0K Nov 28 19:12 ..
  drwx--  2 user20 user 4.0K Nov 28 19:12 WinAte
  
  ls -lah /home/user20/WinAte/
  total 8.0K
  drwx-- 2 user20 user 4.0K Nov 28 19:12 .
  drwx-- 3 user20 user 4.0K Nov 28 19:12 ..
  
  
  I noticed in the strace calls for useradd that the kernel is returning the 
correct count of directories, but the useradd is clearly not copying all of 
them. Below is the strace output.
  
  
- strace useradd -k /etc/skel -g 900 -m -s /bin/bash -p P@ssw0rd! -c User20 
user20
+ strace useradd -k /etc/skel -g 900 -m -s /bin/bash -p a_password -c User20 
user20
  execve("/usr/sbin/useradd", ["useradd", "-k", "/etc/skel", "-g", "900", "-m", 
"-s", "/bin/bash", "-p", "P@ssw0rd!", "-c", "User20", "user20"], 0x7fffe10eba10 
/* 24 vars */) = 0
  brk(NULL)   = 0x5631ba1c2000
  arch_prctl(0x3001 /* ARCH_??? */, 0x7fff0e47bab0) = -1 EINVAL (Invalid 
argument)
  access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=98383, ...}) = 0
  mmap(NULL, 98383, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fea9b7bf000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libaudit.so.1", O_RDONLY|O_CLOEXEC) = 
3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3407\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=133200, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fea9b7bd000
  mmap(NULL, 176296, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b791000
  mprotect(0x7fea9b794000, 118784, PROT_NONE) = 0
  mmap(0x7fea9b794000, 32768, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fea9b794000
  mmap(0x7fea9b79c000, 81920, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0xb000) = 0x7fea9b79c000
  mmap(0x7fea9b7b1000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7fea9b7b1000
  mmap(0x7fea9b7b3000, 37032, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fea9b7b3000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) 
= 3
  read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@p\0\0\0\0\0\0"..., 
832) = 832
  fstat(3, {st_mode=S_IFREG|0644, st_size=163200, ...}) = 0
  mmap(NULL, 174600, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fea9b766000
  mprotect(0x7fea9b76c000, 135168, PROT_NONE) = 0
  mmap(0x7fea9b76c000, 102400, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fea9b76c000
  mmap(0x7fea9b785000, 28672, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 
3, 0x1f000) = 0x7fea9b785000
  mmap(0x7fea9b78d000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7fea9b78d000
  mmap(0x7fea9b78f000, 6664, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fea9b78f000
  close(3)= 0
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libsemanage.so.1", 
O_RDONLY|O_CLOEXEC) = 3