Fake UID/GID facility not working
- Found in: 1.19
CategoryFixed: fixed in 847 (and in Git)
PlashGlibc's facility for faking the UID/GID is not working.
Actual result:
$ id uid=1000(mrs) gid=1000(mrs) groups=1000(mrs) $ pola-run -fw / -e id uid=1652053 gid=1652053 $ pola-run -fw / -e env | grep FAKE PLASH_FAKE_EUID=1000 PLASH_FAKE_UID=1000 PLASH_FAKE_EGID=1000 PLASH_FAKE_GID=1000
Expected result: id should give the same output when run through pola-run for the uid and gid fields. The groups field may be missing under pola-run:
$ pola-run -fw / -e id uid=1000 gid=1000 OR uid=1000(mrs) gid=1000(mrs)
(Note that the user/group name may be omitted as a result of PlashIssues/CloexecOpenFails.)
This is a regression introduced by Story6.
Thomas Leonard reported this problem; see mailing list post.
I have created a page, UidFaking, to explain this feature.
This would have been caught by a test in run-tests.pl, but those tests are not being run any more. They should be converted to Python. See StoryTest4.
The initial change for this bug worked on amd64 but broke the build of PlashGlibc on i386. The fix was to change sysdeps/unix/sysv/linux/i386/getuid.c and rename getuid() to kernel_getuid(). The problem was that we have overridden getuid.c.
- Could rename linux/i386's getuid.c to kernel_getuid.c. However, that could cause problems with merging in the future. Also, it is not the approach I have taken so far. I have not renamed any files so far.
- Could make the override conditional on architecture. Could be icky.
Change syscalls.list files so that they produce getuid.os again, instead of kernel_getuid.os, and remove the override of getuid.c.
This is roughly in line with handling fork(), where fork.os defines kernel_fork. It is different from handling of close(), where kernel_close.os defines kernel_close.
