syscall: Setuid/Setgid doesn't apply to all threads on Linux #1435
Closed
Description
by ziutek@Lnet.pl:
What steps will reproduce the problem? Compile attached test code. Run it as root like this: # GOMAXPROCS=4 ./test 65534 65534 and note output: gorutine 1: uid=0 euid=0 gid=0 egid=0 gorutine 2: uid=0 euid=0 gid=0 egid=0 gorutine 3: uid=0 euid=0 gid=0 egid=0 gorutine 4: uid=0 euid=0 gid=0 egid=0 gorutine 5: uid=0 euid=0 gid=0 egid=0 gorutine 6: uid=0 euid=0 gid=0 egid=0 gorutine 7: uid=0 euid=0 gid=0 egid=0 gorutine 8: uid=0 euid=0 gid=0 egid=0 gorutine 9: uid=0 euid=0 gid=0 egid=0 gorutine 0: uid=65534 euid=65534 gid=65534 egid=65534 gorutine 1: uid=0 euid=0 gid=0 egid=0 gorutine 2: uid=0 euid=0 gid=0 egid=0 gorutine 3: uid=0 euid=0 gid=0 egid=0 gorutine 4: uid=0 euid=0 gid=0 egid=0 gorutine 5: uid=0 euid=0 gid=0 egid=0 gorutine 6: uid=0 euid=0 gid=0 egid=0 gorutine 7: uid=0 euid=0 gid=0 egid=0 gorutine 8: uid=0 euid=0 gid=0 egid=0 gorutine 9: uid=0 euid=0 gid=0 egid=0 gorutine 0: uid=65534 euid=65534 gid=65534 egid=65534 Use ps -efL during test execution and note output: UID PID PPID LWP C NLWP STIME TTY TIME CMD nobody 26088 25928 26088 0 10 11:56 pts/1 00:00:00 ./test 65534 65534 root 26088 25928 26089 0 10 11:56 pts/1 00:00:00 ./test 65534 65534 root 26088 25928 26090 0 10 11:56 pts/1 00:00:00 ./test 65534 65534 root 26088 25928 26091 0 10 11:56 pts/1 00:00:00 ./test 65534 65534 root 26088 25928 26092 0 10 11:56 pts/1 00:00:00 ./test 65534 65534 root 26088 25928 26093 0 10 11:56 pts/1 00:00:00 ./test 65534 65534 root 26088 25928 26094 0 10 11:56 pts/1 00:00:00 ./test 65534 65534 root 26088 25928 26095 0 10 11:56 pts/1 00:00:00 ./test 65534 65534 root 26088 25928 26096 0 10 11:56 pts/1 00:00:00 ./test 65534 65534 root 26088 25928 26097 0 10 11:56 pts/1 00:00:00 ./test 65534 65534 What is the expected output? All threads must have the same UID/GID: (65534, nobody user in my system). Which compiler are you using (5g, 6g, 8g, gccgo)? I tested this with 6g and 8g. Which operating system are you using? Linux (Debian 6.0 SID on i386, Ubuntu 10.10 on amd64) Which revision are you using? (hg identify) d8ba80011a98 release/release.2011-01-20 Please provide any additional information below. http://groups.google.com/group/golang-nuts/browse_thread/thread/59597aafdd84a0e
Attachments:
- test.go (1067 bytes)