| Summary: | Make concept of "root UID" more abstract for Interix support | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Todd Vierling <tv> | ||||||
| Component: | Miscellaneous | Assignee: | Assigned to nobody <unassigned-bugs> | ||||||
| Status: | CLOSED WONTFIX | ||||||||
| Severity: | enhancement | CC: | djm | ||||||
| Priority: | P3 | ||||||||
| Version: | 4.2p1 | ||||||||
| Hardware: | Other | ||||||||
| OS: | Other | ||||||||
| Bug Depends on: | 1112, 1113 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Todd Vierling
2005-11-05 15:31:38 AEDT
Created attachment 1022 [details]
Patch abstracting root uid/gid to ROOTUID/ROOTGID macros
If we're going to do this, I'd rather have it know the difference between the various privileges, eg "have_privilege(BIND_LOW_PORT)" or "have_privilege(SWITCH_USER)" and so on. Of course, the question remains: why does a Unix compatibility layer have a root uid that's not zero? Interix user IDs come from its parent OS (Windows). Local system-supplied users are 0x30000 + <system uid>, and "Administrator" is system uid 1000. It's really unfortunate that there is no special-case maping to 0. But as I noted, the rights that openssh uses are available to more than just the "root" user -- anyone in a specific group can also do setuid. This is not too far of a departure from POSIX.1e CAP_SETUID, so maybe it would be appropriate to do the abstraction anyway? (The important part here though is that such a refactor would probably need to bubble back up to the OpenBSD source repo level.) Created attachment 1026 [details]
split uid checks into capabilities.
First attempt. Doesn't consider uids currently.
(In reply to comment #4) > First attempt. Doesn't consider uids currently. Err, make that "doesn't consider gids". (In reply to comment #3) > Interix user IDs come from its parent OS (Windows). Local system-supplied > users are 0x30000 + <system uid>, and "Administrator" is system uid 1000. Hmm, that doesn't quite seem to add up. Your patch has: +# define ROOTUID 197108 but 0x30000 + 1000 = 197608 Sorry, I miswrote. The Interix "Administrator" user is Win32 UID 500, not 1000. That's the reason for the discrepancy. I think this is obsolete with the addition of native windows OpenSSH closing resolved bugs as of 8.6p1 release |