diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-07-08 18:25:19 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-07-08 18:25:19 +0000 |
commit | 001129e2153633dbd079889b11331e9c27786e5b (patch) | |
tree | 0ac7735a81ccd554005883a2c9696a0bbe2daceb /source/nsswitch/winbindd.c | |
parent | 3dc9fd076a2c4c352d51f7b9dfa8b570a231c9e2 (diff) | |
download | samba-001129e2153633dbd079889b11331e9c27786e5b.tar.gz samba-001129e2153633dbd079889b11331e9c27786e5b.tar.xz samba-001129e2153633dbd079889b11331e9c27786e5b.zip |
allow winbindd to run as non-root so we can test it more easily
Diffstat (limited to 'source/nsswitch/winbindd.c')
-rw-r--r-- | source/nsswitch/winbindd.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/nsswitch/winbindd.c b/source/nsswitch/winbindd.c index 9371078a79d..b81d60dc66c 100644 --- a/source/nsswitch/winbindd.c +++ b/source/nsswitch/winbindd.c @@ -167,7 +167,8 @@ static int create_sock(void) return -1; } - if ((st.st_uid != 0) || ((st.st_mode & 0777) != 0755)) { + if ((st.st_uid != sec_initial_uid()) || + ((st.st_mode & 0777) != 0755)) { DEBUG(0, ("invalid permissions on socket directory %s\n", WINBINDD_SOCKET_DIR)); return -1; @@ -645,12 +646,7 @@ int main(int argc, char **argv) BOOL interactive = False; int opt, new_debuglevel = -1; - /* Must be root */ - - if(geteuid() != (uid_t)0) { - fprintf(stderr, "Must have effective user id of zero.\n"); - exit(1); - } + sec_init(); /* Set environment variable so we don't recursively call ourselves. This may also be useful interactively. */ |