mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-31 01:35:11 +02:00
- (djm) Bug #110: bogus error messages in lastlog_get_entry(). Fix based
on one by peak@argo.troja.mff.cuni.cz
This commit is contained in:
parent
64004b5566
commit
7df881d20e
@ -6,6 +6,8 @@
|
|||||||
- (djm) Bug #26: Use local mkstemp() rather than glibc's silly one. Fixes
|
- (djm) Bug #26: Use local mkstemp() rather than glibc's silly one. Fixes
|
||||||
Can't pass KRB4 TGT passing. Fix from: jan.iven@cern.ch
|
Can't pass KRB4 TGT passing. Fix from: jan.iven@cern.ch
|
||||||
- (djm) Fix Bug #442 for PAM case
|
- (djm) Fix Bug #442 for PAM case
|
||||||
|
- (djm) Bug #110: bogus error messages in lastlog_get_entry(). Fix based
|
||||||
|
on one by peak@argo.troja.mff.cuni.cz
|
||||||
|
|
||||||
20030103
|
20030103
|
||||||
- (djm) Bug #461: ssh-copy-id fails with no arguments. Patch from
|
- (djm) Bug #461: ssh-copy-id fails with no arguments. Patch from
|
||||||
@ -934,4 +936,4 @@
|
|||||||
save auth method before monitor_reset_key_state(); bugzilla bug #284;
|
save auth method before monitor_reset_key_state(); bugzilla bug #284;
|
||||||
ok provos@
|
ok provos@
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.2544 2003/01/07 05:15:20 djm Exp $
|
$Id: ChangeLog,v 1.2545 2003/01/07 05:46:58 djm Exp $
|
||||||
|
32
loginrec.c
32
loginrec.c
@ -163,7 +163,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "atomicio.h"
|
#include "atomicio.h"
|
||||||
|
|
||||||
RCSID("$Id: loginrec.c,v 1.45 2003/01/03 03:42:28 djm Exp $");
|
RCSID("$Id: loginrec.c,v 1.46 2003/01/07 05:46:58 djm Exp $");
|
||||||
|
|
||||||
#ifdef HAVE_UTIL_H
|
#ifdef HAVE_UTIL_H
|
||||||
# include <util.h>
|
# include <util.h>
|
||||||
@ -1522,22 +1522,32 @@ int
|
|||||||
lastlog_get_entry(struct logininfo *li)
|
lastlog_get_entry(struct logininfo *li)
|
||||||
{
|
{
|
||||||
struct lastlog last;
|
struct lastlog last;
|
||||||
int fd;
|
int fd, ret;
|
||||||
|
|
||||||
if (!lastlog_openseek(li, &fd, O_RDONLY))
|
if (!lastlog_openseek(li, &fd, O_RDONLY))
|
||||||
return 0;
|
return (0);
|
||||||
|
|
||||||
if (atomicio(read, fd, &last, sizeof(last)) != sizeof(last)) {
|
ret = atomicio(read, fd, &last, sizeof(last));
|
||||||
close(fd);
|
close(fd);
|
||||||
log("lastlog_get_entry: Error reading from %s: %s",
|
|
||||||
|
switch (ret) {
|
||||||
|
case 0:
|
||||||
|
memset(&last, '\0', sizeof(last));
|
||||||
|
/* FALLTHRU */
|
||||||
|
case sizeof(last):
|
||||||
|
lastlog_populate_entry(li, &last);
|
||||||
|
return (1);
|
||||||
|
case -1:
|
||||||
|
error("%s: Error reading from %s: %s", __func__,
|
||||||
LASTLOG_FILE, strerror(errno));
|
LASTLOG_FILE, strerror(errno));
|
||||||
return 0;
|
return (0);
|
||||||
|
default:
|
||||||
|
error("%s: Error reading from %s: Expecting %d, got %d",
|
||||||
|
__func__, LASTLOG_FILE, sizeof(last), ret);
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
close(fd);
|
/* NOTREACHED */
|
||||||
|
return (0);
|
||||||
lastlog_populate_entry(li, &last);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
#endif /* USE_LASTLOG */
|
#endif /* USE_LASTLOG */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user