Re: [OE-core] '.bashrc': Unknown file type; file ignored

2024-03-18 Thread Alexander Kanavin
On Mon, 18 Mar 2024 at 11:59, Enrico Scholz via lists.openembedded.org
 wrote:
>
> Enrico Scholz  writes:
>
> > 4.14.2/shadow-4.14.2/lib/copydir.c
> >
> > | 443 if (fstatat(dst->dirfd, dst->name, , AT_SYMLINK_NOFOLLOW) 
> > != -1) {
> > | return 0;
> > | }
>
> Bug in shadow-utils; when fstatat() fails, content of 'sb' will still be
> used.
>
>   
> https://github.com/shadow-maint/shadow/blob/f4293f9fbc2b855878f549d9124bdd638fb08c60/lib/copydir.c#L439-L447
>
> pseudo might trigger it because it calls the __fxstatat64() with an
> uninitialized 64 bit buffer and copies its content to the 32 bit buffer.

Thanks for digging, this makes sense as the code and the issue only
appear from 4.14 onwards. We had erroneously ascribed the problem to
static linking.

Alex

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197303): 
https://lists.openembedded.org/g/openembedded-core/message/197303
Mute This Topic: https://lists.openembedded.org/mt/104950372/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] '.bashrc': Unknown file type; file ignored

2024-03-18 Thread Enrico Scholz via lists.openembedded.org
Enrico Scholz  writes:

> 4.14.2/shadow-4.14.2/lib/copydir.c
>
> | 443 if (fstatat(dst->dirfd, dst->name, , AT_SYMLINK_NOFOLLOW) != 
> -1) {
> | return 0;
> | }

Bug in shadow-utils; when fstatat() fails, content of 'sb' will still be
used.

  
https://github.com/shadow-maint/shadow/blob/f4293f9fbc2b855878f549d9124bdd638fb08c60/lib/copydir.c#L439-L447

pseudo might trigger it because it calls the __fxstatat64() with an
uninitialized 64 bit buffer and copies its content to the 32 bit buffer.


Enrico

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197302): 
https://lists.openembedded.org/g/openembedded-core/message/197302
Mute This Topic: https://lists.openembedded.org/mt/104950372/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] '.bashrc': Unknown file type; file ignored

2024-03-15 Thread Enrico Scholz via lists.openembedded.org
Enrico Scholz  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, , 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: 19552578Links: 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: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] '.bashrc': Unknown file type; file ignored

2024-03-15 Thread Enrico Scholz via lists.openembedded.org
Hello,

with ubuntu-20.04 based builders I get problems like

| DEBUG: Executing shell function do_image_tar
| tar: ./home/.../.bashrc: Unknown file type; file ignored
| tar: Exiting with failure status due to previous errors
| WARNING: exit code 1 from a shell command.
| NOTE: recipe ...-image-core-1.0-r0: task do_image_tar: Failed

or

| Creating journal (8192 blocks): done
| Copying files into the device: __populate_fs: ignoring entry ".bashrc"
| .bashrc: File not found by ext2_lookup while looking up ".bashrc"
| mkfs.ext4: File not found by ext2_lookup while populating file system
| 
| + bb_sh_exit_handler
| + ret=1
| + [ 1 != 0 ]
| + echo WARNING: exit code 1 from a shell command.
| + exit 1
| WARNING: exit code 1 from a shell command.
| NOTE: recipe ...-image-1.0-r0: task do_image_wic: Failed


Build works fine under fedora-39 based builders.

I see related discussions at 2024-01-18 ("shadow: link executables
statically for -native variant") but not after.


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



Enrico

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197140): 
https://lists.openembedded.org/g/openembedded-core/message/197140
Mute This Topic: https://lists.openembedded.org/mt/104950372/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-