diff options
| author | itojun <itojun@NetBSD.org> | 2000-07-05 22:15:04 +0000 |
|---|---|---|
| committer | itojun <itojun@NetBSD.org> | 2000-07-05 22:15:04 +0000 |
| commit | d7dc7d22d134c2a3341238ab305de9fc3a32069b (patch) | |
| tree | e11f71101139146baac6d6681338bc63f8dc257a /libexec | |
| parent | c466b99a9a3d0dbcf5585f13819beacbc44f32d6 (diff) | |
setproctitle(), and for any other printf variants, it is not a good idea
to pass variable directly like foo(x). use foo("%s", x) to avoid misuse.
from: openbsd
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/ftpd/ftpd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 6278cfdee0d..11ba1de523f 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1,4 +1,4 @@ -/* $NetBSD: ftpd.c,v 1.96 2000/06/20 07:39:46 lukem Exp $ */ +/* $NetBSD: ftpd.c,v 1.97 2000/07/05 22:15:04 itojun Exp $ */ /* * Copyright (c) 1997-2000 The NetBSD Foundation, Inc. @@ -109,7 +109,7 @@ __COPYRIGHT( #if 0 static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: ftpd.c,v 1.96 2000/06/20 07:39:46 lukem Exp $"); +__RCSID("$NetBSD: ftpd.c,v 1.97 2000/07/05 22:15:04 itojun Exp $"); #endif #endif /* not lint */ @@ -963,7 +963,7 @@ pass(const char *passwd) "%s: anonymous/%.*s", remotehost, (int) (sizeof(proctitle) - sizeof(remotehost) - sizeof(": anonymous/")), passwd); - setproctitle(proctitle); + setproctitle("%s", proctitle); #endif /* HASSETPROCTITLE */ if (logging) syslog(LOG_INFO, @@ -975,7 +975,7 @@ pass(const char *passwd) #ifdef HASSETPROCTITLE snprintf(proctitle, sizeof(proctitle), "%s: %s", remotehost, pw->pw_name); - setproctitle(proctitle); + setproctitle("%s", proctitle); #endif /* HASSETPROCTITLE */ if (logging) syslog(LOG_INFO, @@ -1904,7 +1904,7 @@ dolog(struct sockaddr *who) getnameinfo(who, who->sa_len, remotehost, sizeof(remotehost), NULL,0,0); #ifdef HASSETPROCTITLE snprintf(proctitle, sizeof(proctitle), "%s: connected", remotehost); - setproctitle(proctitle); + setproctitle("%s", proctitle); #endif /* HASSETPROCTITLE */ if (logging) syslog(LOG_INFO, "connection from %s to %s", |
