diff options
author | Darren Tucker <dtucker@zip.com.au> | 2010-01-09 18:18:04 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2010-01-09 18:18:04 +1100 |
commit | 0b8a2262ac9ee2b2395cf85e3dfa065385c25b5a (patch) | |
tree | ba8382d0b0e85f801fd828c1fa466b91b0d25a52 | |
parent | 11b5c07941f206d955184ff1e4c1ff6fba37d157 (diff) |
- (dtucker) [loginrec.c] Use the SUSv3 specified name for the user name
when using utmpx. Patch from Ed Schouten.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | loginrec.c | 8 |
2 files changed, 6 insertions, 4 deletions
@@ -3,6 +3,8 @@ | |||
3 | have it. | 3 | have it. |
4 | - (dtucker) [defines.h] define PRIu64 for platforms that don't have it. | 4 | - (dtucker) [defines.h] define PRIu64 for platforms that don't have it. |
5 | - (dtucker) [roaming_client.c] Wrap inttypes.h in an ifdef. | 5 | - (dtucker) [roaming_client.c] Wrap inttypes.h in an ifdef. |
6 | - (dtucker) [loginrec.c] Use the SUSv3 specified name for the user name | ||
7 | when using utmpx. Patch from Ed Schouten. | ||
6 | 8 | ||
7 | 20091208 | 9 | 20091208 |
8 | - (dtucker) OpenBSD CVS Sync | 10 | - (dtucker) OpenBSD CVS Sync |
diff --git a/loginrec.c b/loginrec.c index f4af06736..bca959707 100644 --- a/loginrec.c +++ b/loginrec.c | |||
@@ -758,8 +758,8 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx) | |||
758 | utx->ut_pid = li->pid; | 758 | utx->ut_pid = li->pid; |
759 | 759 | ||
760 | /* strncpy(): Don't necessarily want null termination */ | 760 | /* strncpy(): Don't necessarily want null termination */ |
761 | strncpy(utx->ut_name, li->username, | 761 | strncpy(utx->ut_user, li->username, |
762 | MIN_SIZEOF(utx->ut_name, li->username)); | 762 | MIN_SIZEOF(utx->ut_user, li->username)); |
763 | 763 | ||
764 | if (li->type == LTYPE_LOGOUT) | 764 | if (li->type == LTYPE_LOGOUT) |
765 | return; | 765 | return; |
@@ -1316,8 +1316,8 @@ wtmpx_write_entry(struct logininfo *li) | |||
1316 | static int | 1316 | static int |
1317 | wtmpx_islogin(struct logininfo *li, struct utmpx *utx) | 1317 | wtmpx_islogin(struct logininfo *li, struct utmpx *utx) |
1318 | { | 1318 | { |
1319 | if (strncmp(li->username, utx->ut_name, | 1319 | if (strncmp(li->username, utx->ut_user, |
1320 | MIN_SIZEOF(li->username, utx->ut_name)) == 0 ) { | 1320 | MIN_SIZEOF(li->username, utx->ut_user)) == 0 ) { |
1321 | # ifdef HAVE_TYPE_IN_UTMPX | 1321 | # ifdef HAVE_TYPE_IN_UTMPX |
1322 | if (utx->ut_type == USER_PROCESS) | 1322 | if (utx->ut_type == USER_PROCESS) |
1323 | return (1); | 1323 | return (1); |