diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.c | 8 | ||||
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.h | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index 6d6aafa4f..b12725773 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | 17 | ||
18 | RCSID("$Id: bsd-cygwin_util.c,v 1.6 2001/11/27 01:19:44 tim Exp $"); | 18 | RCSID("$Id: bsd-cygwin_util.c,v 1.7 2001/12/29 03:08:30 djm Exp $"); |
19 | 19 | ||
20 | #ifdef HAVE_CYGWIN | 20 | #ifdef HAVE_CYGWIN |
21 | 21 | ||
@@ -58,7 +58,7 @@ int binary_pipe(int fd[2]) | |||
58 | return ret; | 58 | return ret; |
59 | } | 59 | } |
60 | 60 | ||
61 | int check_nt_auth(int pwd_authenticated, uid_t uid) | 61 | int check_nt_auth(int pwd_authenticated, struct passwd *pw) |
62 | { | 62 | { |
63 | /* | 63 | /* |
64 | * The only authentication which is able to change the user | 64 | * The only authentication which is able to change the user |
@@ -73,6 +73,8 @@ int check_nt_auth(int pwd_authenticated, uid_t uid) | |||
73 | */ | 73 | */ |
74 | static int has_create_token = -1; | 74 | static int has_create_token = -1; |
75 | 75 | ||
76 | if (pw == NULL) | ||
77 | return 0; | ||
76 | if (is_winnt) { | 78 | if (is_winnt) { |
77 | if (has_create_token < 0) { | 79 | if (has_create_token < 0) { |
78 | struct utsname uts; | 80 | struct utsname uts; |
@@ -90,7 +92,7 @@ int check_nt_auth(int pwd_authenticated, uid_t uid) | |||
90 | } | 92 | } |
91 | } | 93 | } |
92 | if (has_create_token < 1 && | 94 | if (has_create_token < 1 && |
93 | !pwd_authenticated && geteuid() != uid) | 95 | !pwd_authenticated && geteuid() != pw->pw_uid) |
94 | return 0; | 96 | return 0; |
95 | } | 97 | } |
96 | return 1; | 98 | return 1; |
diff --git a/openbsd-compat/bsd-cygwin_util.h b/openbsd-compat/bsd-cygwin_util.h index 24063d311..c3d90518f 100644 --- a/openbsd-compat/bsd-cygwin_util.h +++ b/openbsd-compat/bsd-cygwin_util.h | |||
@@ -13,7 +13,7 @@ | |||
13 | * binary mode on Windows systems. | 13 | * binary mode on Windows systems. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | /* $Id: bsd-cygwin_util.h,v 1.5 2001/11/27 01:19:44 tim Exp $ */ | 16 | /* $Id: bsd-cygwin_util.h,v 1.6 2001/12/29 03:08:30 djm Exp $ */ |
17 | 17 | ||
18 | #ifndef _BSD_CYGWIN_UTIL_H | 18 | #ifndef _BSD_CYGWIN_UTIL_H |
19 | #define _BSD_CYGWIN_UTIL_H | 19 | #define _BSD_CYGWIN_UTIL_H |
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | int binary_open(const char *filename, int flags, ...); | 25 | int binary_open(const char *filename, int flags, ...); |
26 | int binary_pipe(int fd[2]); | 26 | int binary_pipe(int fd[2]); |
27 | int check_nt_auth(int pwd_authenticated, uid_t uid); | 27 | int check_nt_auth(int pwd_authenticated, struct passwd *pw); |
28 | int check_ntsec(const char *filename); | 28 | int check_ntsec(const char *filename); |
29 | void register_9x_service(void); | 29 | void register_9x_service(void); |
30 | 30 | ||