Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 71080e7900 | |||
| 7e396ba47f | |||
| 128fe1197c | |||
| 2da400de13 | |||
| 561cbbe880 | |||
| 261f40423a | |||
| 02a9d041a3 | |||
| bec925d29d | |||
| 2128715ede | |||
| fee5e61d05 | |||
| 9d5591fba9 | |||
| bed23cc34d | |||
| c4eae35466 | |||
| d6a9b72603 | |||
| cc2970c3a1 | |||
| dbdda2a48a | |||
| 541d4dde23 | |||
| 55f9635ecf | |||
| 25fd8eb404 | |||
| 24605a1b62 | |||
| 9f3d42b14d | |||
| f0f7fc60f2 | |||
| bc0151d4d3 | |||
| 4b775cbff9 | |||
| bc2cc1106d | |||
| f630203ed8 | |||
| 7540b05197 | |||
| eae0b02796 | |||
| 1c6a1206bd | |||
| 22656c36a2 | |||
| 11071522a2 | |||
| 909036d714 | |||
| de50b39475 | |||
| b5c99ec30e | |||
| 58b96645c9 | |||
| 817f3283d1 | |||
| 0e0bcacf3c | |||
| 0004cc46dd | |||
| 1c330177f0 |
+1
-1
@@ -47,5 +47,5 @@ Makefile.in
|
|||||||
|
|
||||||
/shadow.spec
|
/shadow.spec
|
||||||
/shadow-*.tar.*
|
/shadow-*.tar.*
|
||||||
/libmisc/getdate.c
|
/lib/getdate.c
|
||||||
/libsubid/subid.h
|
/libsubid/subid.h
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
EXTRA_DIST = NEWS README TODO shadow.spec.in
|
EXTRA_DIST = NEWS README TODO shadow.spec.in
|
||||||
|
|
||||||
SUBDIRS = libmisc lib
|
SUBDIRS = lib
|
||||||
|
|
||||||
if ENABLE_SUBIDS
|
if ENABLE_SUBIDS
|
||||||
SUBDIRS += libsubid
|
SUBDIRS += libsubid
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
|
|
||||||
Check when RLOGIN is enabled if ruserok() exists
|
Check when RLOGIN is enabled if ruserok() exists
|
||||||
|
|
||||||
Move selinux_file_context out of libmisc/copydir.c
|
Move selinux_file_context out of lib/copydir.c
|
||||||
|
|
||||||
Review hardcoded root account?
|
Review hardcoded root account?
|
||||||
|
|
||||||
review all call to strto
|
review all call to strto
|
||||||
|
|
||||||
libmisc/cleanup_user.c
|
lib/cleanup_user.c
|
||||||
cleanup needed (cleanup_report_add_user* not used)
|
cleanup needed (cleanup_report_add_user* not used)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+10
-14
@@ -4,7 +4,7 @@ m4_define([libsubid_abi_major], 4)
|
|||||||
m4_define([libsubid_abi_minor], 0)
|
m4_define([libsubid_abi_minor], 0)
|
||||||
m4_define([libsubid_abi_micro], 0)
|
m4_define([libsubid_abi_micro], 0)
|
||||||
m4_define([libsubid_abi], [libsubid_abi_major.libsubid_abi_minor.libsubid_abi_micro])
|
m4_define([libsubid_abi], [libsubid_abi_major.libsubid_abi_minor.libsubid_abi_micro])
|
||||||
AC_INIT([shadow], [4.14.0], [pkg-shadow-devel@lists.alioth.debian.org], [],
|
AC_INIT([shadow], [4.14.6], [pkg-shadow-devel@lists.alioth.debian.org], [],
|
||||||
[https://github.com/shadow-maint/shadow])
|
[https://github.com/shadow-maint/shadow])
|
||||||
AM_INIT_AUTOMAKE([1.11 foreign dist-xz])
|
AM_INIT_AUTOMAKE([1.11 foreign dist-xz])
|
||||||
AC_CONFIG_MACRO_DIRS([m4])
|
AC_CONFIG_MACRO_DIRS([m4])
|
||||||
@@ -32,6 +32,7 @@ AC_PROG_CC
|
|||||||
AC_PROG_LN_S
|
AC_PROG_LN_S
|
||||||
AC_PROG_YACC
|
AC_PROG_YACC
|
||||||
LT_INIT
|
LT_INIT
|
||||||
|
LT_LIB_DLLOAD
|
||||||
|
|
||||||
dnl Checks for libraries.
|
dnl Checks for libraries.
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
|
|||||||
AC_CHECK_FUNCS(arc4random_buf futimes \
|
AC_CHECK_FUNCS(arc4random_buf futimes \
|
||||||
getentropy getrandom getspnam getusershell \
|
getentropy getrandom getspnam getusershell \
|
||||||
initgroups lckpwdf lutimes mempcpy \
|
initgroups lckpwdf lutimes mempcpy \
|
||||||
setgroups updwtmp updwtmpx innetgr \
|
setgroups updwtmpx innetgr \
|
||||||
getspnam_r \
|
getspnam_r \
|
||||||
rpmatch \
|
rpmatch \
|
||||||
memset_explicit explicit_bzero stpecpy stpeprintf)
|
memset_explicit explicit_bzero stpecpy stpeprintf)
|
||||||
@@ -56,17 +57,13 @@ AC_SYS_LARGEFILE
|
|||||||
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
|
|
||||||
AC_CHECK_MEMBERS([struct utmp.ut_type,
|
AC_CHECK_MEMBERS([struct utmpx.ut_name,
|
||||||
struct utmp.ut_id,
|
struct utmpx.ut_host,
|
||||||
struct utmp.ut_name,
|
struct utmpx.ut_syslen,
|
||||||
struct utmp.ut_user,
|
struct utmpx.ut_addr,
|
||||||
struct utmp.ut_host,
|
struct utmpx.ut_addr_v6,
|
||||||
struct utmp.ut_syslen,
|
struct utmpx.ut_time,
|
||||||
struct utmp.ut_addr,
|
struct utmpx.ut_xtime],,,[[#include <utmpx.h>]])
|
||||||
struct utmp.ut_addr_v6,
|
|
||||||
struct utmp.ut_time,
|
|
||||||
struct utmp.ut_xtime,
|
|
||||||
struct utmp.ut_tv],,,[[#include <utmp.h>]])
|
|
||||||
|
|
||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
AC_TYPE_GETGROUPS
|
AC_TYPE_GETGROUPS
|
||||||
@@ -753,7 +750,6 @@ AC_CONFIG_FILES([
|
|||||||
man/uk/Makefile
|
man/uk/Makefile
|
||||||
man/zh_CN/Makefile
|
man/zh_CN/Makefile
|
||||||
man/zh_TW/Makefile
|
man/zh_TW/Makefile
|
||||||
libmisc/Makefile
|
|
||||||
lib/Makefile
|
lib/Makefile
|
||||||
libsubid/Makefile
|
libsubid/Makefile
|
||||||
libsubid/subid.h
|
libsubid/subid.h
|
||||||
|
|||||||
@@ -2,20 +2,20 @@
|
|||||||
# and also cooperate to make a distribution for `make dist'
|
# and also cooperate to make a distribution for `make dist'
|
||||||
|
|
||||||
pamd_files = \
|
pamd_files = \
|
||||||
|
chpasswd \
|
||||||
chfn \
|
chfn \
|
||||||
chsh \
|
chsh \
|
||||||
groupmems \
|
groupmems \
|
||||||
login \
|
login \
|
||||||
|
newusers \
|
||||||
passwd
|
passwd
|
||||||
|
|
||||||
pamd_acct_tools_files = \
|
pamd_acct_tools_files = \
|
||||||
chage \
|
chage \
|
||||||
chgpasswd \
|
chgpasswd \
|
||||||
chpasswd \
|
|
||||||
groupadd \
|
groupadd \
|
||||||
groupdel \
|
groupdel \
|
||||||
groupmod \
|
groupmod \
|
||||||
newusers \
|
|
||||||
useradd \
|
useradd \
|
||||||
userdel \
|
userdel \
|
||||||
usermod
|
usermod
|
||||||
|
|||||||
+123
-13
@@ -5,58 +5,118 @@ DEFS =
|
|||||||
|
|
||||||
noinst_LTLIBRARIES = libshadow.la
|
noinst_LTLIBRARIES = libshadow.la
|
||||||
|
|
||||||
|
if USE_PAM
|
||||||
|
LIBCRYPT_PAM = $(LIBCRYPT)
|
||||||
|
else
|
||||||
|
LIBCRYPT_PAM =
|
||||||
|
endif
|
||||||
|
|
||||||
|
AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir) $(ECONF_CPPFLAGS)
|
||||||
|
|
||||||
libshadow_la_CPPFLAGS = $(ECONF_CPPFLAGS)
|
libshadow_la_CPPFLAGS = $(ECONF_CPPFLAGS)
|
||||||
if HAVE_VENDORDIR
|
if HAVE_VENDORDIR
|
||||||
libshadow_la_CPPFLAGS += -DVENDORDIR=\"$(VENDORDIR)\"
|
libshadow_la_CPPFLAGS += -DVENDORDIR=\"$(VENDORDIR)\"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libshadow_la_CPPFLAGS += -I$(top_srcdir)
|
libshadow_la_CPPFLAGS += -I$(top_srcdir)
|
||||||
libshadow_la_CFLAGS = $(LIBBSD_CFLAGS)
|
libshadow_la_CFLAGS = $(LIBBSD_CFLAGS) $(LIBCRYPT_PAM) $(LIBSYSTEMD)
|
||||||
|
libshadow_la_LIBADD = $(LIBADD_DLOPEN)
|
||||||
|
|
||||||
libshadow_la_SOURCES = \
|
libshadow_la_SOURCES = \
|
||||||
|
addgrps.c \
|
||||||
|
age.c \
|
||||||
|
agetpass.c \
|
||||||
|
alloc.c \
|
||||||
|
alloc.h \
|
||||||
|
audit_help.c \
|
||||||
|
basename.c \
|
||||||
|
bit.c \
|
||||||
|
bit.h \
|
||||||
|
chkname.c \
|
||||||
|
chkname.h \
|
||||||
|
chowndir.c \
|
||||||
|
chowntty.c \
|
||||||
|
cleanup.c \
|
||||||
|
cleanup_group.c \
|
||||||
|
cleanup_user.c \
|
||||||
commonio.c \
|
commonio.c \
|
||||||
commonio.h \
|
commonio.h \
|
||||||
|
console.c \
|
||||||
|
copydir.c \
|
||||||
|
csrand.c \
|
||||||
|
date_to_str.c \
|
||||||
defines.h \
|
defines.h \
|
||||||
encrypt.c \
|
encrypt.c \
|
||||||
|
entry.c \
|
||||||
|
env.c \
|
||||||
exitcodes.h \
|
exitcodes.h \
|
||||||
faillog.h \
|
faillog.h \
|
||||||
|
failure.c \
|
||||||
|
failure.h \
|
||||||
fields.c \
|
fields.c \
|
||||||
|
find_new_gid.c \
|
||||||
|
find_new_uid.c \
|
||||||
|
find_new_sub_gids.c \
|
||||||
|
find_new_sub_uids.c \
|
||||||
fputsx.c \
|
fputsx.c \
|
||||||
getdef.c \
|
|
||||||
getdef.h \
|
|
||||||
get_gid.c \
|
get_gid.c \
|
||||||
getlong.c \
|
|
||||||
get_pid.c \
|
get_pid.c \
|
||||||
get_uid.c \
|
get_uid.c \
|
||||||
|
getdate.h \
|
||||||
|
getdate.y \
|
||||||
|
getdef.c \
|
||||||
|
getdef.h \
|
||||||
|
getlong.c \
|
||||||
|
getgr_nam_gid.c \
|
||||||
|
getrange.c \
|
||||||
|
gettime.c \
|
||||||
getulong.c \
|
getulong.c \
|
||||||
groupio.c \
|
groupio.c \
|
||||||
groupmem.c \
|
groupmem.c \
|
||||||
groupio.h \
|
groupio.h \
|
||||||
gshadow.c \
|
gshadow.c \
|
||||||
|
hushed.c \
|
||||||
|
idmapping.h \
|
||||||
|
idmapping.c \
|
||||||
|
isexpired.c \
|
||||||
|
limits.c \
|
||||||
|
list.c \
|
||||||
lockpw.c \
|
lockpw.c \
|
||||||
|
loginprompt.c \
|
||||||
|
mail.c \
|
||||||
|
mempcpy.c \
|
||||||
|
mempcpy.h \
|
||||||
|
motd.c \
|
||||||
|
myname.c \
|
||||||
nss.c \
|
nss.c \
|
||||||
nscd.c \
|
nscd.c \
|
||||||
nscd.h \
|
nscd.h \
|
||||||
shadowlog.c \
|
obscure.c \
|
||||||
shadowlog.h \
|
|
||||||
shadowlog_internal.h \
|
|
||||||
sssd.c \
|
|
||||||
sssd.h \
|
|
||||||
pam_defs.h \
|
pam_defs.h \
|
||||||
|
pam_pass.c \
|
||||||
|
pam_pass_non_interactive.c \
|
||||||
port.c \
|
port.c \
|
||||||
port.h \
|
port.h \
|
||||||
|
prefix_flag.c \
|
||||||
prototypes.h \
|
prototypes.h \
|
||||||
pwauth.c \
|
pwauth.c \
|
||||||
pwauth.h \
|
pwauth.h \
|
||||||
pwio.c \
|
pwio.c \
|
||||||
pwio.h \
|
pwio.h \
|
||||||
|
pwd_init.c \
|
||||||
|
pwd2spwd.c \
|
||||||
|
pwdcheck.c \
|
||||||
pwmem.c \
|
pwmem.c \
|
||||||
|
remove_tree.c \
|
||||||
|
rlogin.c \
|
||||||
|
root_flag.c \
|
||||||
run_part.h \
|
run_part.h \
|
||||||
run_part.c \
|
run_part.c \
|
||||||
subordinateio.h \
|
salt.c \
|
||||||
subordinateio.c \
|
|
||||||
selinux.c \
|
selinux.c \
|
||||||
semanage.c \
|
semanage.c \
|
||||||
|
setugid.c \
|
||||||
|
setupenv.c \
|
||||||
sgetgrent.c \
|
sgetgrent.c \
|
||||||
sgetpwent.c \
|
sgetpwent.c \
|
||||||
sgetspent.c \
|
sgetspent.c \
|
||||||
@@ -65,14 +125,63 @@ libshadow_la_SOURCES = \
|
|||||||
shadow.c \
|
shadow.c \
|
||||||
shadowio.c \
|
shadowio.c \
|
||||||
shadowio.h \
|
shadowio.h \
|
||||||
|
shadowlog.c \
|
||||||
|
shadowlog.h \
|
||||||
|
shadowlog_internal.h \
|
||||||
shadowmem.c \
|
shadowmem.c \
|
||||||
|
shell.c \
|
||||||
spawn.c \
|
spawn.c \
|
||||||
write_full.c
|
sssd.c \
|
||||||
|
sssd.h \
|
||||||
|
stpecpy.c \
|
||||||
|
stpecpy.h \
|
||||||
|
stpeprintf.c \
|
||||||
|
stpeprintf.h \
|
||||||
|
strtoday.c \
|
||||||
|
sub.c \
|
||||||
|
subordinateio.h \
|
||||||
|
subordinateio.c \
|
||||||
|
sulog.c \
|
||||||
|
ttytype.c \
|
||||||
|
tz.c \
|
||||||
|
ulimit.c \
|
||||||
|
user_busy.c \
|
||||||
|
valid.c \
|
||||||
|
write_full.c \
|
||||||
|
xgetpwnam.c \
|
||||||
|
xprefix_getpwnam.c \
|
||||||
|
xgetpwuid.c \
|
||||||
|
xgetgrnam.c \
|
||||||
|
xgetgrgid.c \
|
||||||
|
xgetspnam.c \
|
||||||
|
yesno.c
|
||||||
|
|
||||||
if WITH_TCB
|
if WITH_TCB
|
||||||
libshadow_la_SOURCES += tcbfuncs.c tcbfuncs.h
|
libshadow_la_SOURCES += tcbfuncs.c tcbfuncs.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if WITH_BTRFS
|
||||||
|
libshadow_la_SOURCES += btrfs.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ENABLE_LASTLOG
|
||||||
|
libshadow_la_SOURCES += log.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ENABLE_LOGIND
|
||||||
|
libshadow_la_SOURCES += logind.c
|
||||||
|
else
|
||||||
|
libshadow_la_SOURCES += utmp.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !WITH_LIBBSD
|
||||||
|
libshadow_la_SOURCES += \
|
||||||
|
freezero.h \
|
||||||
|
freezero.c \
|
||||||
|
readpassphrase.h \
|
||||||
|
readpassphrase.c
|
||||||
|
endif
|
||||||
|
|
||||||
# These files are unneeded for some reason, listed in
|
# These files are unneeded for some reason, listed in
|
||||||
# order of appearance:
|
# order of appearance:
|
||||||
#
|
#
|
||||||
@@ -80,4 +189,5 @@ endif
|
|||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
.indent.pro \
|
.indent.pro \
|
||||||
gshadow_.h
|
gshadow_.h \
|
||||||
|
xgetXXbyYY.c
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ int expire (const struct passwd *pw, /*@null@*/const struct spwd *sp)
|
|||||||
|
|
||||||
void agecheck (/*@null@*/const struct spwd *sp)
|
void agecheck (/*@null@*/const struct spwd *sp)
|
||||||
{
|
{
|
||||||
long now = time(NULL) / SCALE;
|
long now = time(NULL) / DAY;
|
||||||
long remain;
|
long remain;
|
||||||
|
|
||||||
if (NULL == sp) {
|
if (NULL == sp) {
|
||||||
@@ -164,7 +164,6 @@ void agecheck (/*@null@*/const struct spwd *sp)
|
|||||||
|
|
||||||
remain = sp->sp_lstchg + sp->sp_max - now;
|
remain = sp->sp_lstchg + sp->sp_max - now;
|
||||||
if (remain <= sp->sp_warn) {
|
if (remain <= sp->sp_warn) {
|
||||||
remain /= DAY / SCALE;
|
|
||||||
if (remain > 1) {
|
if (remain > 1) {
|
||||||
(void) printf (_("Your password will expire in %ld days.\n"),
|
(void) printf (_("Your password will expire in %ld days.\n"),
|
||||||
remain);
|
remain);
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <readpassphrase.h>
|
#include <readpassphrase.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -23,11 +22,6 @@
|
|||||||
#endif /* WITH_LIBBSD */
|
#endif /* WITH_LIBBSD */
|
||||||
|
|
||||||
|
|
||||||
#if !defined(PASS_MAX)
|
|
||||||
#define PASS_MAX BUFSIZ - 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SYNOPSIS
|
* SYNOPSIS
|
||||||
* [[gnu::malloc(erase_pass)]]
|
* [[gnu::malloc(erase_pass)]]
|
||||||
@@ -39,7 +39,7 @@ static int run_btrfs_subvolume_cmd(const char *subcmd, const char *arg1, const c
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
if (access(cmd, X_OK)) {
|
if (!cmd || access(cmd, X_OK)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,12 +74,14 @@ static bool is_valid_name (const char *name)
|
|||||||
|
|
||||||
bool is_valid_user_name (const char *name)
|
bool is_valid_user_name (const char *name)
|
||||||
{
|
{
|
||||||
|
size_t maxlen;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* User names length are limited by the kernel
|
* User names length are limited by the kernel
|
||||||
*/
|
*/
|
||||||
if (strlen (name) > sysconf(_SC_LOGIN_NAME_MAX)) {
|
maxlen = sysconf(_SC_LOGIN_NAME_MAX);
|
||||||
|
if (strlen(name) >= maxlen)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
return is_valid_name (name);
|
return is_valid_name (name);
|
||||||
}
|
}
|
||||||
+11
-7
@@ -25,6 +25,7 @@
|
|||||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -153,7 +154,6 @@ static inline void memzero(void *ptr, size_t size)
|
|||||||
*
|
*
|
||||||
* DAY - seconds / day
|
* DAY - seconds / day
|
||||||
* WEEK - seconds / week
|
* WEEK - seconds / week
|
||||||
* SCALE - seconds / aging unit
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Solaris defines this in shadow.h */
|
/* Solaris defines this in shadow.h */
|
||||||
@@ -163,12 +163,6 @@ static inline void memzero(void *ptr, size_t size)
|
|||||||
|
|
||||||
#define WEEK (7*DAY)
|
#define WEEK (7*DAY)
|
||||||
|
|
||||||
#ifdef ITI_AGING
|
|
||||||
#define SCALE 1
|
|
||||||
#else
|
|
||||||
#define SCALE DAY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define WIDTHOF(x) (sizeof(x) * CHAR_BIT)
|
#define WIDTHOF(x) (sizeof(x) * CHAR_BIT)
|
||||||
#define NITEMS(arr) (sizeof((arr)) / sizeof((arr)[0]))
|
#define NITEMS(arr) (sizeof((arr)) / sizeof((arr)[0]))
|
||||||
#define STRLEN(s) (NITEMS(s) - 1)
|
#define STRLEN(s) (NITEMS(s) - 1)
|
||||||
@@ -247,4 +241,14 @@ static inline void memzero(void *ptr, size_t size)
|
|||||||
# define shadow_getenv(name) getenv(name)
|
# define shadow_getenv(name) getenv(name)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Maximum password length
|
||||||
|
*
|
||||||
|
* Consider that there is also limit in PAM (PAM_MAX_RESP_SIZE)
|
||||||
|
* currently set to 512.
|
||||||
|
*/
|
||||||
|
#if !defined(PASS_MAX)
|
||||||
|
#define PASS_MAX BUFSIZ - 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _DEFINES_H_ */
|
#endif /* _DEFINES_H_ */
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ relunit : tUNUMBER tYEAR_UNIT {
|
|||||||
yyRelYear += $1 * $2;
|
yyRelYear += $1 * $2;
|
||||||
}
|
}
|
||||||
| tYEAR_UNIT {
|
| tYEAR_UNIT {
|
||||||
yyRelYear++;
|
yyRelYear += $1;
|
||||||
}
|
}
|
||||||
| tUNUMBER tMONTH_UNIT {
|
| tUNUMBER tMONTH_UNIT {
|
||||||
yyRelMonth += $1 * $2;
|
yyRelMonth += $1 * $2;
|
||||||
@@ -327,7 +327,7 @@ relunit : tUNUMBER tYEAR_UNIT {
|
|||||||
yyRelMonth += $1 * $2;
|
yyRelMonth += $1 * $2;
|
||||||
}
|
}
|
||||||
| tMONTH_UNIT {
|
| tMONTH_UNIT {
|
||||||
yyRelMonth++;
|
yyRelMonth += $1;
|
||||||
}
|
}
|
||||||
| tUNUMBER tDAY_UNIT {
|
| tUNUMBER tDAY_UNIT {
|
||||||
yyRelDay += $1 * $2;
|
yyRelDay += $1 * $2;
|
||||||
@@ -336,7 +336,7 @@ relunit : tUNUMBER tYEAR_UNIT {
|
|||||||
yyRelDay += $1 * $2;
|
yyRelDay += $1 * $2;
|
||||||
}
|
}
|
||||||
| tDAY_UNIT {
|
| tDAY_UNIT {
|
||||||
yyRelDay++;
|
yyRelDay += $1;
|
||||||
}
|
}
|
||||||
| tUNUMBER tHOUR_UNIT {
|
| tUNUMBER tHOUR_UNIT {
|
||||||
yyRelHour += $1 * $2;
|
yyRelHour += $1 * $2;
|
||||||
@@ -345,7 +345,7 @@ relunit : tUNUMBER tYEAR_UNIT {
|
|||||||
yyRelHour += $1 * $2;
|
yyRelHour += $1 * $2;
|
||||||
}
|
}
|
||||||
| tHOUR_UNIT {
|
| tHOUR_UNIT {
|
||||||
yyRelHour++;
|
yyRelHour += $1;
|
||||||
}
|
}
|
||||||
| tUNUMBER tMINUTE_UNIT {
|
| tUNUMBER tMINUTE_UNIT {
|
||||||
yyRelMinutes += $1 * $2;
|
yyRelMinutes += $1 * $2;
|
||||||
@@ -354,7 +354,7 @@ relunit : tUNUMBER tYEAR_UNIT {
|
|||||||
yyRelMinutes += $1 * $2;
|
yyRelMinutes += $1 * $2;
|
||||||
}
|
}
|
||||||
| tMINUTE_UNIT {
|
| tMINUTE_UNIT {
|
||||||
yyRelMinutes++;
|
yyRelMinutes += $1;
|
||||||
}
|
}
|
||||||
| tUNUMBER tSEC_UNIT {
|
| tUNUMBER tSEC_UNIT {
|
||||||
yyRelSeconds += $1 * $2;
|
yyRelSeconds += $1 * $2;
|
||||||
@@ -363,7 +363,7 @@ relunit : tUNUMBER tYEAR_UNIT {
|
|||||||
yyRelSeconds += $1 * $2;
|
yyRelSeconds += $1 * $2;
|
||||||
}
|
}
|
||||||
| tSEC_UNIT {
|
| tSEC_UNIT {
|
||||||
yyRelSeconds++;
|
yyRelSeconds += $1;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ int isexpired (const struct passwd *pw, /*@null@*/const struct spwd *sp)
|
|||||||
{
|
{
|
||||||
long now;
|
long now;
|
||||||
|
|
||||||
now = time(NULL) / SCALE;
|
now = time(NULL) / DAY;
|
||||||
|
|
||||||
if (NULL == sp) {
|
if (NULL == sp) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -84,7 +84,7 @@ int isexpired (const struct passwd *pw, /*@null@*/const struct spwd *sp)
|
|||||||
|
|
||||||
if ( (-1 == sp->sp_lstchg)
|
if ( (-1 == sp->sp_lstchg)
|
||||||
|| (-1 == sp->sp_max)
|
|| (-1 == sp->sp_max)
|
||||||
|| (sp->sp_max >= ((10000L * DAY) / SCALE))) {
|
|| (sp->sp_max >= 10000)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
*
|
*
|
||||||
* A "last login" entry is created for the user being logged in. The
|
* A "last login" entry is created for the user being logged in. The
|
||||||
* UID is extracted from the global (struct passwd) entry and the
|
* UID is extracted from the global (struct passwd) entry and the
|
||||||
* TTY information is gotten from the (struct utmp).
|
* TTY information is gotten from the (struct utmpx).
|
||||||
*/
|
*/
|
||||||
void dolastlog (
|
void dolastlog (
|
||||||
struct lastlog *ll,
|
struct lastlog *ll,
|
||||||
@@ -35,7 +35,7 @@ done:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long active_sessions_count(const char *name, unsigned long unused)
|
unsigned long active_sessions_count(const char *name, unsigned long unused(limit))
|
||||||
{
|
{
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
unsigned long count = 0;
|
unsigned long count = 0;
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
/*
|
/*
|
||||||
* prototypes.h
|
* prototypes.h
|
||||||
*
|
*
|
||||||
* prototypes of libmisc functions, and private lib functions.
|
* prototypes of some lib functions, and private lib functions.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ struct spwd *pwd_to_spwd (const struct passwd *pw)
|
|||||||
* Defaults used if there is no pw_age information.
|
* Defaults used if there is no pw_age information.
|
||||||
*/
|
*/
|
||||||
sp.sp_min = 0;
|
sp.sp_min = 0;
|
||||||
sp.sp_max = (10000L * DAY) / SCALE;
|
sp.sp_max = 10000;
|
||||||
sp.sp_lstchg = gettime () / SCALE;
|
sp.sp_lstchg = gettime () / DAY;
|
||||||
if (0 == sp.sp_lstchg) {
|
if (0 == sp.sp_lstchg) {
|
||||||
/* Better disable aging than requiring a password
|
/* Better disable aging than requiring a password
|
||||||
* change */
|
* change */
|
||||||
@@ -36,8 +36,12 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
char * readpassphrase(const char *, char *, size_t, int);
|
char * readpassphrase(const char *, char *, size_t, int);
|
||||||
__END_DECLS
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* !LIBBSD_READPASSPHRASE_H */
|
#endif /* !LIBBSD_READPASSPHRASE_H */
|
||||||
+5
-3
@@ -37,8 +37,8 @@
|
|||||||
static char **list (char *s)
|
static char **list (char *s)
|
||||||
{
|
{
|
||||||
static char **members = NULL;
|
static char **members = NULL;
|
||||||
static int size = 0; /* max members + 1 */
|
static size_t size = 0; /* max members + 1 */
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@@ -47,8 +47,10 @@ static char **list (char *s)
|
|||||||
if (i >= size) {
|
if (i >= size) {
|
||||||
size = i + 100; /* at least: i + 1 */
|
size = i + 100; /* at least: i + 1 */
|
||||||
members = REALLOCF(members, size, char *);
|
members = REALLOCF(members, size, char *);
|
||||||
if (!members)
|
if (!members) {
|
||||||
|
size = 0;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!s || s[0] == '\0')
|
if (!s || s[0] == '\0')
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -68,10 +68,9 @@ long strtoday (const char *str)
|
|||||||
return retdate;
|
return retdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
t = get_date (str, NULL);
|
t = get_date(str, NULL);
|
||||||
if ((time_t) - 1 == t) {
|
if ((time_t) - 1 == t) {
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
/* convert seconds to days since 1970-01-01 */
|
return t / DAY;
|
||||||
return (t + DAY / 2) / DAY;
|
|
||||||
}
|
}
|
||||||
@@ -49,13 +49,15 @@ int user_busy (const char *name, uid_t uid)
|
|||||||
#endif /* !__linux__ */
|
#endif /* !__linux__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __linux__
|
|
||||||
static int user_busy_utmp (const char *name)
|
|
||||||
{
|
|
||||||
struct utmp *utent;
|
|
||||||
|
|
||||||
setutent ();
|
#ifndef __linux__
|
||||||
while ((utent = getutent ()) != NULL)
|
static int
|
||||||
|
user_busy_utmp(const char *name)
|
||||||
|
{
|
||||||
|
struct utmpx *utent;
|
||||||
|
|
||||||
|
setutxent();
|
||||||
|
while ((utent = getutxent()) != NULL)
|
||||||
{
|
{
|
||||||
if (utent->ut_type != USER_PROCESS) {
|
if (utent->ut_type != USER_PROCESS) {
|
||||||
continue;
|
continue;
|
||||||
@@ -77,6 +79,7 @@ static int user_busy_utmp (const char *name)
|
|||||||
}
|
}
|
||||||
#endif /* !__linux__ */
|
#endif /* !__linux__ */
|
||||||
|
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#ifdef ENABLE_SUBIDS
|
#ifdef ENABLE_SUBIDS
|
||||||
#define in_parentuid_range(uid) ((uid) >= parentuid && (uid) < parentuid + range)
|
#define in_parentuid_range(uid) ((uid) >= parentuid && (uid) < parentuid + range)
|
||||||
+94
-96
@@ -13,7 +13,7 @@
|
|||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "getdef.h"
|
#include "getdef.h"
|
||||||
|
|
||||||
#include <utmp.h>
|
#include <utmpx.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -27,19 +27,23 @@
|
|||||||
#ident "$Id$"
|
#ident "$Id$"
|
||||||
|
|
||||||
|
|
||||||
|
#define UTX_LINESIZE NITEMS((struct utmpx){}.ut_line)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* is_my_tty -- determine if "tty" is the same TTY stdin is using
|
* is_my_tty -- determine if "tty" is the same TTY stdin is using
|
||||||
*/
|
*/
|
||||||
static bool is_my_tty (const char tty[UT_LINESIZE])
|
static bool
|
||||||
|
is_my_tty(const char tty[UTX_LINESIZE])
|
||||||
{
|
{
|
||||||
char full_tty[STRLEN("/dev/") + UT_LINESIZE + 1];
|
char full_tty[STRLEN("/dev/") + UTX_LINESIZE + 1];
|
||||||
/* tmptty shall be bigger than full_tty */
|
/* tmptty shall be bigger than full_tty */
|
||||||
static char tmptty[sizeof(full_tty) + 1];
|
static char tmptty[sizeof(full_tty) + 1];
|
||||||
|
|
||||||
full_tty[0] = '\0';
|
full_tty[0] = '\0';
|
||||||
if (tty[0] != '/')
|
if (tty[0] != '/')
|
||||||
strcpy (full_tty, "/dev/");
|
strcpy (full_tty, "/dev/");
|
||||||
strncat (full_tty, tty, UT_LINESIZE);
|
strncat(full_tty, tty, UTX_LINESIZE);
|
||||||
|
|
||||||
if ('\0' == tmptty[0]) {
|
if ('\0' == tmptty[0]) {
|
||||||
const char *tname = ttyname (STDIN_FILENO);
|
const char *tname = ttyname (STDIN_FILENO);
|
||||||
@@ -55,13 +59,15 @@ static bool is_my_tty (const char tty[UT_LINESIZE])
|
|||||||
return strcmp (full_tty, tmptty) == 0;
|
return strcmp (full_tty, tmptty) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* failtmp - update the cumulative failure log
|
* failtmp - update the cumulative failure log
|
||||||
*
|
*
|
||||||
* failtmp updates the (struct utmp) formatted failure log which
|
* failtmp updates the (struct utmpx) formatted failure log which
|
||||||
* maintains a record of all login failures.
|
* maintains a record of all login failures.
|
||||||
*/
|
*/
|
||||||
static void failtmp (const char *username, const struct utmp *failent)
|
static void
|
||||||
|
failtmp(const char *username, const struct utmpx *failent)
|
||||||
{
|
{
|
||||||
const char *ftmp;
|
const char *ftmp;
|
||||||
int fd;
|
int fd;
|
||||||
@@ -106,6 +112,7 @@ static void failtmp (const char *username, const struct utmp *failent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get_current_utmp - return the most probable utmp entry for the current
|
* get_current_utmp - return the most probable utmp entry for the current
|
||||||
* session
|
* session
|
||||||
@@ -114,56 +121,55 @@ static void failtmp (const char *username, const struct utmp *failent)
|
|||||||
* The line entered by the *getty / telnetd, etc. should also match
|
* The line entered by the *getty / telnetd, etc. should also match
|
||||||
* the current terminal.
|
* the current terminal.
|
||||||
*
|
*
|
||||||
* When an entry is returned by get_current_utmp, and if the utmp
|
* When an entry is returned by get_current_utmp, and if the utmpx
|
||||||
* structure has a ut_id field, this field should be used to update
|
* structure has a ut_id field, this field should be used to update
|
||||||
* the entry information.
|
* the entry information.
|
||||||
*
|
*
|
||||||
* Return NULL if no entries exist in utmp for the current process.
|
* Return NULL if no entries exist in utmp for the current process.
|
||||||
*/
|
*/
|
||||||
static
|
static /*@null@*/ /*@only@*/struct utmpx *
|
||||||
/*@null@*/ /*@only@*/struct utmp *get_current_utmp (void)
|
get_current_utmp(void)
|
||||||
{
|
{
|
||||||
struct utmp *ut;
|
struct utmpx *ut;
|
||||||
struct utmp *ret = NULL;
|
struct utmpx *ret = NULL;
|
||||||
|
|
||||||
setutent ();
|
setutxent();
|
||||||
|
|
||||||
/* First, try to find a valid utmp entry for this process. */
|
/* First, try to find a valid utmp entry for this process. */
|
||||||
while ((ut = getutent ()) != NULL) {
|
while ((ut = getutxent()) != NULL) {
|
||||||
if ( (ut->ut_pid == getpid ())
|
if ( (ut->ut_pid == getpid ())
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_ID
|
|
||||||
&& ('\0' != ut->ut_id[0])
|
&& ('\0' != ut->ut_id[0])
|
||||||
#endif
|
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_TYPE
|
|
||||||
&& ( (LOGIN_PROCESS == ut->ut_type)
|
&& ( (LOGIN_PROCESS == ut->ut_type)
|
||||||
|| (USER_PROCESS == ut->ut_type))
|
|| (USER_PROCESS == ut->ut_type))
|
||||||
#endif
|
|
||||||
/* A process may have failed to close an entry
|
/* A process may have failed to close an entry
|
||||||
* Check if this entry refers to the current tty */
|
* Check if this entry refers to the current tty */
|
||||||
&& is_my_tty (ut->ut_line)) {
|
&& is_my_tty(ut->ut_line))
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != ut) {
|
if (NULL != ut) {
|
||||||
ret = XMALLOC(1, struct utmp);
|
ret = XMALLOC(1, struct utmpx);
|
||||||
memcpy (ret, ut, sizeof (*ret));
|
memcpy (ret, ut, sizeof (*ret));
|
||||||
}
|
}
|
||||||
|
|
||||||
endutent ();
|
endutxent();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_session_host (char **out)
|
|
||||||
|
int
|
||||||
|
get_session_host(char **out)
|
||||||
{
|
{
|
||||||
char *hostname = NULL;
|
int ret = 0;
|
||||||
struct utmp *ut = NULL;
|
char *hostname;
|
||||||
int ret = 0;
|
struct utmpx *ut;
|
||||||
|
|
||||||
ut = get_current_utmp();
|
ut = get_current_utmp();
|
||||||
|
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_HOST
|
#if defined(HAVE_STRUCT_UTMPX_UT_HOST)
|
||||||
if ((ut != NULL) && (ut->ut_host[0] != '\0')) {
|
if ((ut != NULL) && (ut->ut_host[0] != '\0')) {
|
||||||
hostname = XMALLOC(sizeof(ut->ut_host) + 1, char);
|
hostname = XMALLOC(sizeof(ut->ut_host) + 1, char);
|
||||||
strncpy (hostname, ut->ut_host, sizeof (ut->ut_host));
|
strncpy (hostname, ut->ut_host, sizeof (ut->ut_host));
|
||||||
@@ -177,18 +183,19 @@ int get_session_host (char **out)
|
|||||||
#else
|
#else
|
||||||
*out = NULL;
|
*out = NULL;
|
||||||
ret = -2;
|
ret = -2;
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_HOST */
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USE_PAM
|
|
||||||
|
#if !defined(USE_PAM) && !defined(HAVE_UPDWTMPX)
|
||||||
/*
|
/*
|
||||||
* Some systems already have updwtmp() and possibly updwtmpx(). Others
|
* Some systems already have updwtmpx(). Others
|
||||||
* don't, so we re-implement these functions if necessary.
|
* don't, so we re-implement these functions if necessary.
|
||||||
*/
|
*/
|
||||||
#ifndef HAVE_UPDWTMP
|
static void
|
||||||
static void updwtmp (const char *filename, const struct utmp *ut)
|
updwtmpx(const char *filename, const struct utmpx *ut)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
@@ -198,9 +205,7 @@ static void updwtmp (const char *filename, const struct utmp *ut)
|
|||||||
close (fd);
|
close (fd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* ! HAVE_UPDWTMP */
|
#endif
|
||||||
|
|
||||||
#endif /* ! USE_PAM */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -221,15 +226,13 @@ static void updwtmp (const char *filename, const struct utmp *ut)
|
|||||||
*
|
*
|
||||||
* The returned structure shall be freed by the caller.
|
* The returned structure shall be freed by the caller.
|
||||||
*/
|
*/
|
||||||
static
|
static /*@only@*/struct utmpx *
|
||||||
/*@only@*/struct utmp *prepare_utmp (const char *name,
|
prepare_utmp(const char *name, const char *line, const char *host,
|
||||||
const char *line,
|
/*@null@*/const struct utmpx *ut)
|
||||||
const char *host,
|
|
||||||
/*@null@*/const struct utmp *ut)
|
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
char *hostname = NULL;
|
||||||
char *hostname = NULL;
|
struct utmpx *utent;
|
||||||
struct utmp *utent;
|
struct timeval tv;
|
||||||
|
|
||||||
assert (NULL != name);
|
assert (NULL != name);
|
||||||
assert (NULL != line);
|
assert (NULL != line);
|
||||||
@@ -240,13 +243,13 @@ static
|
|||||||
&& ('\0' != host[0])) {
|
&& ('\0' != host[0])) {
|
||||||
hostname = XMALLOC(strlen(host) + 1, char);
|
hostname = XMALLOC(strlen(host) + 1, char);
|
||||||
strcpy (hostname, host);
|
strcpy (hostname, host);
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_HOST
|
#if defined(HAVE_STRUCT_UTMPX_UT_HOST)
|
||||||
} else if ( (NULL != ut)
|
} else if ( (NULL != ut)
|
||||||
&& ('\0' != ut->ut_host[0])) {
|
&& ('\0' != ut->ut_host[0])) {
|
||||||
hostname = XMALLOC(sizeof(ut->ut_host) + 1, char);
|
hostname = XMALLOC(sizeof(ut->ut_host) + 1, char);
|
||||||
strncpy (hostname, ut->ut_host, sizeof (ut->ut_host));
|
strncpy (hostname, ut->ut_host, sizeof (ut->ut_host));
|
||||||
hostname[sizeof (ut->ut_host)] = '\0';
|
hostname[sizeof (ut->ut_host)] = '\0';
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_HOST */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncmp(line, "/dev/", 5) == 0) {
|
if (strncmp(line, "/dev/", 5) == 0) {
|
||||||
@@ -254,38 +257,32 @@ static
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
utent = XCALLOC (1, struct utmp);
|
utent = XCALLOC(1, struct utmpx);
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_TYPE
|
|
||||||
utent->ut_type = USER_PROCESS;
|
utent->ut_type = USER_PROCESS;
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_TYPE */
|
|
||||||
utent->ut_pid = getpid ();
|
utent->ut_pid = getpid ();
|
||||||
strncpy (utent->ut_line, line, sizeof (utent->ut_line) - 1);
|
strncpy (utent->ut_line, line, sizeof (utent->ut_line) - 1);
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_ID
|
|
||||||
if (NULL != ut) {
|
if (NULL != ut) {
|
||||||
strncpy (utent->ut_id, ut->ut_id, sizeof (utent->ut_id));
|
strncpy (utent->ut_id, ut->ut_id, sizeof (utent->ut_id));
|
||||||
} else {
|
} else {
|
||||||
/* XXX - assumes /dev/tty?? */
|
/* XXX - assumes /dev/tty?? */
|
||||||
strncpy (utent->ut_id, line + 3, sizeof (utent->ut_id) - 1);
|
strncpy (utent->ut_id, line + 3, sizeof (utent->ut_id) - 1);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_ID */
|
#if defined(HAVE_STRUCT_UTMPX_UT_NAME)
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_NAME
|
|
||||||
strncpy (utent->ut_name, name, sizeof (utent->ut_name));
|
strncpy (utent->ut_name, name, sizeof (utent->ut_name));
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_NAME */
|
#endif
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_USER
|
|
||||||
strncpy (utent->ut_user, name, sizeof (utent->ut_user) - 1);
|
strncpy (utent->ut_user, name, sizeof (utent->ut_user) - 1);
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_USER */
|
|
||||||
if (NULL != hostname) {
|
if (NULL != hostname) {
|
||||||
struct addrinfo *info = NULL;
|
struct addrinfo *info = NULL;
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_HOST
|
#if defined(HAVE_STRUCT_UTMPX_UT_HOST)
|
||||||
strncpy (utent->ut_host, hostname, sizeof (utent->ut_host) - 1);
|
strncpy (utent->ut_host, hostname, sizeof (utent->ut_host) - 1);
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_HOST */
|
#endif
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_SYSLEN
|
#if defined(HAVE_STRUCT_UTMPX_UT_SYSLEN)
|
||||||
utent->ut_syslen = MIN (strlen (hostname),
|
utent->ut_syslen = MIN (strlen (hostname),
|
||||||
sizeof (utent->ut_host));
|
sizeof (utent->ut_host));
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_SYSLEN */
|
#endif
|
||||||
#if defined(HAVE_STRUCT_UTMP_UT_ADDR) || defined(HAVE_STRUCT_UTMP_UT_ADDR_V6)
|
#if defined(HAVE_STRUCT_UTMPX_UT_ADDR) || defined(HAVE_STRUCT_UTMPX_UT_ADDR_V6)
|
||||||
if (getaddrinfo (hostname, NULL, NULL, &info) == 0) {
|
if (getaddrinfo (hostname, NULL, NULL, &info) == 0) {
|
||||||
/* getaddrinfo might not be reliable.
|
/* getaddrinfo might not be reliable.
|
||||||
* Just try to log what may be useful.
|
* Just try to log what may be useful.
|
||||||
@@ -293,13 +290,13 @@ static
|
|||||||
if (info->ai_family == AF_INET) {
|
if (info->ai_family == AF_INET) {
|
||||||
struct sockaddr_in *sa =
|
struct sockaddr_in *sa =
|
||||||
(struct sockaddr_in *) info->ai_addr;
|
(struct sockaddr_in *) info->ai_addr;
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_ADDR
|
# if defined(HAVE_STRUCT_UTMPX_UT_ADDR)
|
||||||
memcpy (&(utent->ut_addr),
|
memcpy (&(utent->ut_addr),
|
||||||
&(sa->sin_addr),
|
&(sa->sin_addr),
|
||||||
MIN (sizeof (utent->ut_addr),
|
MIN (sizeof (utent->ut_addr),
|
||||||
sizeof (sa->sin_addr)));
|
sizeof (sa->sin_addr)));
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_ADDR */
|
# endif
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_ADDR_V6
|
# if defined(HAVE_STRUCT_UTMPX_UT_ADDR_V6)
|
||||||
memcpy (utent->ut_addr_v6,
|
memcpy (utent->ut_addr_v6,
|
||||||
&(sa->sin_addr),
|
&(sa->sin_addr),
|
||||||
MIN (sizeof (utent->ut_addr_v6),
|
MIN (sizeof (utent->ut_addr_v6),
|
||||||
@@ -311,81 +308,80 @@ static
|
|||||||
&(sa->sin6_addr),
|
&(sa->sin6_addr),
|
||||||
MIN (sizeof (utent->ut_addr_v6),
|
MIN (sizeof (utent->ut_addr_v6),
|
||||||
sizeof (sa->sin6_addr)));
|
sizeof (sa->sin6_addr)));
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_ADDR_V6 */
|
# endif
|
||||||
}
|
}
|
||||||
freeaddrinfo (info);
|
freeaddrinfo (info);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_ADDR || HAVE_STRUCT_UTMP_UT_ADDR_V6 */
|
#endif
|
||||||
free (hostname);
|
free (hostname);
|
||||||
}
|
}
|
||||||
/* ut_exit is only for DEAD_PROCESS */
|
/* ut_exit is only for DEAD_PROCESS */
|
||||||
utent->ut_session = getsid (0);
|
utent->ut_session = getsid (0);
|
||||||
if (gettimeofday (&tv, NULL) == 0) {
|
if (gettimeofday (&tv, NULL) == 0) {
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_TIME
|
#if defined(HAVE_STRUCT_UTMPX_UT_TIME)
|
||||||
utent->ut_time = tv.tv_sec;
|
utent->ut_time = tv.tv_sec;
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_TIME */
|
#endif
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_XTIME
|
#if defined(HAVE_STRUCT_UTMPX_UT_XTIME)
|
||||||
utent->ut_xtime = tv.tv_usec;
|
utent->ut_xtime = tv.tv_usec;
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_XTIME */
|
#endif
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_TV
|
|
||||||
utent->ut_tv.tv_sec = tv.tv_sec;
|
utent->ut_tv.tv_sec = tv.tv_sec;
|
||||||
utent->ut_tv.tv_usec = tv.tv_usec;
|
utent->ut_tv.tv_usec = tv.tv_usec;
|
||||||
#endif /* HAVE_STRUCT_UTMP_UT_TV */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return utent;
|
return utent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* setutmp - Update an entry in utmp and log an entry in wtmp
|
* setutmp - Update an entry in utmp and log an entry in wtmp
|
||||||
*
|
*
|
||||||
* Return 1 on failure and 0 on success.
|
* Return 1 on failure and 0 on success.
|
||||||
*/
|
*/
|
||||||
static int setutmp (struct utmp *ut)
|
static int
|
||||||
|
setutmp(struct utmpx *ut)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
assert (NULL != ut);
|
assert (NULL != ut);
|
||||||
|
|
||||||
setutent ();
|
setutxent();
|
||||||
if (pututline (ut) == NULL) {
|
if (pututxline(ut) == NULL) {
|
||||||
err = 1;
|
err = 1;
|
||||||
}
|
}
|
||||||
endutent ();
|
endutxent();
|
||||||
|
|
||||||
#ifndef USE_PAM
|
#if !defined(USE_PAM)
|
||||||
/* This is done by pam_lastlog */
|
/* This is done by pam_lastlog */
|
||||||
updwtmp (_WTMP_FILE, ut);
|
updwtmpx(_WTMP_FILE, ut);
|
||||||
#endif /* ! USE_PAM */
|
#endif
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int update_utmp (const char *user,
|
|
||||||
const char *tty,
|
int
|
||||||
const char *host)
|
update_utmp(const char *user, const char *tty, const char *host)
|
||||||
{
|
{
|
||||||
struct utmp *utent, *ut;
|
struct utmpx *utent, *ut;
|
||||||
|
|
||||||
utent = get_current_utmp ();
|
utent = get_current_utmp ();
|
||||||
if (utent == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ut = prepare_utmp (user, tty, host, utent);
|
ut = prepare_utmp (user, tty, host, utent);
|
||||||
|
|
||||||
(void) setutmp (ut); /* make entry in the utmp & wtmp files */
|
(void) setutmp (ut); /* make entry in the utmp & wtmp files */
|
||||||
free (utent);
|
|
||||||
|
if (utent != NULL) {
|
||||||
|
free (utent);
|
||||||
|
}
|
||||||
free (ut);
|
free (ut);
|
||||||
|
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void record_failure(const char *failent_user,
|
|
||||||
const char *tty,
|
void
|
||||||
const char *hostname)
|
record_failure(const char *failent_user, const char *tty, const char *hostname)
|
||||||
{
|
{
|
||||||
struct utmp *utent, *failent;
|
struct utmpx *utent, *failent;
|
||||||
|
|
||||||
if (getdef_str ("FTMP_FILE") != NULL) {
|
if (getdef_str ("FTMP_FILE") != NULL) {
|
||||||
utent = get_current_utmp ();
|
utent = get_current_utmp ();
|
||||||
@@ -396,13 +392,15 @@ void record_failure(const char *failent_user,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long active_sessions_count(const char *name, unsigned long limit)
|
|
||||||
{
|
|
||||||
struct utmp *ut;
|
|
||||||
unsigned long count = 0;
|
|
||||||
|
|
||||||
setutent ();
|
unsigned long
|
||||||
while ((ut = getutent ()))
|
active_sessions_count(const char *name, unsigned long limit)
|
||||||
|
{
|
||||||
|
struct utmpx *ut;
|
||||||
|
unsigned long count = 0;
|
||||||
|
|
||||||
|
setutxent();
|
||||||
|
while ((ut = getutxent()))
|
||||||
{
|
{
|
||||||
if (USER_PROCESS != ut->ut_type) {
|
if (USER_PROCESS != ut->ut_type) {
|
||||||
continue;
|
continue;
|
||||||
@@ -418,7 +416,7 @@ unsigned long active_sessions_count(const char *name, unsigned long limit)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
endutent ();
|
endutxent();
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
Vendored
-5
@@ -1,5 +0,0 @@
|
|||||||
-kr
|
|
||||||
-i8
|
|
||||||
-bad
|
|
||||||
-pcs
|
|
||||||
-l80
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
|
|
||||||
EXTRA_DIST = .indent.pro xgetXXbyYY.c
|
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir) $(ECONF_CPPFLAGS)
|
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libmisc.la
|
|
||||||
|
|
||||||
if USE_PAM
|
|
||||||
LIBCRYPT_PAM = $(LIBCRYPT)
|
|
||||||
else
|
|
||||||
LIBCRYPT_PAM =
|
|
||||||
endif
|
|
||||||
|
|
||||||
libmisc_la_CFLAGS = $(LIBBSD_CFLAGS) $(LIBCRYPT_PAM) $(LIBSYSTEMD)
|
|
||||||
libmisc_la_SOURCES = \
|
|
||||||
addgrps.c \
|
|
||||||
age.c \
|
|
||||||
agetpass.c \
|
|
||||||
alloc.c \
|
|
||||||
../lib/alloc.h \
|
|
||||||
audit_help.c \
|
|
||||||
basename.c \
|
|
||||||
bit.c \
|
|
||||||
../lib/bit.h \
|
|
||||||
chkname.c \
|
|
||||||
chkname.h \
|
|
||||||
chowndir.c \
|
|
||||||
chowntty.c \
|
|
||||||
cleanup.c \
|
|
||||||
cleanup_group.c \
|
|
||||||
cleanup_user.c \
|
|
||||||
console.c \
|
|
||||||
copydir.c \
|
|
||||||
date_to_str.c \
|
|
||||||
entry.c \
|
|
||||||
env.c \
|
|
||||||
failure.c \
|
|
||||||
failure.h \
|
|
||||||
find_new_gid.c \
|
|
||||||
find_new_uid.c \
|
|
||||||
find_new_sub_gids.c \
|
|
||||||
find_new_sub_uids.c \
|
|
||||||
getdate.h \
|
|
||||||
getdate.y \
|
|
||||||
getgr_nam_gid.c \
|
|
||||||
getrange.c \
|
|
||||||
gettime.c \
|
|
||||||
hushed.c \
|
|
||||||
idmapping.h \
|
|
||||||
idmapping.c \
|
|
||||||
isexpired.c \
|
|
||||||
limits.c \
|
|
||||||
list.c \
|
|
||||||
loginprompt.c \
|
|
||||||
mail.c \
|
|
||||||
mempcpy.c \
|
|
||||||
motd.c \
|
|
||||||
myname.c \
|
|
||||||
obscure.c \
|
|
||||||
pam_pass.c \
|
|
||||||
pam_pass_non_interactive.c \
|
|
||||||
prefix_flag.c \
|
|
||||||
pwd2spwd.c \
|
|
||||||
pwdcheck.c \
|
|
||||||
pwd_init.c \
|
|
||||||
csrand.c \
|
|
||||||
remove_tree.c \
|
|
||||||
rlogin.c \
|
|
||||||
root_flag.c \
|
|
||||||
salt.c \
|
|
||||||
setugid.c \
|
|
||||||
setupenv.c \
|
|
||||||
shell.c \
|
|
||||||
stpecpy.c \
|
|
||||||
../lib/stpecpy.h \
|
|
||||||
stpeprintf.c \
|
|
||||||
../lib/stpeprintf.h \
|
|
||||||
strtoday.c \
|
|
||||||
sub.c \
|
|
||||||
sulog.c \
|
|
||||||
ttytype.c \
|
|
||||||
tz.c \
|
|
||||||
ulimit.c \
|
|
||||||
user_busy.c \
|
|
||||||
valid.c \
|
|
||||||
xgetpwnam.c \
|
|
||||||
xprefix_getpwnam.c \
|
|
||||||
xgetpwuid.c \
|
|
||||||
xgetgrnam.c \
|
|
||||||
xgetgrgid.c \
|
|
||||||
xgetspnam.c \
|
|
||||||
yesno.c
|
|
||||||
|
|
||||||
if WITH_BTRFS
|
|
||||||
libmisc_la_SOURCES += btrfs.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if ENABLE_LASTLOG
|
|
||||||
libmisc_la_SOURCES += log.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if ENABLE_LOGIND
|
|
||||||
libmisc_la_SOURCES += logind.c
|
|
||||||
else
|
|
||||||
libmisc_la_SOURCES += utmp.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !WITH_LIBBSD
|
|
||||||
libmisc_la_SOURCES += \
|
|
||||||
freezero.h \
|
|
||||||
freezero.c \
|
|
||||||
readpassphrase.h \
|
|
||||||
readpassphrase.c
|
|
||||||
endif
|
|
||||||
@@ -21,10 +21,8 @@ MISCLIBS = \
|
|||||||
|
|
||||||
libsubid_la_LIBADD = \
|
libsubid_la_LIBADD = \
|
||||||
$(top_builddir)/lib/libshadow.la \
|
$(top_builddir)/lib/libshadow.la \
|
||||||
$(top_builddir)/libmisc/libmisc.la \
|
|
||||||
$(MISCLIBS) -ldl
|
$(MISCLIBS) -ldl
|
||||||
|
|
||||||
AM_CPPFLAGS = \
|
AM_CPPFLAGS = \
|
||||||
-I${top_srcdir}/lib \
|
-I${top_srcdir}/lib \
|
||||||
-I${top_srcdir}/libmisc \
|
|
||||||
-DLOCALEDIR=\"$(datadir)/locale\"
|
-DLOCALEDIR=\"$(datadir)/locale\"
|
||||||
|
|||||||
@@ -198,6 +198,21 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>-P</option>, <option>--prefix</option> <replaceable>PREFIX_DIR</replaceable>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Apply changes to configuration files under the root filesystem
|
||||||
|
found under the directory <replaceable>PREFIX_DIR</replaceable>.
|
||||||
|
This option does not chroot and is intended for preparing a cross-compilation
|
||||||
|
target. Some limitations: NIS and LDAP users/groups are
|
||||||
|
not verified. PAM authentication is using the host files.
|
||||||
|
No SELINUX support.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<option>-W</option>, <option>--warndays</option> <replaceable>WARN_DAYS</replaceable>
|
<option>-W</option>, <option>--warndays</option> <replaceable>WARN_DAYS</replaceable>
|
||||||
|
|||||||
@@ -173,6 +173,21 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>-P</option>, <option>--prefix</option> <replaceable>PREFIX_DIR</replaceable>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Apply changes to configuration files under the root filesystem
|
||||||
|
found under the directory <replaceable>PREFIX_DIR</replaceable>.
|
||||||
|
This option does not chroot and is intended for preparing a cross-compilation
|
||||||
|
target. Some limitations: NIS and LDAP users/groups are
|
||||||
|
not verified. PAM authentication is using the host files.
|
||||||
|
No SELINUX support.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry condition="sha_crypt">
|
<varlistentry condition="sha_crypt">
|
||||||
<term>
|
<term>
|
||||||
<option>-s</option>, <option>--sha-rounds</option> <replaceable>ROUNDS</replaceable>
|
<option>-s</option>, <option>--sha-rounds</option> <replaceable>ROUNDS</replaceable>
|
||||||
|
|||||||
@@ -280,6 +280,21 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>-P</option>, <option>--prefix</option> <replaceable>PREFIX_DIR</replaceable>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Apply changes to configuration files under the root filesystem
|
||||||
|
found under the directory <replaceable>PREFIX_DIR</replaceable>.
|
||||||
|
This option does not chroot and is intended for preparing a cross-compilation
|
||||||
|
target. Some limitations: NIS and LDAP users/groups are
|
||||||
|
not verified. PAM authentication is using the host files.
|
||||||
|
No SELINUX support.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<option>-S</option>, <option>--status</option>
|
<option>-S</option>, <option>--status</option>
|
||||||
|
|||||||
+58
-58
@@ -1,24 +1,68 @@
|
|||||||
# List of files which contain translatable strings.
|
# List of files which contain translatable strings.
|
||||||
|
|
||||||
|
lib/addgrps.c
|
||||||
|
lib/age.c
|
||||||
|
lib/audit_help.c
|
||||||
|
lib/basename.c
|
||||||
|
lib/chkname.c
|
||||||
|
lib/chowndir.c
|
||||||
|
lib/chowntty.c
|
||||||
|
lib/cleanup.c
|
||||||
|
lib/cleanup_group.c
|
||||||
|
lib/cleanup_user.c
|
||||||
lib/commonio.c
|
lib/commonio.c
|
||||||
|
lib/console.c
|
||||||
|
lib/copydir.c
|
||||||
|
lib/date_to_str.c
|
||||||
lib/encrypt.c
|
lib/encrypt.c
|
||||||
|
lib/entry.c
|
||||||
|
lib/env.c
|
||||||
|
lib/failure.c
|
||||||
lib/fields.c
|
lib/fields.c
|
||||||
|
lib/find_new_gid.c
|
||||||
|
lib/find_new_sub_gids.c
|
||||||
|
lib/find_new_sub_uids.c
|
||||||
|
lib/find_new_uid.c
|
||||||
lib/fputsx.c
|
lib/fputsx.c
|
||||||
lib/getdef.c
|
|
||||||
lib/get_gid.c
|
lib/get_gid.c
|
||||||
lib/getlong.c
|
|
||||||
lib/get_uid.c
|
lib/get_uid.c
|
||||||
|
lib/getdef.c
|
||||||
|
lib/getlong.c
|
||||||
|
lib/getgr_nam_gid.c
|
||||||
|
lib/getrange.c
|
||||||
lib/groupio.c
|
lib/groupio.c
|
||||||
lib/groupmem.c
|
lib/groupmem.c
|
||||||
lib/gshadow.c
|
lib/gshadow.c
|
||||||
|
lib/hushed.c
|
||||||
|
lib/idmapping.c
|
||||||
|
lib/isexpired.c
|
||||||
|
lib/limits.c
|
||||||
|
lib/list.c
|
||||||
lib/lockpw.c
|
lib/lockpw.c
|
||||||
|
lib/log.c
|
||||||
|
lib/loginprompt.c
|
||||||
|
lib/mail.c
|
||||||
|
lib/motd.c
|
||||||
|
lib/myname.c
|
||||||
lib/nscd.c
|
lib/nscd.c
|
||||||
|
lib/obscure.c
|
||||||
|
lib/pam_pass.c
|
||||||
|
lib/pam_pass_non_interactive.c
|
||||||
lib/port.c
|
lib/port.c
|
||||||
lib/pwauth.c
|
lib/pwauth.c
|
||||||
|
lib/pwd_init.c
|
||||||
|
lib/pwd2spwd.c
|
||||||
|
lib/pwdcheck.c
|
||||||
lib/pwio.c
|
lib/pwio.c
|
||||||
lib/pwmem.c
|
lib/pwmem.c
|
||||||
|
lib/remove_tree.c
|
||||||
|
lib/rlogin.c
|
||||||
|
lib/root_flag.c
|
||||||
|
lib/salt.c
|
||||||
lib/selinux.c
|
lib/selinux.c
|
||||||
lib/semanage.c
|
lib/semanage.c
|
||||||
|
lib/setugid.c
|
||||||
|
lib/setupenv.c
|
||||||
lib/sgetgrent.c
|
lib/sgetgrent.c
|
||||||
lib/sgetpwent.c
|
lib/sgetpwent.c
|
||||||
lib/sgetspent.c
|
lib/sgetspent.c
|
||||||
@@ -26,64 +70,20 @@ lib/sgroupio.c
|
|||||||
lib/shadow.c
|
lib/shadow.c
|
||||||
lib/shadowio.c
|
lib/shadowio.c
|
||||||
lib/shadowmem.c
|
lib/shadowmem.c
|
||||||
|
lib/shell.c
|
||||||
lib/spawn.c
|
lib/spawn.c
|
||||||
|
lib/strtoday.c
|
||||||
|
lib/sub.c
|
||||||
|
lib/sulog.c
|
||||||
lib/tcbfuncs.c
|
lib/tcbfuncs.c
|
||||||
libmisc/addgrps.c
|
lib/ttytype.c
|
||||||
libmisc/age.c
|
lib/tz.c
|
||||||
libmisc/audit_help.c
|
lib/ulimit.c
|
||||||
libmisc/basename.c
|
lib/user_busy.c
|
||||||
libmisc/chkname.c
|
lib/utmp.c
|
||||||
libmisc/chowndir.c
|
lib/valid.c
|
||||||
libmisc/chowntty.c
|
lib/xgetXXbyYY.c
|
||||||
libmisc/cleanup.c
|
lib/yesno.c
|
||||||
libmisc/cleanup_group.c
|
|
||||||
libmisc/cleanup_user.c
|
|
||||||
libmisc/console.c
|
|
||||||
libmisc/copydir.c
|
|
||||||
libmisc/date_to_str.c
|
|
||||||
libmisc/entry.c
|
|
||||||
libmisc/env.c
|
|
||||||
libmisc/failure.c
|
|
||||||
libmisc/find_new_gid.c
|
|
||||||
libmisc/find_new_sub_gids.c
|
|
||||||
libmisc/find_new_sub_uids.c
|
|
||||||
libmisc/find_new_uid.c
|
|
||||||
libmisc/getgr_nam_gid.c
|
|
||||||
libmisc/getrange.c
|
|
||||||
libmisc/hushed.c
|
|
||||||
libmisc/idmapping.c
|
|
||||||
libmisc/isexpired.c
|
|
||||||
libmisc/limits.c
|
|
||||||
libmisc/list.c
|
|
||||||
libmisc/log.c
|
|
||||||
libmisc/loginprompt.c
|
|
||||||
libmisc/mail.c
|
|
||||||
libmisc/motd.c
|
|
||||||
libmisc/myname.c
|
|
||||||
libmisc/obscure.c
|
|
||||||
libmisc/pam_pass.c
|
|
||||||
libmisc/pam_pass_non_interactive.c
|
|
||||||
libmisc/pwd2spwd.c
|
|
||||||
libmisc/pwdcheck.c
|
|
||||||
libmisc/pwd_init.c
|
|
||||||
libmisc/remove_tree.c
|
|
||||||
libmisc/rlogin.c
|
|
||||||
libmisc/root_flag.c
|
|
||||||
libmisc/salt.c
|
|
||||||
libmisc/setugid.c
|
|
||||||
libmisc/setupenv.c
|
|
||||||
libmisc/shell.c
|
|
||||||
libmisc/strtoday.c
|
|
||||||
libmisc/sub.c
|
|
||||||
libmisc/sulog.c
|
|
||||||
libmisc/ttytype.c
|
|
||||||
libmisc/tz.c
|
|
||||||
libmisc/ulimit.c
|
|
||||||
libmisc/user_busy.c
|
|
||||||
libmisc/utmp.c
|
|
||||||
libmisc/valid.c
|
|
||||||
libmisc/xgetXXbyYY.c
|
|
||||||
libmisc/yesno.c
|
|
||||||
src/chage.c
|
src/chage.c
|
||||||
src/chfn.c
|
src/chfn.c
|
||||||
src/chgpasswd.c
|
src/chgpasswd.c
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ RUN export DEBIAN_PRIORITY=critical \
|
|||||||
RUN apt-get update -y \
|
RUN apt-get update -y \
|
||||||
&& apt-get dist-upgrade -y
|
&& apt-get dist-upgrade -y
|
||||||
RUN apt-get build-dep shadow -y
|
RUN apt-get build-dep shadow -y
|
||||||
RUN apt-get install libbsd-dev pkgconf -y
|
RUN apt-get install libltdl-dev libbsd-dev pkgconf -y
|
||||||
|
|
||||||
COPY ./ /usr/local/src/shadow/
|
COPY ./ /usr/local/src/shadow/
|
||||||
WORKDIR /usr/local/src/shadow/
|
WORKDIR /usr/local/src/shadow/
|
||||||
|
|||||||
+1
-13
@@ -9,7 +9,6 @@ sgidperms = 2755
|
|||||||
|
|
||||||
AM_CPPFLAGS = \
|
AM_CPPFLAGS = \
|
||||||
-I${top_srcdir}/lib \
|
-I${top_srcdir}/lib \
|
||||||
-I$(top_srcdir)/libmisc \
|
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-DLOCALEDIR=\"$(datadir)/locale\" \
|
-DLOCALEDIR=\"$(datadir)/locale\" \
|
||||||
$(ECONF_CPPFLAGS)
|
$(ECONF_CPPFLAGS)
|
||||||
@@ -85,7 +84,6 @@ shadowsgidubins = passwd
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
LDADD = $(INTLLIBS) \
|
LDADD = $(INTLLIBS) \
|
||||||
$(top_builddir)/libmisc/libmisc.la \
|
|
||||||
$(top_builddir)/lib/libshadow.la \
|
$(top_builddir)/lib/libshadow.la \
|
||||||
$(LIBTCB)
|
$(LIBTCB)
|
||||||
|
|
||||||
@@ -183,59 +181,49 @@ MISCLIBS = \
|
|||||||
|
|
||||||
getsubids_LDADD = \
|
getsubids_LDADD = \
|
||||||
$(top_builddir)/lib/libshadow.la \
|
$(top_builddir)/lib/libshadow.la \
|
||||||
$(top_builddir)/libmisc/libmisc.la \
|
|
||||||
$(top_builddir)/libsubid/libsubid.la \
|
$(top_builddir)/libsubid/libsubid.la \
|
||||||
$(MISCLIBS) -ldl
|
$(MISCLIBS) -ldl
|
||||||
|
|
||||||
getsubids_CPPFLAGS = \
|
getsubids_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/lib \
|
-I$(top_srcdir)/lib \
|
||||||
-I$(top_srcdir)/libmisc \
|
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_builddir)/libsubid
|
-I$(top_builddir)/libsubid
|
||||||
|
|
||||||
get_subid_owners_LDADD = \
|
get_subid_owners_LDADD = \
|
||||||
$(top_builddir)/lib/libshadow.la \
|
$(top_builddir)/lib/libshadow.la \
|
||||||
$(top_builddir)/libmisc/libmisc.la \
|
|
||||||
$(top_builddir)/libsubid/libsubid.la \
|
$(top_builddir)/libsubid/libsubid.la \
|
||||||
$(MISCLIBS) -ldl
|
$(MISCLIBS) -ldl
|
||||||
|
|
||||||
get_subid_owners_CPPFLAGS = \
|
get_subid_owners_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/lib \
|
-I$(top_srcdir)/lib \
|
||||||
-I$(top_srcdir)/libmisc \
|
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_builddir)/libsubid
|
-I$(top_builddir)/libsubid
|
||||||
|
|
||||||
new_subid_range_CPPFLAGS = \
|
new_subid_range_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/lib \
|
-I$(top_srcdir)/lib \
|
||||||
-I$(top_srcdir)/libmisc \
|
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_builddir)/libsubid
|
-I$(top_builddir)/libsubid
|
||||||
|
|
||||||
new_subid_range_LDADD = \
|
new_subid_range_LDADD = \
|
||||||
$(top_builddir)/lib/libshadow.la \
|
$(top_builddir)/lib/libshadow.la \
|
||||||
$(top_builddir)/libmisc/libmisc.la \
|
|
||||||
$(top_builddir)/libsubid/libsubid.la \
|
$(top_builddir)/libsubid/libsubid.la \
|
||||||
$(MISCLIBS) -ldl
|
$(MISCLIBS) -ldl
|
||||||
|
|
||||||
free_subid_range_CPPFLAGS = \
|
free_subid_range_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/lib \
|
-I$(top_srcdir)/lib \
|
||||||
-I$(top_srcdir)/libmisc \
|
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_builddir)/libsubid
|
-I$(top_builddir)/libsubid
|
||||||
|
|
||||||
free_subid_range_LDADD = \
|
free_subid_range_LDADD = \
|
||||||
$(top_builddir)/lib/libshadow.la \
|
$(top_builddir)/lib/libshadow.la \
|
||||||
$(top_builddir)/libmisc/libmisc.la \
|
|
||||||
$(top_builddir)/libsubid/libsubid.la \
|
$(top_builddir)/libsubid/libsubid.la \
|
||||||
$(MISCLIBS) -ldl
|
$(MISCLIBS) -ldl
|
||||||
|
|
||||||
check_subid_range_CPPFLAGS = \
|
check_subid_range_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/lib \
|
-I$(top_srcdir)/lib \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir)
|
||||||
-I$(top_srcdir)/libmisc
|
|
||||||
|
|
||||||
check_subid_range_LDADD = \
|
check_subid_range_LDADD = \
|
||||||
$(top_builddir)/lib/libshadow.la \
|
$(top_builddir)/lib/libshadow.la \
|
||||||
$(top_builddir)/libmisc/libmisc.la \
|
|
||||||
$(MISCLIBS) -ldl
|
$(MISCLIBS) -ldl
|
||||||
endif
|
endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user