search for: logininfo

Displaying 20 results from an estimated 29 matches for "logininfo".

2007 Jan 17
0
login_get_lastlog - nss enviornment - works in shell env, doesn't work when sshd calls it.
...string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> union login_netinfo { struct sockaddr sa; struct sockaddr_in sa_in; struct sockaddr_storage sa_storage; }; /* * * logininfo structure * */ /* types - different to utmp.h 'type' macros */ /* (though set to the same value as linux, openbsd and others...) */ #define LTYPE_LOGIN 7 #define LTYPE_LOGOUT 8 /* string lengths - set very long */ #define LINFO_PROGSIZE 64 #define LINFO_LINESIZE 64 #define LINFO_NAM...
2001 Jun 29
1
wtmpx problem on Solaris 8 sparcv9 (64bit) environment
...9p2.org/loginrec.c Wed May 9 05:34:33 2001 +++ openssh-2.9p2.cast/loginrec.c Thu Jun 28 11:06:22 2001 @@ -887,7 +891,11 @@ /* write a utmpx entry with the system's help (pututxline() and pals) */ # ifdef UTMPX_USE_LIBRARY static int +#ifdef __sparcv9 +utmpx_write_library(struct logininfo *li, struct utmpx *utx) +#else utmpx_write_library(struct logininfo *li, struct utmpx *utx) +#endif { setutxent(); pututxline(utx); @@ -902,7 +910,11 @@ /* write a utmp entry direct to the file */ static int +#ifdef __sparcv9 +utmpx_write_direct(struct logininfo *li, struct fut...
2001 Jun 06
1
One more UseLogin tweak
One other thing I noticed in the record_utmp_only() function is that it wasn't setting the timestamp in the logininfo structure. The following patch takes care of this: --- old/loginrec.c Wed Jun 6 11:12:14 2001 +++ loginrec.c Wed Jun 6 11:13:42 2001 @@ -448,6 +448,8 @@ login_utmp_only(struct logininfo *li) { li->type = LTYPE_LOGIN; + /* set the timestamp */ + login_set_current_time(li); # ifdef USE_UT...
2001 Apr 29
2
PATCH: UseLogin fix for 2.9p1 (w/improved last-login time)
...conf_lastlog_location="/var/adm/lastlog" AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) Index: loginrec.c --- loginrec.c 2001/02/22 21:23:21 1.32 +++ loginrec.c 2001/04/29 18:12:40 @@ -443,6 +443,27 @@ return 0; } +#ifdef LOGIN_NEEDS_UTMPX +int +login_utmp_only(struct logininfo *li) +{ + li->type = LTYPE_LOGIN; +# ifdef USE_UTMP + utmp_write_entry(li); +# endif +# ifdef USE_WTMP + wtmp_write_entry(li); +# endif +# ifdef USE_UTMPX + utmpx_write_entry(li); +# endif +# ifdef USE_WTMPX + wtmpx_write_entry(li); +# endif + return 0; +} +#endif + /** ** getlast_entry: Cal...
2002 Dec 29
0
[Bug 460] New: ut_addr_v6 not used
...read ut_addr_v6 from the wtmp file (I'm the maintainer). diff -ruN t/openssh-3.5p1/loginrec.c openssh-3.5p1/loginrec.c --- t/openssh-3.5p1/loginrec.c 2002-09-26 02:38:49.000000000 +0200 +++ openssh-3.5p1/loginrec.c 2002-11-05 13:14:33.000000000 +0100 @@ -609,6 +609,9 @@ construct_utmp(struct logininfo *li, struct utmp *ut) { +# ifdef HAVE_ADDR_V6_IN_UTMP + struct sockaddr_in6 *sa6; +# endif memset(ut, '\0', sizeof(*ut)); /* First fill out fields used for both logins and logouts */ @@ -661,6 +664,19 @@ if (li->hostaddr.sa.sa_family == AF_INET) ut->ut_addr = li-&g...
2001 Aug 21
0
Resend: loginrec.c patch
I'm resending this patch just in case it got lost. The first hunk of the patch fixes a problem with the LOGIN_NEEDS_UTMPX support in that the date was not being set in the logininfo structure (causing wrong timestamps in the "last" log). The second hunk just omits the USE_WTMPX code in the LOGIN_NEEDS_UTMPX section if USE_UTMPX is defined. This prevents duplicate events in the last log under Solaris. Neither of these changes affect the non-LOGIN_NEEDS_UTMPX code....
2015 Jun 02
3
[Bug 2407] New: OpenSSH uses deprecated APIs on MacOS
https://bugzilla.mindrot.org/show_bug.cgi?id=2407 Bug ID: 2407 Summary: OpenSSH uses deprecated APIs on MacOS Product: Portable OpenSSH Version: -current Hardware: All OS: Mac OS X Status: NEW Severity: normal Priority: P5 Component: Miscellaneous Assignee: unassigned-bugs at
2000 Jul 04
0
AW: FreeBSD 3.5-STABLE
...li->username)); + strncpy(ut->ut_name, li->username, MIN_SIZEOF(ut->ut_name, li->username)); # ifdef HAVE_HOST_IN_UTMP strncpy(ut->ut_host, li->hostname, MIN_SIZEOF(ut->ut_host, li->hostname)); # endif @@ -1006,8 +1006,8 @@ static int wtmp_islogin(struct logininfo *li, struct utmp *ut) { - if (strncmp(li->username, ut->ut_user, - MIN_SIZEOF(li->username, ut->ut_user)) == 0) { + if (strncmp(li->username, ut->ut_name, + MIN_SIZEOF(li->username, ut->ut_name)) == 0) { # ifdef HAVE_TYPE_IN_UTMP...
2001 Oct 23
8
Another round of testing calls.
Outside the known 'Hang-on-exit' bug and the Solaris 'PAM_TTY_KLUDGE' required. *WHAT* other issues *MUST* be address before 3.0 which is approaching fast? Those running NeXTStep I need conformation that it works under NeXT. My current Slab is packed in a storage unit due to a fire in my apartment complex (happened above me so I'm wrapping up dealing with that crap =). -
2004 Apr 28
1
[Bug 855] doesn't properly log logout event in utmp entry when pts bigger than 999
...one - no logout Patch to fix issue: diff -urN openssh-3.8p1.org/loginrec.c openssh-3.8p1/loginrec.c --- openssh-3.8p1.org/loginrec.c 2004-04-29 01:06:46.350105456 +0200 +++ openssh-3.8p1/loginrec.c 2004-04-29 01:07:37.357351176 +0200 @@ -1354,7 +1354,7 @@ syslogin_perform_logout(struct logininfo *li) { # ifdef HAVE_LOGOUT - char line[8]; + char line[LINFO_LINESIZE]; (void)line_stripname(line, li->line, sizeof(line)); ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
2000 Jan 13
0
new login library alpha release
...various UNIX-like OSes. As Damien said before on the list, it's the nastiest part of porting OpenSSH to new platforms. The old record_login() function (login.c) is about 100 lines of code, full of #ifdef statements. The liblogin version is this: void record_login( <params> ) { struct logininfo *li; li = liblogin_alloc_entry(pid, user, host, ttyname); liblogin_set_ip4(li, addr); liblogin_login(li); } A good deal less hassle. Of course, the hassle has moved somewhere else, but, because it's liblogin's raison d'etre, it's designed with portability in mind and hopeful...
2001 Nov 20
0
PATCH: Fixing last/utmpx for Solaris
..._release(s->tty); --- sshlogin.c~ Tue May 8 16:33:06 2001 +++ sshlogin.c Mon Nov 19 12:08:34 2001 @@ -94,11 +94,11 @@ /* Records that the user has logged out. */ void -record_logout(pid_t pid, const char *ttyname) +record_logout(pid_t pid, const char *ttyname, const char *user) { struct logininfo *li; - li = login_alloc_entry(pid, NULL, NULL, ttyname); + li = login_alloc_entry(pid, user, NULL, ttyname); login_logout(li); login_free_entry(li); } --- sshlogin.h~ Wed Jul 4 00:46:58 2001 +++ sshlogin.h Mon Nov 19 12:08:34 2001 @@ -17,7 +17,7 @@ void record_login(pid_t, const char...
2002 Feb 12
0
[Bug 110] New: bogus error messages in lastlog_get_entry()
...Also, I made an attempt to report partial reads in a proper way. diff -urN openssh-3.0.2p1.old/loginrec.c openssh-3.0.2p1/loginrec.c --- openssh-3.0.2p1.old/loginrec.c Tue Oct 30 03:50:40 2001 +++ openssh-3.0.2p1/loginrec.c Tue Feb 12 23:16:43 2002 @@ -1486,15 +1486,23 @@ lastlog_get_entry(struct logininfo *li) { struct lastlog last; - int fd; + int fd, r; if (!lastlog_openseek(li, &fd, O_RDONLY)) return 0; - if (atomicio(read, fd, &last, sizeof(last)) != sizeof(last)) { + r = atomicio(read, fd, &last, sizeof(last)); + if (r == 0) { + /* no recorded login */ + memset(&la...
2014 May 22
0
[PATCH] openssh - loginrec.c - Non-atomic file operations.
...index 4219b9a..281d650 100644 --- a/loginrec.c +++ b/loginrec.c @@ -163,6 +163,7 @@ #include <string.h> #include <time.h> #include <unistd.h> +#include <dirent.h> #include "xmalloc.h" #include "key.h" @@ -1476,41 +1477,65 @@ lastlog_openseek(struct logininfo *li, int *fd, int filemode) off_t offset; char lastlog_file[1024]; struct stat st; - - if (stat(LASTLOG_FILE, &st) != 0) { - logit("%s: Couldn't stat %s: %s", __func__, - LASTLOG_FILE, strerror(errno)); - return (0); - } - if (S_ISDIR(st.st_mode)) { - snprintf(lastlo...
2002 Jan 29
0
[Bug 84] New: last command provides incorrect information on Solaris 8
...release(s->tty); --- sshlogin.c~ Tue May 8 16:33:06 2001 +++ sshlogin.c Tue Jan 29 10:56:59 2002 @@ -94,11 +94,11 @@ /* Records that the user has logged out. */ void -record_logout(pid_t pid, const char *ttyname) +record_logout(pid_t pid, const char *ttyname, const char *user) { struct logininfo *li; - li = login_alloc_entry(pid, NULL, NULL, ttyname); + li = login_alloc_entry(pid, user, NULL, ttyname); login_logout(li); login_free_entry(li); } --- sshlogin.h~ Wed Jul 4 00:46:58 2001 +++ sshlogin.h Tue Jan 29 10:56:59 2002 @@ -17,7 +17,7 @@ void record_login(pid_t, const char...
2010 Sep 13
5
[Bug 1817] New: lastlog is not recorded with the big uid
...AssignedTo: unassigned-bugs at mindrot.org ReportedBy: jchadima at redhat.com Description of problem: lastlog is not recorded with the big uid (>2147483647). 1569 /* open the file (using filemode) and seek to the login entry */ 1570 static int 1571 lastlog_openseek(struct logininfo *li, int *fd, int filemode) 1572 { ... 1600 if (type == LL_FILE) { 1601 /* find this uid's offset in the lastlog file */ 1602 offset = (off_t) ((long)li->uid * sizeof(struct lastlog)); 1603 1604 if (lseek(...
2009 Dec 25
2
[openssh-portable] utmpx and ut_name
.../ - strncpy(utx->ut_name, li->username, - MIN_SIZEOF(utx->ut_name, li->username)); + strncpy(utx->ut_user, li->username, + MIN_SIZEOF(utx->ut_user, li->username)); if (li->type == LTYPE_LOGOUT) return; @@ -1316,8 +1316,8 @@ static int wtmpx_islogin(struct logininfo *li, struct utmpx *utx) { - if (strncmp(li->username, utx->ut_name, - MIN_SIZEOF(li->username, utx->ut_name)) == 0 ) { + if (strncmp(li->username, utx->ut_user, + MIN_SIZEOF(li->username, utx->ut_user)) == 0 ) { # ifdef HAVE_TYPE_IN_UTMPX if (utx->ut_type ==...
2001 Nov 15
1
Patch for "last" providing incorrect information on Solaris 8
...ase(s->tty); --- sshlogin.c.orig Thu Nov 15 09:35:02 2001 +++ sshlogin.c Thu Nov 15 09:38:01 2001 @@ -94,11 +94,11 @@ /* Records that the user has logged out. */ void -record_logout(pid_t pid, const char *ttyname) +record_logout(pid_t pid, const char *ttyname, const char *user) { struct logininfo *li; - li = login_alloc_entry(pid, NULL, NULL, ttyname); + li = login_alloc_entry(pid, user, NULL, ttyname); login_logout(li); login_free_entry(li); } --- sshlogin.h.orig Thu Nov 15 09:35:02 2001 +++ sshlogin.h Thu Nov 15 09:38:01 2001 @@ -17,7 +17,7 @@ void record_login(pid_t, const...
2009 Mar 27
7
[Bug 1579] New: long usernames get truncated and fail to log in
...tatus: NEW Severity: major Priority: P2 Component: sshd AssignedTo: unassigned-bugs at mindrot.org ReportedBy: ossman at cendio.se A username cannot currently be longer than 128 characters as that is the size of the "username" field in struct logininfo. Under some circumstances this is not enough though. In our specific case, we log in using the common name from a certificate, which often surpasses 128 characters. Logging in using common names from an LDAP tree is another case where username can easily get very long. In a perfect world, the ser...
2004 Apr 08
3
patch for "gone - no logout" output from last(1)
...e length of the array if it is defined. -John -- John P. Eisenmenger jpe at eisenmenger.org *** openssh-3.7.1p2/loginrec.c.orig Sun Jul 6 01:20:46 2003 --- openssh-3.7.1p2/loginrec.c Wed Apr 7 19:35:43 2004 *************** *** 1349,1355 **** --- 1349,1359 ---- syslogin_perform_logout(struct logininfo *li) { # ifdef HAVE_LOGOUT + # ifdef UT_LINESIZE + char line[UT_LINESIZE]; + # else char line[8]; + # endif (void)line_stripname(line, li->line, sizeof(line));