summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Peel <jsyn@cvs.openbsd.org>2002-06-12 02:30:54 +0000
committerJason Peel <jsyn@cvs.openbsd.org>2002-06-12 02:30:54 +0000
commitb55799ee38c950a7a40203976384cc0c9cabf979 (patch)
treed6623730e92ec6f654bbe0ce7a9bdaefe95b2747
parent8ea7b8118145c44ffe95c90bc6756a7b143edb94 (diff)
err(3) newline cleanup, krb pieces; ok hin@
-rw-r--r--kerberosIV/src/admin/ext_srvtab.c2
-rw-r--r--kerberosIV/src/admin/kstash.c2
-rw-r--r--kerberosIV/src/appl/bsd/kcmd.c16
-rw-r--r--kerberosIV/src/appl/bsd/login.c4
-rw-r--r--kerberosIV/src/appl/kauth/kauth.c6
-rw-r--r--kerberosIV/src/appl/otp/otp.c2
-rw-r--r--kerberosV/src/appl/otp/otp.c2
7 files changed, 21 insertions, 13 deletions
diff --git a/kerberosIV/src/admin/ext_srvtab.c b/kerberosIV/src/admin/ext_srvtab.c
index 54bd9520f3a..f2e412fdfab 100644
--- a/kerberosIV/src/admin/ext_srvtab.c
+++ b/kerberosIV/src/admin/ext_srvtab.c
@@ -39,7 +39,7 @@ FWrite(void *p, int size, int n, FILE *f)
{
if (fwrite(p, size, n, f) != n) {
StampOutSecrets();
- errx(1, "Error writing output file. Terminating.\n");
+ errx(1, "Error writing output file. Terminating.");
}
}
diff --git a/kerberosIV/src/admin/kstash.c b/kerberosIV/src/admin/kstash.c
index 6bd1ebe8dea..3109fdca1e5 100644
--- a/kerberosIV/src/admin/kstash.c
+++ b/kerberosIV/src/admin/kstash.c
@@ -31,7 +31,7 @@ main(int argc, char **argv)
int ret = 0;
if ((n = kerb_init()))
- errx(1, "Kerberos db and cache init failed = %ld\n", n);
+ errx(1, "Kerberos db and cache init failed = %ld", n);
if (kdb_get_master_key (KDB_GET_PROMPT, &master_key,
master_key_schedule) != 0) {
diff --git a/kerberosIV/src/appl/bsd/kcmd.c b/kerberosIV/src/appl/bsd/kcmd.c
index 48bbc12ff3a..dd6859b4eee 100644
--- a/kerberosIV/src/appl/bsd/kcmd.c
+++ b/kerberosIV/src/appl/bsd/kcmd.c
@@ -33,7 +33,7 @@
#include "bsd_locl.h"
-RCSID("$KTH: kcmd.c,v 1.20 1998/07/13 13:54:07 assar Exp $");
+RCSID("$KTH: kcmd.c,v 1.23 2001/09/17 04:57:22 assar Exp $");
#define START_PORT 5120 /* arbitrary */
@@ -123,7 +123,7 @@ kcmd(int *sock,
s = getport(&lport);
if (s < 0) {
if (errno == EAGAIN)
- warnx("kcmd(socket): All ports in use\n");
+ warnx("kcmd(socket): All ports in use");
else
warn("kcmd: socket");
return (-1);
@@ -168,7 +168,7 @@ kcmd(int *sock,
} else {
char num[8];
int s2 = getport(&lport), s3;
- int len = sizeof(from);
+ socklen_t len = sizeof(from);
if (s2 < 0) {
status = -1;
@@ -185,6 +185,14 @@ kcmd(int *sock,
{
fd_set fds;
FD_ZERO(&fds);
+ if (s >= FD_SETSIZE || s2 >= FD_SETSIZE) {
+ warnx("file descriptor too large");
+ close(s);
+ close(s2);
+ status = -1;
+ goto bad;
+ }
+
FD_SET(s, &fds);
FD_SET(s2, &fds);
status = select(FD_SETSIZE, &fds, NULL, NULL, NULL);
@@ -223,7 +231,7 @@ kcmd(int *sock,
/* set up the needed stuff for mutual auth, but only if necessary */
if (authopts & KOPT_DO_MUTUAL) {
- int sin_len;
+ socklen_t sin_len;
*faddr = sin;
sin_len = sizeof(struct sockaddr_in);
diff --git a/kerberosIV/src/appl/bsd/login.c b/kerberosIV/src/appl/bsd/login.c
index caf37726731..3228ddca7d7 100644
--- a/kerberosIV/src/appl/bsd/login.c
+++ b/kerberosIV/src/appl/bsd/login.c
@@ -265,7 +265,7 @@ main(int argc, char **argv)
break;
case 'r':
if (rflag || hflag) {
- warnx("Only one of -r and -h allowed\n");
+ warnx("Only one of -r and -h allowed");
exit(1);
}
if (getuid()) {
@@ -844,7 +844,7 @@ main(int argc, char **argv)
execlp(pwd->pw_shell, tbuf, (char *)NULL);
if (getuid() == 0) {
- warnx("Can't exec %s, trying %s\n",
+ warnx("Can't exec %s, trying %s",
pwd->pw_shell, _PATH_BSHELL);
execlp(_PATH_BSHELL, tbuf, (char *)NULL);
err(1, "%s", _PATH_BSHELL);
diff --git a/kerberosIV/src/appl/kauth/kauth.c b/kerberosIV/src/appl/kauth/kauth.c
index e4a949560f3..84fa2c7b31e 100644
--- a/kerberosIV/src/appl/kauth/kauth.c
+++ b/kerberosIV/src/appl/kauth/kauth.c
@@ -157,12 +157,12 @@ get_ticket_address(krb_principal *princ, des_cblock *key)
code = get_ad_tkt(princ->name, princ->instance, princ->realm, 0);
if(code) {
- warnx("get_ad_tkt: %s\n", krb_get_err_text(code));
+ warnx("get_ad_tkt: %s", krb_get_err_text(code));
return code;
}
code = krb_get_cred(princ->name, princ->instance, princ->realm, &c);
if(code) {
- warnx("krb_get_cred: %s\n", krb_get_err_text(code));
+ warnx("krb_get_cred: %s", krb_get_err_text(code));
return code;
}
@@ -181,7 +181,7 @@ get_ticket_address(krb_principal *princ, des_cblock *key)
key,
schedule);
if(code) {
- warnx("decomp_ticket: %s\n", krb_get_err_text(code));
+ warnx("decomp_ticket: %s", krb_get_err_text(code));
return code;
}
memset(&session, 0, sizeof(session));
diff --git a/kerberosIV/src/appl/otp/otp.c b/kerberosIV/src/appl/otp/otp.c
index 523d485a5a1..f1748017ea2 100644
--- a/kerberosIV/src/appl/otp/otp.c
+++ b/kerberosIV/src/appl/otp/otp.c
@@ -322,7 +322,7 @@ main (int argc, char **argv)
if(deletep || openp || listp) {
if(argc != 0)
- errx(1, "delete, open, and list requires no arguments\n");
+ errx(1, "delete, open, and list requires no arguments");
} else {
if(argc != 2)
errx(1, "setup, and renew requires `num', and `seed'");
diff --git a/kerberosV/src/appl/otp/otp.c b/kerberosV/src/appl/otp/otp.c
index 523d485a5a1..f1748017ea2 100644
--- a/kerberosV/src/appl/otp/otp.c
+++ b/kerberosV/src/appl/otp/otp.c
@@ -322,7 +322,7 @@ main (int argc, char **argv)
if(deletep || openp || listp) {
if(argc != 0)
- errx(1, "delete, open, and list requires no arguments\n");
+ errx(1, "delete, open, and list requires no arguments");
} else {
if(argc != 2)
errx(1, "setup, and renew requires `num', and `seed'");