sshlogin.c (cbf60a62) | sshlogin.c (69881b76) |
---|---|
1/* $OpenBSD: sshlogin.c,v 1.27 2011/01/11 06:06:09 djm Exp $ */ | 1/* $OpenBSD: sshlogin.c,v 1.28 2014/01/31 16:39:19 tedu Exp $ */ |
2/* 3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 5 * All rights reserved 6 * This file performs some of the things login(1) normally does. We cannot 7 * easily use something like login -p -h host -f user, because there are 8 * several different logins around, and it is hard to determined what kind of 9 * login the current system has. Also, we want to be able to execute commands --- 149 unchanged lines hidden (view full) --- 159 strncpy(u.ut_host, host, sizeof(u.ut_host)); 160 161 login(&u); 162 lastlog = _PATH_LASTLOG; 163 164 /* Update lastlog unless actually recording a logout. */ 165 if (strcmp(user, "") != 0) { 166 /* | 2/* 3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 5 * All rights reserved 6 * This file performs some of the things login(1) normally does. We cannot 7 * easily use something like login -p -h host -f user, because there are 8 * several different logins around, and it is hard to determined what kind of 9 * login the current system has. Also, we want to be able to execute commands --- 149 unchanged lines hidden (view full) --- 159 strncpy(u.ut_host, host, sizeof(u.ut_host)); 160 161 login(&u); 162 lastlog = _PATH_LASTLOG; 163 164 /* Update lastlog unless actually recording a logout. */ 165 if (strcmp(user, "") != 0) { 166 /* |
167 * It is safer to bzero the lastlog structure first because | 167 * It is safer to memset the lastlog structure first because |
168 * some systems might have some extra fields in it (e.g. SGI) 169 */ 170 memset(&ll, 0, sizeof(ll)); 171 172 /* Update lastlog. */ 173 ll.ll_time = time(NULL); 174 strncpy(ll.ll_line, tty + 5, sizeof(ll.ll_line)); 175 strncpy(ll.ll_host, host, sizeof(ll.ll_host)); --- 18 unchanged lines hidden --- | 168 * some systems might have some extra fields in it (e.g. SGI) 169 */ 170 memset(&ll, 0, sizeof(ll)); 171 172 /* Update lastlog. */ 173 ll.ll_time = time(NULL); 174 strncpy(ll.ll_line, tty + 5, sizeof(ll.ll_line)); 175 strncpy(ll.ll_host, host, sizeof(ll.ll_host)); --- 18 unchanged lines hidden --- |