| Summary: | linux setre*uid() doesn't handle uid -1 properly | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | SANETO Takanori <sanewo> | ||||
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 5.0-CURRENT | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
State Changed From-To: open->closed Fixed. Thanks! |
Although manpage of setre*uid() says that "Passing -1 as an argument causes the corresponding value to remain unchanged," under linux ABI, they are treated as if 65535 was specified. (Maybe this is i386 specific) Because of this, vmware won't start up on CURRENT. Fix: Following patch should fix the problem. Yes, it's a quick hack. How-To-Repeat: Compile following program in linux environment and run it as root. #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> void printid() { printf("ruid=%d, euid=%d\n", getuid(), geteuid()); } int main(int ac, char **av) { printid(); if (setreuid(-1,-1) < 0) { perror("setreuid"); exit(1); } printid(); }