|
Jan F |
7c53d7 |
diff -up openssh-5.6p1/loginrec.c.biguid openssh-5.6p1/loginrec.c
|
|
Jan F |
7c53d7 |
--- openssh-5.6p1/loginrec.c.biguid 2010-11-15 13:19:35.000000000 +0100
|
|
Jan F |
7c53d7 |
+++ openssh-5.6p1/loginrec.c 2010-11-15 13:19:38.000000000 +0100
|
|
Jan F |
7c53d7 |
@@ -273,7 +273,7 @@ login_logout(struct logininfo *li)
|
|
Jan F |
7c53d7 |
* try to retrieve lastlog information from wtmp/wtmpx.
|
|
Jan F |
7c53d7 |
*/
|
|
Jan F |
7c53d7 |
unsigned int
|
|
Jan F |
7c53d7 |
-login_get_lastlog_time(const int uid)
|
|
Jan F |
7c53d7 |
+login_get_lastlog_time(const uid_t uid)
|
|
Jan F |
7c53d7 |
{
|
|
Jan F |
7c53d7 |
struct logininfo li;
|
|
Jan F |
7c53d7 |
|
|
Jan F |
7c53d7 |
@@ -297,7 +297,7 @@ login_get_lastlog_time(const int uid)
|
|
Jan F |
7c53d7 |
* 0 on failure (will use OpenSSH's logging facilities for diagnostics)
|
|
Jan F |
7c53d7 |
*/
|
|
Jan F |
7c53d7 |
struct logininfo *
|
|
Jan F |
7c53d7 |
-login_get_lastlog(struct logininfo *li, const int uid)
|
|
Jan F |
7c53d7 |
+login_get_lastlog(struct logininfo *li, const uid_t uid)
|
|
Jan F |
7c53d7 |
{
|
|
Jan F |
7c53d7 |
struct passwd *pw;
|
|
Jan F |
7c53d7 |
|
|
Jan F |
7c53d7 |
@@ -311,7 +311,8 @@ login_get_lastlog(struct logininfo *li,
|
|
Jan F |
7c53d7 |
*/
|
|
Jan F |
7c53d7 |
pw = getpwuid(uid);
|
|
Jan F |
7c53d7 |
if (pw == NULL)
|
|
Jan F |
7c53d7 |
- fatal("%s: Cannot find account for uid %i", __func__, uid);
|
|
Jan F |
7c53d7 |
+ fatal("%s: Cannot find account for uid %ld", __func__,
|
|
Jan F |
7c53d7 |
+ (long)uid);
|
|
Jan F |
7c53d7 |
|
|
Jan F |
7c53d7 |
/* No MIN_SIZEOF here - we absolutely *must not* truncate the
|
|
Jan F |
7c53d7 |
* username (XXX - so check for trunc!) */
|
|
Jan F |
7c53d7 |
@@ -335,7 +336,7 @@ login_get_lastlog(struct logininfo *li,
|
|
Jan F |
7c53d7 |
* allocation fails, the program halts.
|
|
Jan F |
7c53d7 |
*/
|
|
Jan F |
7c53d7 |
struct
|
|
Jan F |
7c53d7 |
-logininfo *login_alloc_entry(int pid, const char *username,
|
|
Jan F |
7c53d7 |
+logininfo *login_alloc_entry(pid_t pid, const char *username,
|
|
Jan F |
7c53d7 |
const char *hostname, const char *line)
|
|
Jan F |
7c53d7 |
{
|
|
Jan F |
7c53d7 |
struct logininfo *newli;
|
|
Jan F |
7c53d7 |
@@ -363,7 +364,7 @@ login_free_entry(struct logininfo *li)
|
|
Jan F |
7c53d7 |
* Returns: 1
|
|
Jan F |
7c53d7 |
*/
|
|
Jan F |
7c53d7 |
int
|
|
Jan F |
7c53d7 |
-login_init_entry(struct logininfo *li, int pid, const char *username,
|
|
Jan F |
7c53d7 |
+login_init_entry(struct logininfo *li, pid_t pid, const char *username,
|
|
Jan F |
7c53d7 |
const char *hostname, const char *line)
|
|
Jan F |
7c53d7 |
{
|
|
Jan F |
7c53d7 |
struct passwd *pw;
|
|
Jan F |
7c53d7 |
@@ -1496,7 +1497,7 @@ lastlog_openseek(struct logininfo *li, i
|
|
Jan F |
ce0606 |
|
|
Jan F |
ce0606 |
if (S_ISREG(st.st_mode)) {
|
|
Jan F |
ce0606 |
/* find this uid's offset in the lastlog file */
|
|
Jan F |
ce0606 |
- offset = (off_t) ((long)li->uid * sizeof(struct lastlog));
|
|
Jan F |
7c53d7 |
+ offset = (off_t) ((u_long)li->uid * sizeof(struct lastlog));
|
|
Jan F |
ce0606 |
|
|
Jan F |
ce0606 |
if (lseek(*fd, offset, SEEK_SET) != offset) {
|
|
Jan F |
ce0606 |
logit("%s: %s->lseek(): %s", __func__,
|
|
Jan F |
7c53d7 |
diff -up openssh-5.6p1/loginrec.h.biguid openssh-5.6p1/loginrec.h
|
|
Jan F |
7c53d7 |
--- openssh-5.6p1/loginrec.h.biguid 2010-06-22 07:02:39.000000000 +0200
|
|
Jan F |
7c53d7 |
+++ openssh-5.6p1/loginrec.h 2010-11-15 13:19:38.000000000 +0100
|
|
Jan F |
7c53d7 |
@@ -63,8 +63,8 @@ struct logininfo {
|
|
Jan F |
7c53d7 |
char progname[LINFO_PROGSIZE]; /* name of program (for PAM) */
|
|
Jan F |
7c53d7 |
int progname_null;
|
|
Jan F |
7c53d7 |
short int type; /* type of login (LTYPE_*) */
|
|
Jan F |
7c53d7 |
- int pid; /* PID of login process */
|
|
Jan F |
7c53d7 |
- int uid; /* UID of this user */
|
|
Jan F |
7c53d7 |
+ pid_t pid; /* PID of login process */
|
|
Jan F |
7c53d7 |
+ uid_t uid; /* UID of this user */
|
|
Jan F |
7c53d7 |
char line[LINFO_LINESIZE]; /* tty/pty name */
|
|
Jan F |
7c53d7 |
char username[LINFO_NAMESIZE]; /* login username */
|
|
Jan F |
7c53d7 |
char hostname[LINFO_HOSTSIZE]; /* remote hostname */
|
|
Jan F |
7c53d7 |
@@ -86,12 +86,12 @@ struct logininfo {
|
|
Jan F |
7c53d7 |
/** 'public' functions */
|
|
Jan F |
7c53d7 |
|
|
Jan F |
7c53d7 |
/* construct a new login entry */
|
|
Jan F |
7c53d7 |
-struct logininfo *login_alloc_entry(int pid, const char *username,
|
|
Jan F |
7c53d7 |
+struct logininfo *login_alloc_entry(pid_t pid, const char *username,
|
|
Jan F |
7c53d7 |
const char *hostname, const char *line);
|
|
Jan F |
7c53d7 |
/* free a structure */
|
|
Jan F |
7c53d7 |
void login_free_entry(struct logininfo *li);
|
|
Jan F |
7c53d7 |
/* fill out a pre-allocated structure with useful information */
|
|
Jan F |
7c53d7 |
-int login_init_entry(struct logininfo *li, int pid, const char *username,
|
|
Jan F |
7c53d7 |
+int login_init_entry(struct logininfo *li, pid_t pid, const char *username,
|
|
Jan F |
7c53d7 |
const char *hostname, const char *line);
|
|
Jan F |
7c53d7 |
/* place the current time in a logininfo struct */
|
|
Jan F |
7c53d7 |
void login_set_current_time(struct logininfo *li);
|
|
Jan F |
7c53d7 |
@@ -117,9 +117,9 @@ void login_set_addr(struct logininfo *li
|
|
Jan F |
7c53d7 |
* lastlog retrieval functions
|
|
Jan F |
7c53d7 |
*/
|
|
Jan F |
7c53d7 |
/* lastlog *entry* functions fill out a logininfo */
|
|
Jan F |
7c53d7 |
-struct logininfo *login_get_lastlog(struct logininfo *li, const int uid);
|
|
Jan F |
7c53d7 |
+struct logininfo *login_get_lastlog(struct logininfo *li, const uid_t uid);
|
|
Jan F |
7c53d7 |
/* lastlog *time* functions return time_t equivalent (uint) */
|
|
Jan F |
7c53d7 |
-unsigned int login_get_lastlog_time(const int uid);
|
|
Jan F |
7c53d7 |
+unsigned int login_get_lastlog_time(const uid_t uid);
|
|
Jan F |
7c53d7 |
|
|
Jan F |
7c53d7 |
/* produce various forms of the line filename */
|
|
Jan F |
7c53d7 |
char *line_fullname(char *dst, const char *src, u_int dstsize);
|