diff options
author | Colin Watson <cjwatson@debian.org> | 2016-12-20 00:22:52 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-12-20 00:22:52 +0000 |
commit | 971a7653746a6972b907dfe0ce139c06e4a6f482 (patch) | |
tree | 70fb964265d57ae4967be55b75dbb2a122e9b969 /openbsd-compat/setproctitle.c | |
parent | a8ed8d256b2e2c05b0c15565a7938028c5192277 (diff) | |
parent | 4a354fc231174901f2629437c2a6e924a2dd6772 (diff) |
Import openssh_7.4p1.orig.tar.gz
Diffstat (limited to 'openbsd-compat/setproctitle.c')
-rw-r--r-- | openbsd-compat/setproctitle.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/openbsd-compat/setproctitle.c b/openbsd-compat/setproctitle.c index 9f7ca14c2..2b15c6e00 100644 --- a/openbsd-compat/setproctitle.c +++ b/openbsd-compat/setproctitle.c | |||
@@ -76,7 +76,7 @@ compat_init_setproctitle(int argc, char *argv[]) | |||
76 | 76 | ||
77 | /* | 77 | /* |
78 | * NB: This assumes that argv has already been copied out of the | 78 | * NB: This assumes that argv has already been copied out of the |
79 | * way. This is true for sshd, but may not be true for other | 79 | * way. This is true for sshd, but may not be true for other |
80 | * programs. Beware. | 80 | * programs. Beware. |
81 | */ | 81 | */ |
82 | 82 | ||
@@ -92,7 +92,7 @@ compat_init_setproctitle(int argc, char *argv[]) | |||
92 | } | 92 | } |
93 | 93 | ||
94 | /* | 94 | /* |
95 | * Find the last argv string or environment variable within | 95 | * Find the last argv string or environment variable within |
96 | * our process memory area. | 96 | * our process memory area. |
97 | */ | 97 | */ |
98 | for (i = 0; i < argc; i++) { | 98 | for (i = 0; i < argc; i++) { |
@@ -108,8 +108,8 @@ compat_init_setproctitle(int argc, char *argv[]) | |||
108 | argv_start = argv[0]; | 108 | argv_start = argv[0]; |
109 | argv_env_len = lastargv - argv[0] - 1; | 109 | argv_env_len = lastargv - argv[0] - 1; |
110 | 110 | ||
111 | /* | 111 | /* |
112 | * Copy environment | 112 | * Copy environment |
113 | * XXX - will truncate env on strdup fail | 113 | * XXX - will truncate env on strdup fail |
114 | */ | 114 | */ |
115 | for (i = 0; envp[i] != NULL; i++) | 115 | for (i = 0; envp[i] != NULL; i++) |
@@ -156,7 +156,7 @@ setproctitle(const char *fmt, ...) | |||
156 | pst.pst_command = ptitle; | 156 | pst.pst_command = ptitle; |
157 | pstat(PSTAT_SETCMD, pst, strlen(ptitle), 0, 0); | 157 | pstat(PSTAT_SETCMD, pst, strlen(ptitle), 0, 0); |
158 | #elif SPT_TYPE == SPT_REUSEARGV | 158 | #elif SPT_TYPE == SPT_REUSEARGV |
159 | /* debug("setproctitle: copy \"%s\" into len %d", | 159 | /* debug("setproctitle: copy \"%s\" into len %d", |
160 | buf, argv_env_len); */ | 160 | buf, argv_env_len); */ |
161 | len = strlcpy(argv_start, ptitle, argv_env_len); | 161 | len = strlcpy(argv_start, ptitle, argv_env_len); |
162 | for(; len < argv_env_len; len++) | 162 | for(; len < argv_env_len; len++) |