3 Interix support
and related fixes
5 --- loginrec
.c
.orig
2013-02-22 22:12:24.000000000 +0000
7 @@
-429,8 +429,8 @@
login_set_addr(struct logininfo
*li
, con
9 login_write(struct logininfo
*li
)
12 - if (geteuid() != 0) {
13 +#if !defined(HAVE_CYGWIN) && !defined(HAVE_INTERIX)
14 + if (geteuid() != ROOTUID
) {
15 logit("Attempt to write login records by non-root user (aborting)");
18 @@
-438,7 +438,7 @@
login_write(struct logininfo
*li
)
20 /* set the timestamp */
21 login_set_current_time(li
);
23 +#if defined(USE_LOGIN) && (HAVE_UTMP_H)
24 syslogin_write_entry(li
);
27 @@
-622,7 +622,7 @@
line_abbrevname(char *dst
, const char *s
31 -#if defined(USE_UTMP) || defined (USE_WTMP) || defined (USE_LOGIN)
32 +#if defined(USE_UTMP) || defined (USE_WTMP) || (defined (USE_LOGIN) && defined (HAVE_UTMP_H))
34 /* build the utmp structure */
36 @@
-759,10 +759,6 @@
construct_utmpx(struct logininfo
*li
, st
37 set_utmpx_time(li
, utx
);
38 utx
->ut_pid
= li
->pid
;
40 - /* strncpy(): Don't necessarily want null termination */
41 - strncpy(utx
->ut_user
, li
->username
,
42 - MIN_SIZEOF(utx
->ut_user
, li
->username
));
44 if (li
->type
== LTYPE_LOGOUT
)
47 @@
-771,6 +767,8 @@
construct_utmpx(struct logininfo
*li
, st
51 + /* strncpy(): Don't necessarily want null termination */
52 + strncpy(utx
->ut_name
, li
->username
, MIN_SIZEOF(utx
->ut_name
, li
->username
));
53 # ifdef HAVE_HOST_IN_UTMPX
54 strncpy(utx
->ut_host
, li
->hostname
,
55 MIN_SIZEOF(utx
->ut_host
, li
->hostname
));
56 @@
-1406,7 +1404,7 @@
wtmpx_get_entry(struct logininfo
*li
)
57 ** Low
-level libutil
login() functions
61 +#if defined(USE_LOGIN) && defined(HAVE_UTMP_H)
63 syslogin_perform_login(struct logininfo
*li
)