summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2001-08-14 20:54:52 +0000
committerKevin Steves <stevesk@pobox.com>2001-08-14 20:54:52 +0000
commit72992afb264bb7601e98e34f02fc524145081fe7 (patch)
tree9799906859c3ad7092e20ba08f57525f6e52afb3
parent25ee4e48f79681ce76122d2b4ddda46efcd37ca0 (diff)
- (stevesk) bsd-cray.c: utmp strings are not C strings
-rw-r--r--ChangeLog3
-rw-r--r--openbsd-compat/bsd-cray.c7
2 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7e5a776fd..76f167feb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
3 for some #ifdef _CRAY code; ok wendyp@cray.com 3 for some #ifdef _CRAY code; ok wendyp@cray.com
4 - (stevesk) sshpty.c: return 0 on error in cray pty code; 4 - (stevesk) sshpty.c: return 0 on error in cray pty code;
5 ok wendyp@cray.com 5 ok wendyp@cray.com
6 - (stevesk) bsd-cray.c: utmp strings are not C strings
6 7
720010812 820010812
8 - (djm) Fix detection of long long int support. Based on patch from 9 - (djm) Fix detection of long long int support. Based on patch from
@@ -6284,4 +6285,4 @@
6284 - Wrote replacements for strlcpy and mkdtemp 6285 - Wrote replacements for strlcpy and mkdtemp
6285 - Released 1.0pre1 6286 - Released 1.0pre1
6286 6287
6287$Id: ChangeLog,v 1.1472 2001/08/14 20:41:34 stevesk Exp $ 6288$Id: ChangeLog,v 1.1473 2001/08/14 20:54:52 stevesk Exp $
diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c
index 3cef7d15d..a03344f72 100644
--- a/openbsd-compat/bsd-cray.c
+++ b/openbsd-compat/bsd-cray.c
@@ -164,9 +164,10 @@ cray_retain_utmp(struct utmp *ut, int pid)
164 while (read(fd, (char *)&utmp, sizeof(utmp)) == sizeof(utmp)) { 164 while (read(fd, (char *)&utmp, sizeof(utmp)) == sizeof(utmp)) {
165 if (pid == utmp.ut_pid) { 165 if (pid == utmp.ut_pid) {
166 ut->ut_jid = utmp.ut_jid; 166 ut->ut_jid = utmp.ut_jid;
167 strncpy(ut->ut_tpath, utmp.ut_tpath, TPATHSIZ); 167 /* XXX: MIN_SIZEOF here? can this go in loginrec? */
168 strncpy(ut->ut_host, utmp.ut_host, strlen(utmp.ut_host)); 168 strncpy(ut->ut_tpath, utmp.ut_tpath, sizeof(utmp.ut_tpath));
169 strncpy(ut->ut_name, utmp.ut_name, strlen(utmp.ut_name)); 169 strncpy(ut->ut_host, utmp.ut_host, sizeof(utmp.ut_host));
170 strncpy(ut->ut_name, utmp.ut_name, sizeof(utmp.ut_name));
170 break; 171 break;
171 } 172 }
172 } 173 }