]> andersk Git - openssh.git/blobdiff - sshconnect.h
- djm@cvs.openbsd.org 2010/01/30 02:54:53
[openssh.git] / sshconnect.h
index e7c7a2b340dee3bfad9b772a1c389f8f6070c1b2..c59a097f4eba62ffd5d3df34569bea4843b0828c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sshconnect.h,v 1.18 2005/12/06 22:38:28 reyk Exp $    */
+/* $OpenBSD: sshconnect.h,v 1.25 2009/05/27 06:38:16 andreas Exp $ */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -23,8 +23,6 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#ifndef SSHCONNECT_H
-#define SSHCONNECT_H
 
 typedef struct Sensitive Sensitive;
 struct Sensitive {
@@ -35,10 +33,12 @@ struct Sensitive {
 
 int
 ssh_connect(const char *, struct sockaddr_storage *, u_short, int, int,
-    int, const char *);
+    int *, int, int, const char *);
 
 void
-ssh_login(Sensitive *, const char *, struct sockaddr *, struct passwd *);
+ssh_login(Sensitive *, const char *, struct sockaddr *, struct passwd *, int);
+
+void    ssh_exchange_identification(int);
 
 int     verify_host_key(char *, struct sockaddr *, Key *);
 
@@ -54,16 +54,18 @@ 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.031935 seconds and 4 git commands to generate.