sshlogin.c (114426) | sshlogin.c (124211) |
---|---|
1/* 2 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * All rights reserved 5 * This file performs some of the things login(1) normally does. We cannot 6 * easily use something like login -p -h host -f user, because there are 7 * several different logins around, and it is hard to determined what kind of 8 * login the current system has. Also, we want to be able to execute commands --- 25 unchanged lines hidden (view full) --- 34 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 38 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 */ 40 41#include "includes.h" | 1/* 2 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * All rights reserved 5 * This file performs some of the things login(1) normally does. We cannot 6 * easily use something like login -p -h host -f user, because there are 7 * several different logins around, and it is hard to determined what kind of 8 * login the current system has. Also, we want to be able to execute commands --- 25 unchanged lines hidden (view full) --- 34 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 38 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 */ 40 41#include "includes.h" |
42RCSID("$OpenBSD: sshlogin.c,v 1.5 2002/08/29 15:57:25 stevesk Exp $"); | 42RCSID("$OpenBSD: sshlogin.c,v 1.7 2003/06/12 07:57:38 markus Exp $"); |
43 44#include "loginrec.h" 45 46/* 47 * Returns the time when the user last logged in. Returns 0 if the 48 * information is not available. This must be called before record_login. 49 * The host the user logged in from will be returned in buf. 50 */ --- 4 unchanged lines hidden (view full) --- 55 struct logininfo li; 56 57 login_get_lastlog(&li, uid); 58 strlcpy(buf, li.hostname, bufsize); 59 return li.tv_sec; 60} 61 62/* | 43 44#include "loginrec.h" 45 46/* 47 * Returns the time when the user last logged in. Returns 0 if the 48 * information is not available. This must be called before record_login. 49 * The host the user logged in from will be returned in buf. 50 */ --- 4 unchanged lines hidden (view full) --- 55 struct logininfo li; 56 57 login_get_lastlog(&li, uid); 58 strlcpy(buf, li.hostname, bufsize); 59 return li.tv_sec; 60} 61 62/* |
63 * Records that the user has logged in. I these parts of operating systems 64 * were more standardized. | 63 * Records that the user has logged in. I wish these parts of operating 64 * systems were more standardized. |
65 */ 66void 67record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid, 68 const char *host, struct sockaddr * addr, socklen_t addrlen) 69{ 70 struct logininfo *li; 71 72 li = login_alloc_entry(pid, user, host, ttyname); --- 29 unchanged lines hidden --- | 65 */ 66void 67record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid, 68 const char *host, struct sockaddr * addr, socklen_t addrlen) 69{ 70 struct logininfo *li; 71 72 li = login_alloc_entry(pid, user, host, ttyname); --- 29 unchanged lines hidden --- |