Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ftpd setproctitle(), and for any other printf varian...



details:   https://anonhg.NetBSD.org/src/rev/a78803630778
branches:  trunk
changeset: 494347:a78803630778
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Jul 05 22:15:04 2000 +0000

description:
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:

 libexec/ftpd/ftpd.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 6fcfd2c7cefc -r a78803630778 libexec/ftpd/ftpd.c
--- a/libexec/ftpd/ftpd.c       Wed Jul 05 22:12:23 2000 +0000
+++ b/libexec/ftpd/ftpd.c       Wed Jul 05 22:15:04 2000 +0000
@@ -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 @@
 #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 @@
                    "%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 @@
 #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 @@
        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",



Home | Main Index | Thread Index | Old Index