summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-08-29 11:33:50 +1100
committerDamien Miller <djm@mindrot.org>2000-08-29 11:33:50 +1100
commitcaf6dd6d219e916e2784b3c884a7f2ce8784df37 (patch)
treeaa41094fe8f805cd56791ff3d023a785fe1d1c29
parent4e0f5e1ec9b6318ef251180dbca50eaa01f74536 (diff)
- More OpenBSD updates:
- deraadt@cvs.openbsd.org 2000/08/24 15:46:59 [scp.c] off_t in sink, to fix files > 2GB, i think, test is still running ;-) - deraadt@cvs.openbsd.org 2000/08/25 10:10:06 [session.c] Wall - markus@cvs.openbsd.org 2000/08/26 04:33:43 [compat.c] ssh.com-2.3.0 - markus@cvs.openbsd.org 2000/08/27 12:18:05 [compat.c] compatibility with future ssh.com versions - deraadt@cvs.openbsd.org 2000/08/27 21:50:55 [auth-krb4.c session.c ssh-add.c sshconnect.c uidswap.c] print uid/gid as unsigned - markus@cvs.openbsd.org 2000/08/28 13:51:00 [ssh.c] enable -n and -f for ssh2 - markus@cvs.openbsd.org 2000/08/28 14:19:53 [ssh.c] allow combination of -N and -f - markus@cvs.openbsd.org 2000/08/28 14:20:56 [util.c] util.c - markus@cvs.openbsd.org 2000/08/28 14:22:02 [util.c] undo - markus@cvs.openbsd.org 2000/08/28 14:23:38 [util.c] don't complain if setting NONBLOCK fails with ENODEV
-rw-r--r--ChangeLog31
-rw-r--r--acconfig.h1
-rw-r--r--auth-krb4.c4
-rw-r--r--compat.c5
-rw-r--r--configure.in14
-rw-r--r--defines.h5
-rw-r--r--scp.c5
-rw-r--r--session.c8
-rw-r--r--ssh-add.12
-rw-r--r--ssh-add.c5
-rw-r--r--ssh-agent.12
-rw-r--r--ssh.12
-rw-r--r--ssh.c22
-rw-r--r--sshconnect.c8
-rw-r--r--sshd.82
-rw-r--r--uidswap.c12
-rw-r--r--util.c6
17 files changed, 96 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index 19e8ca3b4..79bdcd502 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,37 @@
2 - (djm) Fix ^C ignored issue on Solaris. Diagnosis from Gert 2 - (djm) Fix ^C ignored issue on Solaris. Diagnosis from Gert
3 Doering <gert@greenie.muc.de>, John Horne <J.Horne@plymouth.ac.uk> and 3 Doering <gert@greenie.muc.de>, John Horne <J.Horne@plymouth.ac.uk> and
4 Garrick James <garrick@james.net> 4 Garrick James <garrick@james.net>
5 - More OpenBSD updates:
6 - deraadt@cvs.openbsd.org 2000/08/24 15:46:59
7 [scp.c]
8 off_t in sink, to fix files > 2GB, i think, test is still running ;-)
9 - deraadt@cvs.openbsd.org 2000/08/25 10:10:06
10 [session.c]
11 Wall
12 - markus@cvs.openbsd.org 2000/08/26 04:33:43
13 [compat.c]
14 ssh.com-2.3.0
15 - markus@cvs.openbsd.org 2000/08/27 12:18:05
16 [compat.c]
17 compatibility with future ssh.com versions
18 - deraadt@cvs.openbsd.org 2000/08/27 21:50:55
19 [auth-krb4.c session.c ssh-add.c sshconnect.c uidswap.c]
20 print uid/gid as unsigned
21 - markus@cvs.openbsd.org 2000/08/28 13:51:00
22 [ssh.c]
23 enable -n and -f for ssh2
24 - markus@cvs.openbsd.org 2000/08/28 14:19:53
25 [ssh.c]
26 allow combination of -N and -f
27 - markus@cvs.openbsd.org 2000/08/28 14:20:56
28 [util.c]
29 util.c
30 - markus@cvs.openbsd.org 2000/08/28 14:22:02
31 [util.c]
32 undo
33 - markus@cvs.openbsd.org 2000/08/28 14:23:38
34 [util.c]
35 don't complain if setting NONBLOCK fails with ENODEV
5 36
620000823 3720000823
7 - (djm) Define USE_PIPES to avoid socketpair problems on HPUX 10 and SunOS 4 38 - (djm) Define USE_PIPES to avoid socketpair problems on HPUX 10 and SunOS 4
diff --git a/acconfig.h b/acconfig.h
index eeee4eaf1..c16ec2bf6 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -203,6 +203,7 @@
203#undef MAIL_DIRECTORY 203#undef MAIL_DIRECTORY
204 204
205/* Data types */ 205/* Data types */
206#undef HAVE_U_INT
206#undef HAVE_INTXX_T 207#undef HAVE_INTXX_T
207#undef HAVE_U_INTXX_T 208#undef HAVE_U_INTXX_T
208#undef HAVE_UINTXX_T 209#undef HAVE_UINTXX_T
diff --git a/auth-krb4.c b/auth-krb4.c
index ae2b2a3d8..8715dc0d9 100644
--- a/auth-krb4.c
+++ b/auth-krb4.c
@@ -9,7 +9,7 @@
9#include "ssh.h" 9#include "ssh.h"
10#include "servconf.h" 10#include "servconf.h"
11 11
12RCSID("$OpenBSD: auth-krb4.c,v 1.16 2000/08/02 17:27:04 provos Exp $"); 12RCSID("$OpenBSD: auth-krb4.c,v 1.17 2000/08/28 03:50:54 deraadt Exp $");
13 13
14#ifdef KRB4 14#ifdef KRB4
15char *ticket = NULL; 15char *ticket = NULL;
@@ -154,7 +154,7 @@ krb4_init(uid_t uid)
154 if (lstat("/ticket", &st) != -1) 154 if (lstat("/ticket", &st) != -1)
155 tkt_root = "/ticket/"; 155 tkt_root = "/ticket/";
156#endif /* AFS */ 156#endif /* AFS */
157 snprintf(ticket, MAXPATHLEN, "%s%d_%d", tkt_root, uid, getpid()); 157 snprintf(ticket, MAXPATHLEN, "%s%u_%d", tkt_root, uid, getpid());
158 (void) krb_set_tkt_string(ticket); 158 (void) krb_set_tkt_string(ticket);
159 } 159 }
160 /* Register ticket cleanup in case of fatal error. */ 160 /* Register ticket cleanup in case of fatal error. */
diff --git a/compat.c b/compat.c
index 595a0a378..5d3940ab4 100644
--- a/compat.c
+++ b/compat.c
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#include "includes.h" 30#include "includes.h"
31RCSID("$OpenBSD: compat.c,v 1.19 2000/07/09 01:27:32 ho Exp $"); 31RCSID("$OpenBSD: compat.c,v 1.21 2000/08/27 18:18:04 markus Exp $");
32 32
33#include "ssh.h" 33#include "ssh.h"
34#include "packet.h" 34#include "packet.h"
@@ -61,11 +61,12 @@ compat_datafellows(const char *version)
61 char *version; 61 char *version;
62 int bugs; 62 int bugs;
63 } check[] = { 63 } check[] = {
64 {"2.2.0", SSH_BUG_HMAC|SSH_COMPAT_SESSIONID_ENCODING},
65 {"2.1.0", SSH_BUG_SIGBLOB|SSH_BUG_HMAC}, 64 {"2.1.0", SSH_BUG_SIGBLOB|SSH_BUG_HMAC},
66 {"2.0.1", SSH_BUG_SIGBLOB|SSH_BUG_HMAC|SSH_BUG_PUBKEYAUTH|SSH_BUG_X11FWD}, 65 {"2.0.1", SSH_BUG_SIGBLOB|SSH_BUG_HMAC|SSH_BUG_PUBKEYAUTH|SSH_BUG_X11FWD},
66 {"2.", SSH_BUG_HMAC|SSH_COMPAT_SESSIONID_ENCODING},
67 {NULL, 0} 67 {NULL, 0}
68 }; 68 };
69 /* process table, return first match */
69 for (i = 0; check[i].version; i++) { 70 for (i = 0; check[i].version; i++) {
70 len = strlen(check[i].version); 71 len = strlen(check[i].version);
71 if (strlen(version) >= len && 72 if (strlen(version) >= len &&
diff --git a/configure.in b/configure.in
index 02287b802..824ff5c02 100644
--- a/configure.in
+++ b/configure.in
@@ -465,6 +465,19 @@ AC_CHECK_SIZEOF(long int, 4)
465AC_CHECK_SIZEOF(long long int, 8) 465AC_CHECK_SIZEOF(long long int, 8)
466 466
467# More checks for data types 467# More checks for data types
468AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
469 AC_TRY_COMPILE(
470 [ #include <sys/types.h> ],
471 [ u_int a; a = 1;],
472 [ ac_cv_have_u_int="yes" ],
473 [ ac_cv_have_u_int="no" ]
474 )
475])
476if test "x$ac_cv_have_u_int" = "xyes" ; then
477 AC_DEFINE(HAVE_U_INT)
478 have_u_int=1
479fi
480
468AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ 481AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
469 AC_TRY_COMPILE( 482 AC_TRY_COMPILE(
470 [ #include <sys/types.h> ], 483 [ #include <sys/types.h> ],
@@ -491,7 +504,6 @@ if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
491 have_u_intxx_t=1 504 have_u_intxx_t=1
492fi 505fi
493 506
494
495if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ 507if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
496 test "x$ac_cv_header_sys_bitypes_h" = "xyes") 508 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
497then 509then
diff --git a/defines.h b/defines.h
index 1fe74a92b..6bbb5166b 100644
--- a/defines.h
+++ b/defines.h
@@ -102,6 +102,11 @@ enum
102 102
103/* If sys/types.h does not supply intXX_t, supply them ourselves */ 103/* If sys/types.h does not supply intXX_t, supply them ourselves */
104/* (or die trying) */ 104/* (or die trying) */
105
106#ifndef HAVE_U_INT
107typedef unsigned int u_int;
108#endif
109
105#ifndef HAVE_INTXX_T 110#ifndef HAVE_INTXX_T
106# if (SIZEOF_CHAR == 1) 111# if (SIZEOF_CHAR == 1)
107typedef char int8_t; 112typedef char int8_t;
diff --git a/scp.c b/scp.c
index d2e4224bb..5a5d0f469 100644
--- a/scp.c
+++ b/scp.c
@@ -47,7 +47,7 @@
47 */ 47 */
48 48
49#include "includes.h" 49#include "includes.h"
50RCSID("$OpenBSD: scp.c,v 1.35 2000/08/19 02:50:07 deraadt Exp $"); 50RCSID("$OpenBSD: scp.c,v 1.36 2000/08/24 21:46:59 deraadt Exp $");
51 51
52#include "ssh.h" 52#include "ssh.h"
53#include "xmalloc.h" 53#include "xmalloc.h"
@@ -680,7 +680,8 @@ sink(argc, argv)
680 BUF *bp; 680 BUF *bp;
681 off_t i, j; 681 off_t i, j;
682 int amt, count, exists, first, mask, mode, ofd, omode; 682 int amt, count, exists, first, mask, mode, ofd, omode;
683 int setimes, size, targisdir, wrerrno = 0; 683 off_t size;
684 int setimes, targisdir, wrerrno = 0;
684 char ch, *cp, *np, *targ, *why, *vect[1], buf[2048]; 685 char ch, *cp, *np, *targ, *why, *vect[1], buf[2048];
685 struct utimbuf ut; 686 struct utimbuf ut;
686 int dummy_usec; 687 int dummy_usec;
diff --git a/session.c b/session.c
index 82096c3ab..4a77eef6b 100644
--- a/session.c
+++ b/session.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#include "includes.h" 10#include "includes.h"
11RCSID("$OpenBSD: session.c,v 1.29 2000/08/21 16:23:31 millert Exp $"); 11RCSID("$OpenBSD: session.c,v 1.31 2000/08/28 03:50:54 deraadt Exp $");
12 12
13#include "xmalloc.h" 13#include "xmalloc.h"
14#include "ssh.h" 14#include "ssh.h"
@@ -1014,7 +1014,7 @@ do_child(const char *command, struct passwd * pw, const char *term,
1014#endif /* HAVE_OSF_SIA */ 1014#endif /* HAVE_OSF_SIA */
1015 1015
1016 if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) 1016 if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid)
1017 fatal("Failed to set uids to %d.", (int) pw->pw_uid); 1017 fatal("Failed to set uids to %u.", (u_int) pw->pw_uid);
1018 } 1018 }
1019 /* 1019 /*
1020 * Get the shell from the password data. An empty shell field is 1020 * Get the shell from the password data. An empty shell field is
@@ -1229,7 +1229,7 @@ do_child(const char *command, struct passwd * pw, const char *term,
1229 if (screen != NULL) 1229 if (screen != NULL)
1230 fprintf(stderr, 1230 fprintf(stderr,
1231 "Adding %.*s/unix%s %s %s\n", 1231 "Adding %.*s/unix%s %s %s\n",
1232 screen-display, display, 1232 (int)(screen-display), display,
1233 screen, auth_proto, auth_data); 1233 screen, auth_proto, auth_data);
1234 } 1234 }
1235 snprintf(cmd, sizeof cmd, "%s -q -", 1235 snprintf(cmd, sizeof cmd, "%s -q -",
@@ -1240,7 +1240,7 @@ do_child(const char *command, struct passwd * pw, const char *term,
1240 auth_proto, auth_data); 1240 auth_proto, auth_data);
1241 if (screen != NULL) 1241 if (screen != NULL)
1242 fprintf(f, "add %.*s/unix%s %s %s\n", 1242 fprintf(f, "add %.*s/unix%s %s %s\n",
1243 screen-display, display, 1243 (int)(screen-display), display,
1244 screen, auth_proto, auth_data); 1244 screen, auth_proto, auth_data);
1245 pclose(f); 1245 pclose(f);
1246 } else { 1246 } else {
diff --git a/ssh-add.1 b/ssh-add.1
index d2d0c205a..8e9d33bfe 100644
--- a/ssh-add.1
+++ b/ssh-add.1
@@ -9,7 +9,7 @@
9.\" 9.\"
10.\" Created: Sat Apr 22 23:55:14 1995 ylo 10.\" Created: Sat Apr 22 23:55:14 1995 ylo
11.\" 11.\"
12.\" $Id: ssh-add.1,v 1.14 2000/08/23 00:46:24 djm Exp $ 12.\" $Id: ssh-add.1,v 1.15 2000/08/29 00:33:51 djm Exp $
13.\" 13.\"
14.Dd September 25, 1999 14.Dd September 25, 1999
15.Dt SSH-ADD 1 15.Dt SSH-ADD 1
diff --git a/ssh-add.c b/ssh-add.c
index a51f477a5..e24a94d71 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: ssh-add.c,v 1.19 2000/08/19 21:34:43 markus Exp $"); 13RCSID("$OpenBSD: ssh-add.c,v 1.20 2000/08/28 03:50:54 deraadt Exp $");
14 14
15#include <openssl/evp.h> 15#include <openssl/evp.h>
16#include <openssl/rsa.h> 16#include <openssl/rsa.h>
@@ -260,7 +260,8 @@ main(int argc, char **argv)
260 if (no_files) { 260 if (no_files) {
261 pw = getpwuid(getuid()); 261 pw = getpwuid(getuid());
262 if (!pw) { 262 if (!pw) {
263 fprintf(stderr, "No user found with uid %d\n", (int) getuid()); 263 fprintf(stderr, "No user found with uid %u\n",
264 (u_int)getuid());
264 ssh_close_authentication_connection(ac); 265 ssh_close_authentication_connection(ac);
265 exit(1); 266 exit(1);
266 } 267 }
diff --git a/ssh-agent.1 b/ssh-agent.1
index 0aa1ecf49..3de67ebf7 100644
--- a/ssh-agent.1
+++ b/ssh-agent.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-agent.1,v 1.14 2000/08/19 21:34:43 markus Exp $ 1.\" $OpenBSD: ssh-agent.1,v 1.15 2000/08/25 16:16:15 deraadt Exp $
2.\" 2.\"
3.\" -*- nroff -*- 3.\" -*- nroff -*-
4.\" 4.\"
diff --git a/ssh.1 b/ssh.1
index 39368e0ce..67dc3df77 100644
--- a/ssh.1
+++ b/ssh.1
@@ -9,7 +9,7 @@
9.\" 9.\"
10.\" Created: Sat Apr 22 21:55:14 1995 ylo 10.\" Created: Sat Apr 22 21:55:14 1995 ylo
11.\" 11.\"
12.\" $Id: ssh.1,v 1.29 2000/08/18 03:59:06 djm Exp $ 12.\" $Id: ssh.1,v 1.30 2000/08/29 00:33:51 djm Exp $
13.\" 13.\"
14.Dd September 25, 1999 14.Dd September 25, 1999
15.Dt SSH 1 15.Dt SSH 1
diff --git a/ssh.c b/ssh.c
index 39512c5f1..71d8f96fe 100644
--- a/ssh.c
+++ b/ssh.c
@@ -11,7 +11,7 @@
11 */ 11 */
12 12
13#include "includes.h" 13#include "includes.h"
14RCSID("$OpenBSD: ssh.c,v 1.61 2000/08/20 18:42:40 millert Exp $"); 14RCSID("$OpenBSD: ssh.c,v 1.63 2000/08/28 20:19:52 markus Exp $");
15 15
16#include <openssl/evp.h> 16#include <openssl/evp.h>
17#include <openssl/dsa.h> 17#include <openssl/dsa.h>
@@ -461,7 +461,7 @@ main(int ac, char **av)
461 } 461 }
462 462
463 /* Cannot fork to background if no command. */ 463 /* Cannot fork to background if no command. */
464 if (fork_after_authentication_flag && buffer_len(&command) == 0) 464 if (fork_after_authentication_flag && buffer_len(&command) == 0 && !no_shell_flag)
465 fatal("Cannot fork into background without a command to execute."); 465 fatal("Cannot fork into background without a command to execute.");
466 466
467 /* Allocate a tty by default if no command specified. */ 467 /* Allocate a tty by default if no command specified. */
@@ -959,21 +959,25 @@ ssh_session2(void)
959 int window, packetmax, id; 959 int window, packetmax, id;
960 int in, out, err; 960 int in, out, err;
961 961
962 /* If requested, let ssh continue in the background. */ 962 if (stdin_null_flag) {
963 if (fork_after_authentication_flag) 963 in = open("/dev/null", O_RDONLY);
964 if (daemon(1, 1) < 0) 964 } else {
965 fatal("daemon() failed: %.200s", strerror(errno)); 965 in = dup(STDIN_FILENO);
966 966 }
967 in = dup(STDIN_FILENO);
968 out = dup(STDOUT_FILENO); 967 out = dup(STDOUT_FILENO);
969 err = dup(STDERR_FILENO); 968 err = dup(STDERR_FILENO);
970 969
971 if (in < 0 || out < 0 || err < 0) 970 if (in < 0 || out < 0 || err < 0)
972 fatal("dump in/out/err failed"); 971 fatal("dup() in/out/err failed");
973 972
974 /* should be pre-session */ 973 /* should be pre-session */
975 init_local_fwd(); 974 init_local_fwd();
976 975
976 /* If requested, let ssh continue in the background. */
977 if (fork_after_authentication_flag)
978 if (daemon(1, 1) < 0)
979 fatal("daemon() failed: %.200s", strerror(errno));
980
977 window = 32*1024; 981 window = 32*1024;
978 if (tty_flag) { 982 if (tty_flag) {
979 packetmax = window/8; 983 packetmax = window/8;
diff --git a/sshconnect.c b/sshconnect.c
index 79b6856da..21eff6c6b 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#include "includes.h" 10#include "includes.h"
11RCSID("$OpenBSD: sshconnect.c,v 1.76 2000/06/17 20:30:10 markus Exp $"); 11RCSID("$OpenBSD: sshconnect.c,v 1.77 2000/08/28 03:50:54 deraadt Exp $");
12 12
13#include <openssl/bn.h> 13#include <openssl/bn.h>
14#include <openssl/dsa.h> 14#include <openssl/dsa.h>
@@ -193,8 +193,8 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
193 int gaierr; 193 int gaierr;
194 struct linger linger; 194 struct linger linger;
195 195
196 debug("ssh_connect: getuid %d geteuid %d anon %d", 196 debug("ssh_connect: getuid %u geteuid %u anon %d",
197 (int) getuid(), (int) geteuid(), anonymous); 197 (u_int) getuid(), (u_int) geteuid(), anonymous);
198 198
199 /* Get default port if port has not been set. */ 199 /* Get default port if port has not been set. */
200 if (port == 0) { 200 if (port == 0) {
@@ -669,7 +669,7 @@ ssh_login(int host_key_valid, RSA *own_host_key, const char *orighost,
669 /* Get local user name. Use it as server user if no user name was given. */ 669 /* Get local user name. Use it as server user if no user name was given. */
670 pw = getpwuid(original_real_uid); 670 pw = getpwuid(original_real_uid);
671 if (!pw) 671 if (!pw)
672 fatal("User id %d not found from user database.", original_real_uid); 672 fatal("User id %u not found from user database.", original_real_uid);
673 local_user = xstrdup(pw->pw_name); 673 local_user = xstrdup(pw->pw_name);
674 server_user = options.user ? options.user : local_user; 674 server_user = options.user ? options.user : local_user;
675 675
diff --git a/sshd.8 b/sshd.8
index c8b99df38..d710baad5 100644
--- a/sshd.8
+++ b/sshd.8
@@ -9,7 +9,7 @@
9.\" 9.\"
10.\" Created: Sat Apr 22 21:55:14 1995 ylo 10.\" Created: Sat Apr 22 21:55:14 1995 ylo
11.\" 11.\"
12.\" $Id: sshd.8,v 1.26 2000/08/18 03:59:06 djm Exp $ 12.\" $Id: sshd.8,v 1.27 2000/08/29 00:33:51 djm Exp $
13.\" 13.\"
14.Dd September 25, 1999 14.Dd September 25, 1999
15.Dt SSHD 8 15.Dt SSHD 8
diff --git a/uidswap.c b/uidswap.c
index 7745a976e..96ff931e1 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#include "includes.h" 9#include "includes.h"
10RCSID("$OpenBSD: uidswap.c,v 1.7 2000/06/20 01:39:45 markus Exp $"); 10RCSID("$OpenBSD: uidswap.c,v 1.8 2000/08/28 03:50:54 deraadt Exp $");
11 11
12#include "ssh.h" 12#include "ssh.h"
13#include "uidswap.h" 13#include "uidswap.h"
@@ -47,15 +47,15 @@ temporarily_use_uid(uid_t uid)
47 47
48 /* Set the effective uid to the given (unprivileged) uid. */ 48 /* Set the effective uid to the given (unprivileged) uid. */
49 if (seteuid(uid) == -1) 49 if (seteuid(uid) == -1)
50 debug("seteuid %d: %.100s", (int) uid, strerror(errno)); 50 debug("seteuid %u: %.100s", (u_int) uid, strerror(errno));
51#else /* SAVED_IDS_WORK_WITH_SETUID */ 51#else /* SAVED_IDS_WORK_WITH_SETUID */
52 /* Propagate the privileged uid to all of our uids. */ 52 /* Propagate the privileged uid to all of our uids. */
53 if (setuid(geteuid()) < 0) 53 if (setuid(geteuid()) < 0)
54 debug("setuid %d: %.100s", (int) geteuid(), strerror(errno)); 54 debug("setuid %u: %.100s", (u_int) geteuid(), strerror(errno));
55 55
56 /* Set the effective uid to the given (unprivileged) uid. */ 56 /* Set the effective uid to the given (unprivileged) uid. */
57 if (seteuid(uid) == -1) 57 if (seteuid(uid) == -1)
58 debug("seteuid %d: %.100s", (int) uid, strerror(errno)); 58 debug("seteuid %u: %.100s", (u_int) uid, strerror(errno));
59#endif /* SAVED_IDS_WORK_WITH_SETEUID */ 59#endif /* SAVED_IDS_WORK_WITH_SETEUID */
60} 60}
61 61
@@ -68,7 +68,7 @@ restore_uid()
68#ifdef SAVED_IDS_WORK_WITH_SETEUID 68#ifdef SAVED_IDS_WORK_WITH_SETEUID
69 /* Set the effective uid back to the saved uid. */ 69 /* Set the effective uid back to the saved uid. */
70 if (seteuid(saved_euid) < 0) 70 if (seteuid(saved_euid) < 0)
71 debug("seteuid %d: %.100s", (int) saved_euid, strerror(errno)); 71 debug("seteuid %u: %.100s", (u_int) saved_euid, strerror(errno));
72#else /* SAVED_IDS_WORK_WITH_SETEUID */ 72#else /* SAVED_IDS_WORK_WITH_SETEUID */
73 /* 73 /*
74 * We are unable to restore the real uid to its unprivileged value. 74 * We are unable to restore the real uid to its unprivileged value.
@@ -95,5 +95,5 @@ permanently_set_uid(uid_t uid)
95#endif /* WITH_IRIX_AUDIT */ 95#endif /* WITH_IRIX_AUDIT */
96 96
97 if (setuid(uid) < 0) 97 if (setuid(uid) < 0)
98 debug("setuid %d: %.100s", (int) uid, strerror(errno)); 98 debug("setuid %u: %.100s", (u_int) uid, strerror(errno));
99} 99}
diff --git a/util.c b/util.c
index 3b221924e..16c8c5072 100644
--- a/util.c
+++ b/util.c
@@ -1,5 +1,5 @@
1#include "includes.h" 1#include "includes.h"
2RCSID("$OpenBSD: util.c,v 1.1 2000/08/01 19:01:42 provos Exp $"); 2RCSID("$OpenBSD: util.c,v 1.4 2000/08/28 20:23:37 markus Exp $");
3 3
4#include "ssh.h" 4#include "ssh.h"
5 5
@@ -37,7 +37,9 @@ set_nonblock(int fd)
37 debug("fd %d setting O_NONBLOCK", fd); 37 debug("fd %d setting O_NONBLOCK", fd);
38 val |= O_NONBLOCK; 38 val |= O_NONBLOCK;
39 if (fcntl(fd, F_SETFL, val) == -1) 39 if (fcntl(fd, F_SETFL, val) == -1)
40 error("fcntl(%d, F_SETFL, O_NONBLOCK): %s", fd, strerror(errno)); 40 if (errno != ENODEV)
41 error("fcntl(%d, F_SETFL, O_NONBLOCK): %s",
42 fd, strerror(errno));
41} 43}
42 44
43/* Characters considered whitespace in strsep calls. */ 45/* Characters considered whitespace in strsep calls. */