From b3e7de4b6ec13305a1c3bd87a6827f064886a5f0 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Thu, 20 Jul 2000 05:43:55 +0000 Subject: [PATCH] merge in syslog fixes, do not call syslog with variabel as format string --- crypto/kerberosIV/appl/kauth/kauthd.c | 12 +++++++----- crypto/kerberosIV/appl/kip/kipd.c | 4 +++- crypto/kerberosIV/appl/sample/sample_server.c | 6 ++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/crypto/kerberosIV/appl/kauth/kauthd.c b/crypto/kerberosIV/appl/kauth/kauthd.c index 8dae4d0a45c5..d0b61ec8137c 100644 --- a/crypto/kerberosIV/appl/kauth/kauthd.c +++ b/crypto/kerberosIV/appl/kauth/kauthd.c @@ -1,3 +1,5 @@ +/* $FreeBSD$ */ + /* * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -33,7 +35,7 @@ #include "kauth.h" -RCSID("$Id: kauthd.c,v 1.25 1999/12/02 16:58:31 joda Exp $"); +RCSID("$Id: kauthd.c,v 1.25.2.1 2000/06/28 19:07:58 assar Exp $"); krb_principal princ; static char locuser[SNAME_SZ]; @@ -128,7 +130,7 @@ doit(int sock) if( kuserok(&auth, locuser) != 0) { snprintf(buf, sizeof(buf), "%s cannot get tickets for %s", locuser, krb_unparse_name(&princ)); - syslog (LOG_ERR, buf); + syslog (LOG_ERR, "%s", buf); write_encrypted (sock, buf, strlen(buf), schedule, &auth.session, &thisaddr, &thataddr); return 1; @@ -136,7 +138,7 @@ doit(int sock) passwd = k_getpwnam (locuser); if (passwd == NULL) { snprintf (buf, sizeof(buf), "No user '%s'", locuser); - syslog (LOG_ERR, buf); + syslog (LOG_ERR, "%s", buf); write_encrypted (sock, buf, strlen(buf), schedule, &auth.session, &thisaddr, &thataddr); return 1; @@ -145,7 +147,7 @@ doit(int sock) initgroups(passwd->pw_name, passwd->pw_gid) || setuid(passwd->pw_uid)) { snprintf (buf, sizeof(buf), "Could not change user"); - syslog (LOG_ERR, buf); + syslog (LOG_ERR, "%s", buf); write_encrypted (sock, buf, strlen(buf), schedule, &auth.session, &thisaddr, &thataddr); return 1; @@ -182,7 +184,7 @@ doit(int sock) return 0; } else { snprintf (buf, sizeof(buf), "TGT failed: %s", krb_get_err_text(status)); - syslog (LOG_NOTICE, buf); + syslog (LOG_NOTICE, "%s", buf); write_encrypted (sock, buf, strlen(buf), schedule, &auth.session, &thisaddr, &thataddr); return 1; diff --git a/crypto/kerberosIV/appl/kip/kipd.c b/crypto/kerberosIV/appl/kip/kipd.c index 429f815e6a1d..f0e74c9bbd82 100644 --- a/crypto/kerberosIV/appl/kip/kipd.c +++ b/crypto/kerberosIV/appl/kip/kipd.c @@ -1,3 +1,5 @@ +/* $FreeBSD$ */ + /* * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -42,7 +44,7 @@ fatal (int fd, char *s) write (fd, &err, sizeof(err)); write (fd, s, strlen(s)+1); - syslog(LOG_ERR, s); + syslog(LOG_ERR, "%s", s); return err; } diff --git a/crypto/kerberosIV/appl/sample/sample_server.c b/crypto/kerberosIV/appl/sample/sample_server.c index 5442562f3aa3..65b61ae0485e 100644 --- a/crypto/kerberosIV/appl/sample/sample_server.c +++ b/crypto/kerberosIV/appl/sample/sample_server.c @@ -1,3 +1,5 @@ +/* $FreeBSD$ */ + /* * * Copyright 1987, 1988 by the Massachusetts Institute of Technology. @@ -18,7 +20,7 @@ #include "sample.h" -RCSID("$Id: sample_server.c,v 1.14 1999/11/13 06:28:49 assar Exp $"); +RCSID("$Id: sample_server.c,v 1.14.2.1 2000/06/28 19:08:00 assar Exp $"); static void usage (void) @@ -108,7 +110,7 @@ main(int argc, char **argv) snprintf(retbuf, sizeof(retbuf), "Kerberos error: %s\n", krb_get_err_text(status)); - syslog(LOG_ERR, retbuf); + syslog(LOG_ERR, "%s", retbuf); } else { /* Check the version string (KRB_SENDAUTH_VLEN chars) */ if (strncmp(version, SAMPLE_VERSION, KRB_SENDAUTH_VLEN)) {