diff options
author | Damien Miller <djm@mindrot.org> | 2006-06-13 05:05:15 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2006-06-13 05:05:15 +0200 |
commit | 6b4069ad563ce578cbfa6f90e76b462d26483e67 (patch) | |
tree | 777206b388f2ef12b83275d4aeb78e96cdea1bdd /sshconnect.h | |
parent | - markus@cvs.openbsd.org 2006/06/01 09:21:48 (diff) | |
download | openssh-6b4069ad563ce578cbfa6f90e76b462d26483e67.tar.xz openssh-6b4069ad563ce578cbfa6f90e76b462d26483e67.zip |
- markus@cvs.openbsd.org 2006/06/06 10:20:20
[readpass.c sshconnect.c sshconnect.h sshconnect2.c uidswap.c]
replace remaining setuid() calls with permanently_set_uid() and
check seteuid() return values; report Marcus Meissner; ok dtucker djm
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 @@ -/* $OpenBSD: sshconnect.h,v 1.19 2006/03/25 22:22:43 djm Exp $ */ +/* $OpenBSD: sshconnect.h,v 1.20 2006/06/06 10:20:20 markus Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -54,16 +54,20 @@ int ssh_local_cmd(const char *); /* * Macros to raise/lower permissions. */ -#define PRIV_START do { \ - int save_errno = errno; \ - (void)seteuid(original_effective_uid); \ - errno = save_errno; \ +#define PRIV_START do { \ + int save_errno = errno; \ + if (seteuid(original_effective_uid) != 0) \ + fatal("PRIV_START: seteuid: %s", \ + strerror(errno)); \ + errno = save_errno; \ } while (0) -#define PRIV_END do { \ - int save_errno = errno; \ - (void)seteuid(original_real_uid); \ - errno = save_errno; \ +#define PRIV_END do { \ + int save_errno = errno; \ + if (seteuid(original_real_uid) != 0) \ + fatal("PRIV_END: seteuid: %s", \ + strerror(errno)); \ + errno = save_errno; \ } while (0) #endif |