version 1.18, 2005/12/06 22:38:28 |
version 1.18.2.1, 2006/09/30 04:06:51 |
|
|
/* $OpenBSD$ */ |
/* $OpenBSD$ */ |
|
|
/* |
/* |
* Copyright (c) 2000 Markus Friedl. All rights reserved. |
* Copyright (c) 2000 Markus Friedl. All rights reserved. |
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
*/ |
#ifndef SSHCONNECT_H |
|
#define SSHCONNECT_H |
|
|
|
typedef struct Sensitive Sensitive; |
typedef struct Sensitive Sensitive; |
struct Sensitive { |
struct Sensitive { |
|
|
/* |
/* |
* Macros to raise/lower permissions. |
* Macros to raise/lower permissions. |
*/ |
*/ |
#define PRIV_START do { \ |
#define PRIV_START do { \ |
int save_errno = errno; \ |
int save_errno = errno; \ |
(void)seteuid(original_effective_uid); \ |
if (seteuid(original_effective_uid) != 0) \ |
errno = save_errno; \ |
fatal("PRIV_START: seteuid: %s", \ |
|
strerror(errno)); \ |
|
errno = save_errno; \ |
} while (0) |
} while (0) |
|
|
#define PRIV_END do { \ |
#define PRIV_END do { \ |
int save_errno = errno; \ |
int save_errno = errno; \ |
(void)seteuid(original_real_uid); \ |
if (seteuid(original_real_uid) != 0) \ |
errno = save_errno; \ |
fatal("PRIV_END: seteuid: %s", \ |
|
strerror(errno)); \ |
|
errno = save_errno; \ |
} while (0) |
} while (0) |
|
|
#endif |
|