loginrec.c (149753) | loginrec.c (157019) |
---|---|
1/* 2 * Copyright (c) 2000 Andre Lucas. All rights reserved. 3 * Portions copyright (c) 1998 Todd C. Miller 4 * Portions copyright (c) 1996 Jason Downs 5 * Portions copyright (c) 1996 Theo de Raadt 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 151 unchanged lines hidden (view full) --- 160#ifdef HAVE_UTIL_H 161# include <util.h> 162#endif 163 164#ifdef HAVE_LIBUTIL_H 165# include <libutil.h> 166#endif 167 | 1/* 2 * Copyright (c) 2000 Andre Lucas. All rights reserved. 3 * Portions copyright (c) 1998 Todd C. Miller 4 * Portions copyright (c) 1996 Jason Downs 5 * Portions copyright (c) 1996 Theo de Raadt 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 151 unchanged lines hidden (view full) --- 160#ifdef HAVE_UTIL_H 161# include <util.h> 162#endif 163 164#ifdef HAVE_LIBUTIL_H 165# include <libutil.h> 166#endif 167 |
168RCSID("$Id: loginrec.c,v 1.70 2005/07/17 07:26:44 djm Exp $"); 169RCSID("$FreeBSD: head/crypto/openssh/loginrec.c 149753 2005-09-03 07:04:25Z des $"); | 168RCSID("$Id: loginrec.c,v 1.71 2005/11/22 08:55:13 dtucker Exp $"); 169RCSID("$FreeBSD: head/crypto/openssh/loginrec.c 157019 2006-03-22 20:41:37Z des $"); |
170 171/** 172 ** prototypes for helper functions in this file 173 **/ 174 175#if HAVE_UTMP_H 176void set_utmp_time(struct logininfo *li, struct utmp *ut); 177void construct_utmp(struct logininfo *li, struct utmp *ut); --- 1407 unchanged lines hidden (view full) --- 1585 lastlog_populate_entry(li, &last); 1586 return (1); 1587 case -1: 1588 error("%s: Error reading from %s: %s", __func__, 1589 LASTLOG_FILE, strerror(errno)); 1590 return (0); 1591 default: 1592 error("%s: Error reading from %s: Expecting %d, got %d", | 170 171/** 172 ** prototypes for helper functions in this file 173 **/ 174 175#if HAVE_UTMP_H 176void set_utmp_time(struct logininfo *li, struct utmp *ut); 177void construct_utmp(struct logininfo *li, struct utmp *ut); --- 1407 unchanged lines hidden (view full) --- 1585 lastlog_populate_entry(li, &last); 1586 return (1); 1587 case -1: 1588 error("%s: Error reading from %s: %s", __func__, 1589 LASTLOG_FILE, strerror(errno)); 1590 return (0); 1591 default: 1592 error("%s: Error reading from %s: Expecting %d, got %d", |
1593 __func__, LASTLOG_FILE, sizeof(last), ret); | 1593 __func__, LASTLOG_FILE, (int)sizeof(last), ret); |
1594 return (0); 1595 } 1596 1597 /* NOTREACHED */ 1598 return (0); 1599} 1600#endif /* USE_LASTLOG */ 1601 --- 7 unchanged lines hidden (view full) --- 1609 1610void 1611record_failed_login(const char *username, const char *hostname, 1612 const char *ttyn) 1613{ 1614 int fd; 1615 struct utmp ut; 1616 struct sockaddr_storage from; | 1594 return (0); 1595 } 1596 1597 /* NOTREACHED */ 1598 return (0); 1599} 1600#endif /* USE_LASTLOG */ 1601 --- 7 unchanged lines hidden (view full) --- 1609 1610void 1611record_failed_login(const char *username, const char *hostname, 1612 const char *ttyn) 1613{ 1614 int fd; 1615 struct utmp ut; 1616 struct sockaddr_storage from; |
1617 size_t fromlen = sizeof(from); | 1617 socklen_t fromlen = sizeof(from); |
1618 struct sockaddr_in *a4; 1619 struct sockaddr_in6 *a6; 1620 time_t t; 1621 struct stat fst; 1622 1623 if (geteuid() != 0) 1624 return; 1625 if ((fd = open(_PATH_BTMP, O_WRONLY | O_APPEND)) < 0) { --- 54 unchanged lines hidden --- | 1618 struct sockaddr_in *a4; 1619 struct sockaddr_in6 *a6; 1620 time_t t; 1621 struct stat fst; 1622 1623 if (geteuid() != 0) 1624 return; 1625 if ((fd = open(_PATH_BTMP, O_WRONLY | O_APPEND)) < 0) { --- 54 unchanged lines hidden --- |