]> andersk Git - openssh.git/blobdiff - sshconnect.h
- stevesk@cvs.openbsd.org 2006/07/06 16:03:53
[openssh.git] / sshconnect.h
index 0be30fe695aa838ddded6f826798c9a4f50455e6..c1b07390b38d155ed49988ed5938bad0b54084c4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sshconnect.h,v 1.17 2002/06/19 00:27:55 deraadt Exp $ */
+/* $OpenBSD: sshconnect.h,v 1.21 2006/07/06 16:03:53 stevesk Exp $ */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
 #ifndef SSHCONNECT_H
 #define SSHCONNECT_H
 
+#include <sys/types.h>
+
+#include <pwd.h>
+
 typedef struct Sensitive Sensitive;
 struct Sensitive {
        Key     **keys;
@@ -49,21 +53,25 @@ void         ssh_userauth1(const char *, const char *, char *, Sensitive *);
 void    ssh_userauth2(const char *, const char *, char *, Sensitive *);
 
 void    ssh_put_password(char *);
-
+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
This page took 0.141343 seconds and 4 git commands to generate.