diff options
Diffstat (limited to 'sshconnect.h')
-rw-r--r-- | sshconnect.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sshconnect.h b/sshconnect.h index 3786ba56e..692d27567 100644 --- a/sshconnect.h +++ b/sshconnect.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect.h,v 1.19 2006/03/25 22:22:43 djm Exp $ */ | 1 | /* $OpenBSD: sshconnect.h,v 1.20 2006/06/06 10:20:20 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
@@ -54,16 +54,20 @@ int ssh_local_cmd(const char *); | |||
54 | /* | 54 | /* |
55 | * Macros to raise/lower permissions. | 55 | * Macros to raise/lower permissions. |
56 | */ | 56 | */ |
57 | #define PRIV_START do { \ | 57 | #define PRIV_START do { \ |
58 | int save_errno = errno; \ | 58 | int save_errno = errno; \ |
59 | (void)seteuid(original_effective_uid); \ | 59 | if (seteuid(original_effective_uid) != 0) \ |
60 | errno = save_errno; \ | 60 | fatal("PRIV_START: seteuid: %s", \ |
61 | strerror(errno)); \ | ||
62 | errno = save_errno; \ | ||
61 | } while (0) | 63 | } while (0) |
62 | 64 | ||
63 | #define PRIV_END do { \ | 65 | #define PRIV_END do { \ |
64 | int save_errno = errno; \ | 66 | int save_errno = errno; \ |
65 | (void)seteuid(original_real_uid); \ | 67 | if (seteuid(original_real_uid) != 0) \ |
66 | errno = save_errno; \ | 68 | fatal("PRIV_END: seteuid: %s", \ |
69 | strerror(errno)); \ | ||
70 | errno = save_errno; \ | ||
67 | } while (0) | 71 | } while (0) |
68 | 72 | ||
69 | #endif | 73 | #endif |