aboutsummaryrefslogtreecommitdiff
path: root/loginrec.c
diff options
context:
space:
mode:
Diffstat (limited to 'loginrec.c')
-rw-r--r--loginrec.c48
1 files changed, 21 insertions, 27 deletions
diff --git a/loginrec.c b/loginrec.c
index c4a9bd4853e3..7d1c9dd43de9 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -129,18 +129,14 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
+#include <sys/time.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
-#ifdef HAVE_PATHS_H
-# include <paths.h>
-#endif
+#include <paths.h>
#include <pwd.h>
#include <stdarg.h>
#include <stdio.h>
@@ -162,9 +158,7 @@
#include "ssherr.h"
#include "misc.h"
-#ifdef HAVE_UTIL_H
# include <util.h>
-#endif
#ifdef USE_WTMPDB
# include <wtmpdb.h>
@@ -853,7 +847,7 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
endttyent();
if (NULL == ty) {
- logit("%s: tty not found", __func__);
+ logit_f("tty not found");
return (0);
}
#else /* FIXME */
@@ -867,7 +861,7 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
pos = (off_t)tty * sizeof(struct utmp);
if ((ret = lseek(fd, pos, SEEK_SET)) == -1) {
- logit("%s: lseek: %s", __func__, strerror(errno));
+ logit_f("lseek: %s", strerror(errno));
close(fd);
return (0);
}
@@ -889,7 +883,7 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
memcpy(ut->ut_host, old_ut.ut_host, sizeof(ut->ut_host));
if ((ret = lseek(fd, pos, SEEK_SET)) == -1) {
- logit("%s: lseek: %s", __func__, strerror(errno));
+ logit_f("lseek: %s", strerror(errno));
close(fd);
return (0);
}
@@ -922,12 +916,12 @@ utmp_perform_login(struct logininfo *li)
construct_utmp(li, &ut);
# ifdef UTMP_USE_LIBRARY
if (!utmp_write_library(li, &ut)) {
- logit("%s: utmp_write_library() failed", __func__);
+ logit_f("utmp_write_library() failed");
return (0);
}
# else
if (!utmp_write_direct(li, &ut)) {
- logit("%s: utmp_write_direct() failed", __func__);
+ logit_f("utmp_write_direct() failed");
return (0);
}
# endif
@@ -943,12 +937,12 @@ utmp_perform_logout(struct logininfo *li)
construct_utmp(li, &ut);
# ifdef UTMP_USE_LIBRARY
if (!utmp_write_library(li, &ut)) {
- logit("%s: utmp_write_library() failed", __func__);
+ logit_f("utmp_write_library() failed");
return (0);
}
# else
if (!utmp_write_direct(li, &ut)) {
- logit("%s: utmp_write_direct() failed", __func__);
+ logit_f("utmp_write_direct() failed");
return (0);
}
# endif
@@ -967,7 +961,7 @@ utmp_write_entry(struct logininfo *li)
return (utmp_perform_logout(li));
default:
- logit("%s: invalid type field", __func__);
+ logit_f("invalid type field");
return (0);
}
}
@@ -1008,7 +1002,7 @@ utmpx_write_library(struct logininfo *li, struct utmpx *utx)
static int
utmpx_write_direct(struct logininfo *li, struct utmpx *utx)
{
- logit("%s: not implemented!", __func__);
+ logit_f("not implemented!");
return (0);
}
# endif /* UTMPX_USE_LIBRARY */
@@ -1021,12 +1015,12 @@ utmpx_perform_login(struct logininfo *li)
construct_utmpx(li, &utx);
# ifdef UTMPX_USE_LIBRARY
if (!utmpx_write_library(li, &utx)) {
- logit("%s: utmp_write_library() failed", __func__);
+ logit_f("utmp_write_library() failed");
return (0);
}
# else
if (!utmpx_write_direct(li, &utx)) {
- logit("%s: utmp_write_direct() failed", __func__);
+ logit_f("utmp_write_direct() failed");
return (0);
}
# endif
@@ -1064,7 +1058,7 @@ utmpx_write_entry(struct logininfo *li)
case LTYPE_LOGOUT:
return (utmpx_perform_logout(li));
default:
- logit("%s: invalid type field", __func__);
+ logit_f("invalid type field");
return (0);
}
}
@@ -1132,7 +1126,7 @@ wtmp_write_entry(struct logininfo *li)
case LTYPE_LOGOUT:
return (wtmp_perform_logout(li));
default:
- logit("%s: invalid type field", __func__);
+ logit_f("invalid type field");
return (0);
}
}
@@ -1311,7 +1305,7 @@ wtmpx_write_entry(struct logininfo *li)
case LTYPE_LOGOUT:
return (wtmpx_perform_logout(li));
default:
- logit("%s: invalid type field", __func__);
+ logit_f("invalid type field");
return (0);
}
}
@@ -1453,7 +1447,7 @@ wtmpdb_write_entry(struct logininfo *li)
case LTYPE_LOGOUT:
return (wtmpdb_perform_logout(li));
default:
- logit("%s: invalid type field", __func__);
+ logit_f("invalid type field");
return (0);
}
}
@@ -1486,7 +1480,7 @@ syslogin_perform_logout(struct logininfo *li)
(void)line_stripname(line, li->line, sizeof(line));
if (!logout(line))
- logit("%s: logout() returned an error", __func__);
+ logit_f("logout() returned an error");
# ifdef HAVE_LOGWTMP
else
logwtmp(line, "", "");
@@ -1508,7 +1502,7 @@ syslogin_write_entry(struct logininfo *li)
case LTYPE_LOGOUT:
return (syslogin_perform_logout(li));
default:
- logit("%s: Invalid type field", __func__);
+ logit_f("Invalid type field");
return (0);
}
}
@@ -1612,7 +1606,7 @@ lastlog_write_entry(struct logininfo *li)
close(fd);
return (1);
default:
- logit("%s: Invalid type field", __func__);
+ logit_f("Invalid type field");
return (0);
}
}
@@ -1704,7 +1698,7 @@ utmpx_get_entry(struct logininfo *li)
/*
* Logs failed login attempts in _PATH_BTMP if that exists.
* The most common login failure is to give password instead of username.
- * So the _PATH_BTMP file checked for the correct permission, so that only
+ * So the _PATH_BTMP file is checked for the correct permission, so that only
* root can read it.
*/
void