Bug 13959 - ACLs: setfacl -m on a directory corrupts UID&GID in pseudo
Summary: ACLs: setfacl -m on a directory corrupts UID&GID in pseudo
Status: RESOLVED FIXED
Alias: None
Product: Pseudo
Classification: Yocto Project Subprojects
Component: pseudo (show other bugs)
Version: master
Hardware: x86 x86_64
: Medium+ normal
Target Milestone: 3.2 M2
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-06-26 02:02 UTC by Johannes Beisswenger
Modified: 2020-06-28 00:40 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: New (Never tested)
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Pseudo testcase that can be used to reproduce the issue (4.86 KB, application/x-shellscript)
2020-06-26 04:18 UTC, Johannes Beisswenger
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Beisswenger 2020-06-26 02:02:13 UTC
Preconditions/Environment
-------------------------
Ubuntu 18.04.4 LTS (Bionic Beaver)
pseudo at commit 060058b
With 0001-pseudo_ipc.h-Fix-enum-typedef.patch from poky(http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b4e1ce1b93b08c77047508f27915073db6315a8e) applied.

Triggering Action/Cause
-----------------------
Run `pseudo`.
Run `mkdir foobar`.
Run `setfacl -m "u:root:rX" foobar`.

Expectation
-----------
UID/GID of foobar should be 0/root.

`stat foobar`:
  File: foobar/
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
...
Access: (0775/drwxrwxr-x)  Uid: (    0/    root)   Gid: (    0/    root)
...

`getfacl foobar`:
# file: foobar/
# owner: root
# group: root
user::rwx
user:root:r-x
group::rwx
mask::rwx
other::r-x

Actual Result
-------------
UID/GID of foobar is 1001/jbe, the user running pseudo.

`getfacl foobar`:
# file: foobar/
# owner: jbe
# group: jbe
user::rwx
user:root:r-x
group::rwx
mask::rwx
other::r-x

`stat foobar`:
  File: foobar/
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
...
Access: (0755/drwxr-xr-x)  Uid: ( 1001/     jbe)   Gid: ( 1001/     jbe)
...


Reproducibility
---------------
This is 100% reproducible when restarting pseudo in between trials or when using a previously not used directory name.

Note: I have a patch fixing this issue which I will submit to the mailing list.
Comment 1 Johannes Beisswenger 2020-06-26 04:18:20 UTC
Created attachment 4696 [details]
Pseudo testcase that can be used to reproduce the issue

This is the testcase from this PATCH https://lists.openembedded.org/g/openembedded-core/message/140009.
Comment 2 Johannes Beisswenger 2020-06-26 04:22:07 UTC
Fix https://lists.openembedded.org/g/openembedded-core/message/140008
Comment 3 Richard Purdie 2020-06-28 00:40:41 UTC
Thanks, we've merged this into s staging branch and applied to OE-Core.

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=704a245460f1802cb83a1a7200d1bbfb5bc0c33c