diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-08-28 03:50:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-08-28 03:50:55 +0000 |
commit | 73f6f1368316c6c85c8a506f8db5bc26ba8446dc (patch) | |
tree | c75e63187433d1e083c6a8cb9d0ef9398c14d558 /usr.bin | |
parent | 46e0cd1637097cd7834953183d8b27235607402a (diff) |
print uid/gid as unsigned
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/auth-krb4.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/session.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/ssh-add.c | 5 | ||||
-rw-r--r-- | usr.bin/ssh/sshconnect.c | 8 | ||||
-rw-r--r-- | usr.bin/ssh/uidswap.c | 12 |
5 files changed, 17 insertions, 16 deletions
diff --git a/usr.bin/ssh/auth-krb4.c b/usr.bin/ssh/auth-krb4.c index ae2b2a3d892..8715dc0d978 100644 --- a/usr.bin/ssh/auth-krb4.c +++ b/usr.bin/ssh/auth-krb4.c @@ -9,7 +9,7 @@ #include "ssh.h" #include "servconf.h" -RCSID("$OpenBSD: auth-krb4.c,v 1.16 2000/08/02 17:27:04 provos Exp $"); +RCSID("$OpenBSD: auth-krb4.c,v 1.17 2000/08/28 03:50:54 deraadt Exp $"); #ifdef KRB4 char *ticket = NULL; @@ -154,7 +154,7 @@ krb4_init(uid_t uid) if (lstat("/ticket", &st) != -1) tkt_root = "/ticket/"; #endif /* AFS */ - snprintf(ticket, MAXPATHLEN, "%s%d_%d", tkt_root, uid, getpid()); + snprintf(ticket, MAXPATHLEN, "%s%u_%d", tkt_root, uid, getpid()); (void) krb_set_tkt_string(ticket); } /* Register ticket cleanup in case of fatal error. */ diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c index 1d821c3b8a3..2c9a50fa741 100644 --- a/usr.bin/ssh/session.c +++ b/usr.bin/ssh/session.c @@ -8,7 +8,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.30 2000/08/25 16:10:05 deraadt Exp $"); +RCSID("$OpenBSD: session.c,v 1.31 2000/08/28 03:50:54 deraadt Exp $"); #include "xmalloc.h" #include "ssh.h" @@ -811,7 +811,7 @@ do_child(const char *command, struct passwd * pw, const char *term, #endif } if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) - fatal("Failed to set uids to %d.", (int) pw->pw_uid); + fatal("Failed to set uids to %u.", (u_int) pw->pw_uid); } /* * Get the shell from the password data. An empty shell field is diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c index ae5ca90d2fd..48053739b66 100644 --- a/usr.bin/ssh/ssh-add.c +++ b/usr.bin/ssh/ssh-add.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.19 2000/08/19 21:34:43 markus Exp $"); +RCSID("$OpenBSD: ssh-add.c,v 1.20 2000/08/28 03:50:54 deraadt Exp $"); #include <openssl/evp.h> #include <openssl/rsa.h> @@ -254,7 +254,8 @@ main(int argc, char **argv) if (no_files) { pw = getpwuid(getuid()); if (!pw) { - fprintf(stderr, "No user found with uid %d\n", (int) getuid()); + fprintf(stderr, "No user found with uid %u\n", + (u_int)getuid()); ssh_close_authentication_connection(ac); exit(1); } diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c index ea4dfde2fa2..f16e4e6f601 100644 --- a/usr.bin/ssh/sshconnect.c +++ b/usr.bin/ssh/sshconnect.c @@ -8,7 +8,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect.c,v 1.76 2000/06/17 20:30:10 markus Exp $"); +RCSID("$OpenBSD: sshconnect.c,v 1.77 2000/08/28 03:50:54 deraadt Exp $"); #include <openssl/bn.h> #include <openssl/dsa.h> @@ -189,8 +189,8 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr, int gaierr; struct linger linger; - debug("ssh_connect: getuid %d geteuid %d anon %d", - (int) getuid(), (int) geteuid(), anonymous); + debug("ssh_connect: getuid %u geteuid %u anon %d", + (u_int) getuid(), (u_int) geteuid(), anonymous); /* Get default port if port has not been set. */ if (port == 0) { @@ -661,7 +661,7 @@ ssh_login(int host_key_valid, RSA *own_host_key, const char *orighost, /* Get local user name. Use it as server user if no user name was given. */ pw = getpwuid(original_real_uid); if (!pw) - fatal("User id %d not found from user database.", original_real_uid); + fatal("User id %u not found from user database.", original_real_uid); local_user = xstrdup(pw->pw_name); server_user = options.user ? options.user : local_user; diff --git a/usr.bin/ssh/uidswap.c b/usr.bin/ssh/uidswap.c index 21ca46d5eff..69527ed0dba 100644 --- a/usr.bin/ssh/uidswap.c +++ b/usr.bin/ssh/uidswap.c @@ -7,7 +7,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: uidswap.c,v 1.7 2000/06/20 01:39:45 markus Exp $"); +RCSID("$OpenBSD: uidswap.c,v 1.8 2000/08/28 03:50:54 deraadt Exp $"); #include "ssh.h" #include "uidswap.h" @@ -43,15 +43,15 @@ temporarily_use_uid(uid_t uid) /* Set the effective uid to the given (unprivileged) uid. */ if (seteuid(uid) == -1) - debug("seteuid %d: %.100s", (int) uid, strerror(errno)); + debug("seteuid %u: %.100s", (u_int) uid, strerror(errno)); #else /* SAVED_IDS_WORK_WITH_SETUID */ /* Propagate the privileged uid to all of our uids. */ if (setuid(geteuid()) < 0) - debug("setuid %d: %.100s", (int) geteuid(), strerror(errno)); + debug("setuid %u: %.100s", (u_int) geteuid(), strerror(errno)); /* Set the effective uid to the given (unprivileged) uid. */ if (seteuid(uid) == -1) - debug("seteuid %d: %.100s", (int) uid, strerror(errno)); + debug("seteuid %u: %.100s", (u_int) uid, strerror(errno)); #endif /* SAVED_IDS_WORK_WITH_SETEUID */ } @@ -64,7 +64,7 @@ restore_uid() #ifdef SAVED_IDS_WORK_WITH_SETEUID /* Set the effective uid back to the saved uid. */ if (seteuid(saved_euid) < 0) - debug("seteuid %d: %.100s", (int) saved_euid, strerror(errno)); + debug("seteuid %u: %.100s", (u_int) saved_euid, strerror(errno)); #else /* SAVED_IDS_WORK_WITH_SETEUID */ /* * We are unable to restore the real uid to its unprivileged value. @@ -83,5 +83,5 @@ void permanently_set_uid(uid_t uid) { if (setuid(uid) < 0) - debug("setuid %d: %.100s", (int) uid, strerror(errno)); + debug("setuid %u: %.100s", (u_int) uid, strerror(errno)); } |