mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 08:22:44 +00:00
merge in syslog fixes, do not call syslog with variabel as format string
This commit is contained in:
parent
a603fe5a07
commit
b3e7de4b6e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63606
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user