Enrico Scholz <[email protected]> writes:

> Seen on scarthgap bc793fa9d1fe24c102d91e97b7002b6e637cbfa5 and it seems
> to be very reproducible (both the failure on ubuntu-20.04 and the success
> on fedora-39).

Can be reproduced manually by setting the PSEUDO environment and
invoking

| pseudo useradd -R `pwd`/rootfs bar1
| pseudo ls -la rootfs/home/bar1


Problem is somewhere in the interpretation of the fstatat() result in

4.14.2/shadow-4.14.2/lib/copydir.c

| 443           if (fstatat(dst->dirfd, dst->name, &sb, AT_SYMLINK_NOFOLLOW) != 
-1) {
|                       return 0;
|               }
| 
| +             printf("fstatat(%d, %s) -> dev=%d, ino=%d, mode=%o\n",
| +                    dst->dirfd, dst->name, (int)sb.st_dev, (int)sb.st_ino, 
sb.st_mode);


Shows here (content is from /etc/skel)

| fstatat(5, .profile) -> dev=64514, ino=1787061952, mode=15241063300
| fstatat(5, .bashrc) -> dev=64514, ino=1787061952, mode=15241063300

While

| $ stat rootfs/etc/skel/. 
|   File: rootfs/etc/skel/.bashrc
|   Size: 410             Blocks: 8          IO Block: 4096   regular file
| Device: 252,2   Inode: 19552578    Links: 1

is expected.



Pseudo log shows for this call

1914825: wrapper called: __fxstatat
1914825: __fxstatat - signals blocked, obtaining lock
1914825: paes: newpath .../rootfs/etc/skel, element list <.bashrc>
1914825: element to add: '.bashrc'
1914825: pae: '.../rootfs/etc/skel', + '.bashrc', is_dir 1
1914825: paes: append_element gave us '.../rootfs/etc/skel/.bashrc', current ''
1914825: .../rootfs/etc/skel + .bashrc => <.../rootfs/etc/skel/.bashrc>
1914825: base_path[nofollow]: .../rootfs/etc/skel</>.bashrc => 
.../rootfs/etc/skel/.bashrc
1914825: root_path [__fxstatat, 235]: '.../rootfs/etc/skel/.bashrc' from 
'.bashrc'
1914825: statat .../rootfs/etc/skel/.bashrc (+buf) (0100755): processing 
request [ino 19552578]
1914825: sending request [ino 19552578]
1914825: sending a message: ino 19552578
1914825: msg type 3 (stat), external path .../rootfs/etc/skel/.bashrc, mode 
0100755
1914825: wrote 182 bytes
1914825: sent!



Enrico
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197248): 
https://lists.openembedded.org/g/openembedded-core/message/197248
Mute This Topic: https://lists.openembedded.org/mt/104950372/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to