Compare commits
107 Commits
buildtime-
...
debian/1%4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52239321b8 | ||
|
|
4660554e73 | ||
|
|
4e64c42f1e | ||
|
|
f62eb980d5 | ||
|
|
19d6a0f9a3 | ||
|
|
a9c3448878 | ||
|
|
9e93a3348b | ||
|
|
de176e27ed | ||
|
|
302d4ef809 | ||
|
|
73d57c09a1 | ||
|
|
6360940c7f | ||
|
|
0e6f426896 | ||
|
|
b56ac5f36b | ||
|
|
193bcdacf8 | ||
|
|
47ba166e47 | ||
|
|
a475f464e0 | ||
|
|
df34dc0271 | ||
|
|
03ab41b0a9 | ||
|
|
da9ad99cc7 | ||
|
|
677d61be14 | ||
|
|
5afd832ec6 | ||
|
|
a68ce238bd | ||
|
|
1c472beabb | ||
|
|
6eb4f265cf | ||
|
|
32a244b0ce | ||
|
|
fea713992d | ||
|
|
94385da1c2 | ||
|
|
a143aca1c9 | ||
|
|
f476e8b263 | ||
|
|
477077497f | ||
|
|
8b42aebdfb | ||
|
|
d39c5351ae | ||
|
|
b2a5824f7f | ||
|
|
7c5c7ebd17 | ||
|
|
65261e28f4 | ||
|
|
4d765593fb | ||
|
|
52fc52e74a | ||
|
|
30f621e2a7 | ||
|
|
f6f677a4ca | ||
|
|
ac4bab2baa | ||
|
|
ccffcd6f80 | ||
|
|
bd724b34e0 | ||
|
|
194489de56 | ||
|
|
8524eb9ab1 | ||
|
|
5c6c085ae5 | ||
|
|
c2a3ebed18 | ||
|
|
d11a43e29c | ||
|
|
baf57b0835 | ||
|
|
83ef3ff76d | ||
|
|
bea3610b66 | ||
|
|
d14cb1acb3 | ||
|
|
931b0f68b7 | ||
|
|
32d53642f0 | ||
|
|
24c35ea945 | ||
|
|
f78a468368 | ||
|
|
0a94a89bcf | ||
|
|
92410b1c76 | ||
|
|
c91a226797 | ||
|
|
b0619a14cd | ||
|
|
6605806a6d | ||
|
|
e649b28033 | ||
|
|
4f3dfcdadd | ||
|
|
ccaa7ea01e | ||
|
|
1eaf9012b1 | ||
|
|
a5e0d00442 | ||
|
|
ade65b0204 | ||
|
|
a23a040247 | ||
|
|
f11f8581f2 | ||
|
|
4885f58fde | ||
|
|
68624ca168 | ||
|
|
8d8becfddb | ||
|
|
d390695b6d | ||
|
|
70bb4db51c | ||
|
|
5a17bd19ad | ||
|
|
b44052751e | ||
|
|
d7383961f5 | ||
|
|
a7e5816642 | ||
|
|
a2f607ed76 | ||
|
|
9bbb9e5060 | ||
|
|
75eb23ace8 | ||
|
|
588b536eb1 | ||
|
|
f6e239d940 | ||
|
|
c4ecaf0a01 | ||
|
|
2acc8676db | ||
|
|
9966b2ae50 | ||
|
|
0d8225bd20 | ||
|
|
5c3cef331a | ||
|
|
4d9f62575d | ||
|
|
b7b75e2d61 | ||
|
|
ccae83d30e | ||
|
|
08e5e0a148 | ||
|
|
0d4266dc81 | ||
|
|
c5d3d4be36 | ||
|
|
6170f973ff | ||
|
|
1c7262b6e2 | ||
|
|
e9cceb62ce | ||
|
|
75904cfd05 | ||
|
|
f8e81f7293 | ||
|
|
d0c5da8cf1 | ||
|
|
5f784b3ef3 | ||
|
|
fd652cdf40 | ||
|
|
a5d765523b | ||
|
|
9b4bfac4ef | ||
|
|
d7b0c262ba | ||
|
|
82e88c1e9b | ||
|
|
b214d3fb51 | ||
|
|
d08fc0fe8b |
@@ -1,7 +1,5 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
EXTRA_DIST = NEWS README
|
||||
|
||||
SUBDIRS = lib
|
||||
|
||||
if ENABLE_SUBIDS
|
||||
@@ -16,7 +14,7 @@ endif
|
||||
|
||||
CLEANFILES = man/8.out man/po/remove-potcdate.* man/*/login.defs.d man/*/*.mo
|
||||
|
||||
EXTRA_DIST = tests/
|
||||
EXTRA_DIST = NEWS README tests/
|
||||
|
||||
dist-hook:
|
||||
chmod -R u+w $(distdir)/tests
|
||||
|
||||
@@ -243,7 +243,6 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
@@ -390,10 +389,10 @@ target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
EXTRA_DIST = tests/
|
||||
SUBDIRS = lib $(am__append_1) src po contrib doc etc tests/unit \
|
||||
$(am__append_2)
|
||||
CLEANFILES = man/8.out man/po/remove-potcdate.* man/*/login.defs.d man/*/*.mo
|
||||
EXTRA_DIST = NEWS README tests/
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
|
||||
43
aclocal.m4
vendored
43
aclocal.m4
vendored
@@ -22,15 +22,14 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
|
||||
|
||||
# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 1999-2008, 2011-2019, 2021-2022 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1999-2008, 2011-2015 Free Software Foundation, Inc.
|
||||
# Written by Thomas Tanner, 1999
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 21 LTDL_INIT
|
||||
# serial 20 LTDL_INIT
|
||||
|
||||
# LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE])
|
||||
# ------------------------------------------
|
||||
@@ -358,7 +357,7 @@ AC_CONFIG_COMMANDS_PRE([
|
||||
if test -n "$_LT_LIBOBJS"; then
|
||||
# Remove the extension.
|
||||
_lt_sed_drop_objext='s/\.o$//;s/\.obj$//'
|
||||
for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | $SED "$_lt_sed_drop_objext" | sort -u`; do
|
||||
for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do
|
||||
_ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext"
|
||||
_ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo"
|
||||
done
|
||||
@@ -496,7 +495,7 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
|
||||
# If you are looking for one http://www.opendarwin.org/projects/dlcompat
|
||||
lt_cv_sys_dlopen_deplibs=yes
|
||||
;;
|
||||
freebsd* | dragonfly* | midnightbsd*)
|
||||
freebsd* | dragonfly*)
|
||||
lt_cv_sys_dlopen_deplibs=yes
|
||||
;;
|
||||
gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
@@ -931,8 +930,8 @@ AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE])
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])
|
||||
|
||||
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
|
||||
# serial 12 (pkg-config-0.29.2)
|
||||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
# serial 11 (pkg-config-0.29.1)
|
||||
|
||||
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
|
||||
@@ -974,7 +973,7 @@ dnl
|
||||
dnl See the "Since" comment for each macro you use to see what version
|
||||
dnl of the macros you require.
|
||||
m4_defun([PKG_PREREQ],
|
||||
[m4_define([PKG_MACROS_VERSION], [0.29.2])
|
||||
[m4_define([PKG_MACROS_VERSION], [0.29.1])
|
||||
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
|
||||
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
|
||||
])dnl PKG_PREREQ
|
||||
@@ -1019,7 +1018,7 @@ dnl Check to see whether a particular set of modules exists. Similar to
|
||||
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||
dnl
|
||||
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
dnl only at the first occurrence in configure.ac, so if the first place
|
||||
dnl only at the first occurence in configure.ac, so if the first place
|
||||
dnl it's called might be skipped (such as if it is within an "if", you
|
||||
dnl have to call PKG_CHECK_EXISTS manually
|
||||
AC_DEFUN([PKG_CHECK_EXISTS],
|
||||
@@ -1075,7 +1074,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
||||
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||
|
||||
pkg_failed=no
|
||||
AC_MSG_CHECKING([for $2])
|
||||
AC_MSG_CHECKING([for $1])
|
||||
|
||||
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||
@@ -1085,17 +1084,17 @@ and $1[]_LIBS to avoid the need to call pkg-config.
|
||||
See the pkg-config man page for more details.])
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_RESULT([no])
|
||||
_PKG_SHORT_ERRORS_SUPPORTED
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
m4_default([$4], [AC_MSG_ERROR(
|
||||
m4_default([$4], [AC_MSG_ERROR(
|
||||
[Package requirements ($2) were not met:
|
||||
|
||||
$$1_PKG_ERRORS
|
||||
@@ -1106,8 +1105,8 @@ installed software in a non-standard prefix.
|
||||
_PKG_TEXT])[]dnl
|
||||
])
|
||||
elif test $pkg_failed = untried; then
|
||||
AC_MSG_RESULT([no])
|
||||
m4_default([$4], [AC_MSG_FAILURE(
|
||||
AC_MSG_RESULT([no])
|
||||
m4_default([$4], [AC_MSG_FAILURE(
|
||||
[The pkg-config script could not be found or is too old. Make sure it
|
||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
path to pkg-config.
|
||||
@@ -1117,10 +1116,10 @@ _PKG_TEXT
|
||||
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
|
||||
])
|
||||
else
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
AC_MSG_RESULT([yes])
|
||||
$3
|
||||
$3
|
||||
fi[]dnl
|
||||
])dnl PKG_CHECK_MODULES
|
||||
|
||||
|
||||
61
config.h.in
61
config.h.in
@@ -20,10 +20,6 @@
|
||||
/* Path for faillog file. */
|
||||
#undef FAILLOG_FILE
|
||||
|
||||
/* Define to the type of elements in the array set by `getgroups'. Usually
|
||||
this is either `int' or `gid_t'. */
|
||||
#undef GETGROUPS_T
|
||||
|
||||
/* max group name length */
|
||||
#undef GROUP_NAME_MAX_LENGTH
|
||||
|
||||
@@ -53,9 +49,6 @@
|
||||
the CoreFoundation framework. */
|
||||
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
|
||||
|
||||
/* Define to 1 if you have the <crypt.h> header file. */
|
||||
#undef HAVE_CRYPT_H
|
||||
|
||||
/* Define if the GNU dcgettext() function is already present or preinstalled.
|
||||
*/
|
||||
#undef HAVE_DCGETTEXT
|
||||
@@ -119,24 +112,15 @@
|
||||
/* Define to 1 if you have the `getusershell' function. */
|
||||
#undef HAVE_GETUSERSHELL
|
||||
|
||||
/* Define to 1 if you have the <gshadow.h> header file. */
|
||||
#undef HAVE_GSHADOW_H
|
||||
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
#undef HAVE_ICONV
|
||||
|
||||
/* Define to 1 if you have the `initgroups' function. */
|
||||
#undef HAVE_INITGROUPS
|
||||
|
||||
/* Define to 1 if you have the `innetgr' function. */
|
||||
#undef HAVE_INNETGR
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <lastlog.h> header file. */
|
||||
#undef HAVE_LASTLOG_H
|
||||
|
||||
/* Define to 1 if you have the `lckpwdf' function. */
|
||||
#undef HAVE_LCKPWDF
|
||||
|
||||
@@ -164,9 +148,6 @@
|
||||
/* Define to 1 if you have the <minix/config.h> header file. */
|
||||
#undef HAVE_MINIX_CONFIG_H
|
||||
|
||||
/* Define to 1 if you have the <paths.h> header file. */
|
||||
#undef HAVE_PATHS_H
|
||||
|
||||
/* Define to 1 if you have the `putgrent' function. */
|
||||
#undef HAVE_PUTGRENT
|
||||
|
||||
@@ -179,9 +160,6 @@
|
||||
/* Define to 1 if you have the <readpassphrase.h> header file. */
|
||||
#undef HAVE_READPASSPHRASE_H
|
||||
|
||||
/* Define to 1 if you have the <rpc/key_prot.h> header file. */
|
||||
#undef HAVE_RPC_KEY_PROT_H
|
||||
|
||||
/* Define to 1 if you have the `rpmatch' function. */
|
||||
#undef HAVE_RPMATCH
|
||||
|
||||
@@ -197,9 +175,6 @@
|
||||
/* Define to 1 if you have the <semanage/semanage.h> header file. */
|
||||
#undef HAVE_SEMANAGE_SEMANAGE_H
|
||||
|
||||
/* Define to 1 if you have the `setgroups' function. */
|
||||
#undef HAVE_SETGROUPS
|
||||
|
||||
/* Define to 1 if you have the `sgetgrent' function. */
|
||||
#undef HAVE_SGETGRENT
|
||||
|
||||
@@ -209,12 +184,6 @@
|
||||
/* Define to 1 if you have the `sgetspent' function. */
|
||||
#undef HAVE_SGETSPENT
|
||||
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
#undef HAVE_SGTTY_H
|
||||
|
||||
/* Have working shadow group support in libc */
|
||||
#undef HAVE_SHADOWGRP
|
||||
|
||||
/* Define if you have the shl_load function. */
|
||||
#undef HAVE_SHL_LOAD
|
||||
|
||||
@@ -260,15 +229,6 @@
|
||||
/* Define to 1 if `ut_xtime' is a member of `struct utmpx'. */
|
||||
#undef HAVE_STRUCT_UTMPX_UT_XTIME
|
||||
|
||||
/* Define to 1 if you have the <sys/capability.h> header file. */
|
||||
#undef HAVE_SYS_CAPABILITY_H
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/random.h> header file. */
|
||||
#undef HAVE_SYS_RANDOM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/statfs.h> header file. */
|
||||
#undef HAVE_SYS_STATFS_H
|
||||
|
||||
@@ -281,9 +241,6 @@
|
||||
/* Define to 1 if you have the <tcb.h> header file. */
|
||||
#undef HAVE_TCB_H
|
||||
|
||||
/* Define to 1 if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
@@ -296,9 +253,6 @@
|
||||
/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
#undef HAVE_UTMP_H
|
||||
|
||||
/* Define to support vendor settings. */
|
||||
#undef HAVE_VENDORDIR
|
||||
|
||||
@@ -341,12 +295,6 @@
|
||||
/* Path to passwd program. */
|
||||
#undef PASSWD_PROGRAM
|
||||
|
||||
/* Define if login should support the -r flag for rlogind. */
|
||||
#undef RLOGIN
|
||||
|
||||
/* Define to the ruserok() "success" return value (0 or 1). */
|
||||
#undef RUSEROK
|
||||
|
||||
/* Define to support the shadow group file. */
|
||||
#undef SHADOWGRP
|
||||
|
||||
@@ -518,14 +466,5 @@
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Path for utmp file. */
|
||||
#undef _UTMP_FILE
|
||||
|
||||
/* Path for wtmp file. */
|
||||
#undef _WTMP_FILE
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
72
configure.ac
72
configure.ac
@@ -1,10 +1,10 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ([2.69])
|
||||
m4_define([libsubid_abi_major], 4)
|
||||
m4_define([libsubid_abi_major], 5)
|
||||
m4_define([libsubid_abi_minor], 0)
|
||||
m4_define([libsubid_abi_micro], 0)
|
||||
m4_define([libsubid_abi], [libsubid_abi_major.libsubid_abi_minor.libsubid_abi_micro])
|
||||
AC_INIT([shadow], [4.15.3], [pkg-shadow-devel@lists.alioth.debian.org], [],
|
||||
AC_INIT([shadow], [4.17.4], [pkg-shadow-devel@lists.alioth.debian.org], [],
|
||||
[https://github.com/shadow-maint/shadow])
|
||||
AM_INIT_AUTOMAKE([1.11 foreign dist-xz subdir-objects tar-pax])
|
||||
AC_CONFIG_MACRO_DIRS([m4])
|
||||
@@ -36,20 +36,13 @@ LT_LIB_DLLOAD
|
||||
|
||||
dnl Checks for libraries.
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_CHECK_HEADERS(crypt.h utmp.h \
|
||||
termio.h sgtty.h sys/ioctl.h paths.h \
|
||||
sys/capability.h sys/random.h \
|
||||
gshadow.h lastlog.h rpc/key_prot.h acl/libacl.h \
|
||||
attr/libattr.h attr/error_context.h)
|
||||
|
||||
dnl shadow now uses the libc's shadow implementation
|
||||
AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
|
||||
|
||||
AC_CHECK_FUNCS(arc4random_buf futimes \
|
||||
getentropy getrandom getspnam getusershell \
|
||||
initgroups lckpwdf lutimes \
|
||||
setgroups updwtmpx innetgr \
|
||||
lckpwdf lutimes \
|
||||
updwtmpx innetgr \
|
||||
getspnam_r \
|
||||
rpmatch \
|
||||
memset_explicit explicit_bzero stpecpy stpeprintf)
|
||||
@@ -66,7 +59,6 @@ AC_CHECK_MEMBERS([struct utmpx.ut_name,
|
||||
struct utmpx.ut_xtime],,,[[#include <utmpx.h>]])
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_TYPE_GETGROUPS
|
||||
AC_FUNC_UTIME_NULL
|
||||
AC_REPLACE_FUNCS(putgrent putpwent putspent)
|
||||
AC_REPLACE_FUNCS(sgetgrent sgetpwent sgetspent)
|
||||
@@ -76,33 +68,6 @@ AC_CHECK_FUNC(secure_getenv, [AC_DEFINE(HAS_SECURE_GETENV,
|
||||
1,
|
||||
[Defined to 1 if you have the declaration of 'secure_getenv'])])
|
||||
|
||||
if test "$ac_cv_header_shadow_h" = "yes"; then
|
||||
AC_CACHE_CHECK(for working shadow group support,
|
||||
ac_cv_libc_shadowgrp,
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([
|
||||
#include <shadow.h>
|
||||
#ifdef HAVE_GSHADOW_H
|
||||
#include <gshadow.h>
|
||||
#endif
|
||||
int
|
||||
main()
|
||||
{
|
||||
struct sgrp *sg = sgetsgent("test:x::");
|
||||
/* NYS libc on Red Hat 3.0.3 has broken shadow group support */
|
||||
return !sg || !sg->sg_adm || !sg->sg_mem;
|
||||
}]
|
||||
)],
|
||||
[ac_cv_libc_shadowgrp=yes],
|
||||
[ac_cv_libc_shadowgrp=no],
|
||||
[ac_cv_libc_shadowgrp=no]
|
||||
)
|
||||
)
|
||||
|
||||
if test "$ac_cv_libc_shadowgrp" = "yes"; then
|
||||
AC_DEFINE(HAVE_SHADOWGRP, 1, [Have working shadow group support in libc])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([location of shared mail directory], shadow_cv_maildir,
|
||||
[for shadow_cv_maildir in /var/mail /var/spool/mail /usr/spool/mail /usr/mail none; do
|
||||
if test -d $shadow_cv_maildir; then
|
||||
@@ -125,18 +90,6 @@ if test $shadow_cv_mailfile != none; then
|
||||
[Name of user's mail spool file if stored in user's home directory.])
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([location of utmp], shadow_cv_utmpdir,
|
||||
[for shadow_cv_utmpdir in /var/run /var/adm /usr/adm /etc none; do
|
||||
if test -f $shadow_cv_utmpdir/utmp; then
|
||||
break
|
||||
fi
|
||||
done])
|
||||
if test "$shadow_cv_utmpdir" = "none"; then
|
||||
AC_MSG_WARN(utmp file not found)
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(_UTMP_FILE, "$shadow_cv_utmpdir/utmp",
|
||||
[Path for utmp file.])
|
||||
|
||||
AC_CACHE_CHECK([location of faillog/lastlog/wtmp], shadow_cv_logdir,
|
||||
[for shadow_cv_logdir in /var/log /var/adm /usr/adm /etc; do
|
||||
if test -d $shadow_cv_logdir; then
|
||||
@@ -150,22 +103,9 @@ AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$shadow_cv_logdir/lastlog",
|
||||
AC_DEFINE_UNQUOTED(FAILLOG_FILE, "$shadow_cv_logdir/faillog",
|
||||
[Path for faillog file.])
|
||||
|
||||
AC_CACHE_CHECK([location of the passwd program], shadow_cv_passwd_dir,
|
||||
[if test -f /usr/bin/passwd; then
|
||||
shadow_cv_passwd_dir=/usr/bin
|
||||
else
|
||||
shadow_cv_passwd_dir=/bin
|
||||
fi])
|
||||
AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$shadow_cv_passwd_dir/passwd",
|
||||
AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$exec_prefix/bin/passwd",
|
||||
[Path to passwd program.])
|
||||
|
||||
dnl XXX - quick hack, should disappear before anyone notices :).
|
||||
dnl XXX - I just read the above message :).
|
||||
if test "$ac_cv_func_ruserok" = "yes"; then
|
||||
AC_DEFINE(RLOGIN, 1, [Define if login should support the -r flag for rlogind.])
|
||||
AC_DEFINE(RUSEROK, 0, [Define to the ruserok() "success" return value (0 or 1).])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(shadowgrp,
|
||||
[AS_HELP_STRING([--enable-shadowgrp], [enable shadow group support @<:@default=yes@:>@])],
|
||||
[case "${enableval}" in
|
||||
@@ -696,7 +636,7 @@ AC_SUBST(LIBMD)
|
||||
if test "$with_skey" = "yes"; then
|
||||
AC_CHECK_LIB(md, MD5Init, [LIBMD=-lmd])
|
||||
AC_CHECK_LIB(skey, skeychallenge, [LIBSKEY=-lskey],
|
||||
[AC_MSG_ERROR([liskey missing. You can download S/Key source code from http://rsync1.it.gentoo.org/gentoo/distfiles/skey-1.1.5.tar.bz2])])
|
||||
[AC_MSG_ERROR([libskey missing. You can download S/Key source code from http://rsync1.it.gentoo.org/gentoo/distfiles/skey-1.1.5.tar.bz2])])
|
||||
AC_DEFINE(SKEY, 1, [Define to support S/Key logins.])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -161,7 +161,6 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
|
||||
@@ -118,6 +118,9 @@
|
||||
#include <sys/stat.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include "string/strcmp/streq.h"
|
||||
|
||||
|
||||
#define IMMEDIATE_CHANGE /* Expire newly created password, must be changed
|
||||
* immediately upon next login */
|
||||
#define HAVE_QUOTAS /* Obvious */
|
||||
@@ -291,12 +294,10 @@ main (void)
|
||||
printf ("Home Directory [%s/%s]: ", DEFAULT_HOME, usrname);
|
||||
fflush (stdout);
|
||||
safeget (dir, sizeof (dir));
|
||||
if (!strlen (dir))
|
||||
{ /* hit return */
|
||||
sprintf (dir, "%s/%s", DEFAULT_HOME, usrname);
|
||||
}
|
||||
if (!strlen(dir)) /* hit return */
|
||||
sprintf(dir, "%s/%s", DEFAULT_HOME, usrname);
|
||||
else if (dir[strlen (dir) - 1] == '/')
|
||||
sprintf (dir+strlen(dir), "%s", usrname);
|
||||
strcat(dir, usrname);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -308,7 +309,7 @@ main (void)
|
||||
fflush (stdout);
|
||||
safeget (shell, sizeof (shell));
|
||||
if (!strlen (shell))
|
||||
sprintf (shell, "%s", DEFAULT_SHELL);
|
||||
strcpy(shell, DEFAULT_SHELL);
|
||||
else
|
||||
{
|
||||
char *sh;
|
||||
@@ -316,7 +317,7 @@ main (void)
|
||||
#ifdef HAVE_GETUSERSHELL
|
||||
setusershell ();
|
||||
while ((sh = getusershell ()) != NULL)
|
||||
if (!strcmp (shell, sh))
|
||||
if (streq(shell, sh))
|
||||
ok = 1;
|
||||
endusershell ();
|
||||
#endif
|
||||
@@ -327,7 +328,7 @@ main (void)
|
||||
else
|
||||
{
|
||||
printf ("Shell NOT in /etc/shells, DEFAULT used\n");
|
||||
sprintf (shell, "%s", DEFAULT_SHELL);
|
||||
strcpy(shell, DEFAULT_SHELL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -491,12 +492,12 @@ safeget (char *buf, int maxlen)
|
||||
bad = (!isalnum (c) && (c != '_') && (c != ' '));
|
||||
*(buf++) = c;
|
||||
}
|
||||
*buf = '\0';
|
||||
stpcpy(buf, "");
|
||||
|
||||
if (bad)
|
||||
{
|
||||
printf ("\nString contained banned character. Please stick to alphanumerics.\n");
|
||||
*bstart = '\0';
|
||||
stpcpy(bstart, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
16
debian/Makefile
vendored
16
debian/Makefile
vendored
@@ -1,16 +0,0 @@
|
||||
PKG=shadow
|
||||
SITE=ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/
|
||||
|
||||
deb:: check_cheese
|
||||
|
||||
include /usr/share/quilt/quilt.debbuild.mk
|
||||
|
||||
check_cheese:
|
||||
@dpkg-parsechangelog | grep -q "\* The \".*\".* release\." || { \
|
||||
echo ""; \
|
||||
echo " ** **"; \
|
||||
echo " ** Warning: not a cheesy release! **"; \
|
||||
echo " ** **"; \
|
||||
echo ""; \
|
||||
exit 1; \
|
||||
}
|
||||
16
debian/NEWS
vendored
16
debian/NEWS
vendored
@@ -1,3 +1,19 @@
|
||||
shadow (1:4.17.0~rc1-1) unstable; urgency=medium
|
||||
|
||||
Username checking now once again follows the upstream rules, for
|
||||
an ecosystem-wide ruleset and security.
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sun, 22 Dec 2024 20:12:35 +0100
|
||||
|
||||
shadow (1:4.16.0-5) unstable; urgency=medium
|
||||
|
||||
/var/log/faillog and the programs to read it are no longer part since
|
||||
1:4.15.2-2.
|
||||
The file isn't cleaned up automatically, which should be done manually,
|
||||
unless it is still needed for special reasons.
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sat, 16 Nov 2024 15:48:35 +0100
|
||||
|
||||
shadow (1:4.13+dfsg1-2) unstable; urgency=medium
|
||||
|
||||
The previous entry falsely states that PREVENT_NO_AUTH in /etc/login.defs
|
||||
|
||||
13
debian/README.Debian
vendored
13
debian/README.Debian
vendored
@@ -1,13 +1,14 @@
|
||||
Read this file first for a brief overview of the new versions of login
|
||||
and passwd.
|
||||
Read this file first for a brief overview of the current version
|
||||
of passwd.
|
||||
|
||||
|
||||
---Shadow passwords
|
||||
|
||||
The command `shadowconfig on' will turn on shadow password support.
|
||||
`shadowconfig off' will turn it back off. If you turn on shadow
|
||||
password support, you'll gain the ability to set password ages and
|
||||
expirations with chage(1).
|
||||
This is the default. Turning off shadow passwords is not supported
|
||||
anymore.
|
||||
Together with shadow passwords, you get the ability to set password ages
|
||||
and expirations with chage(1).
|
||||
|
||||
NOTE: If you use the nscd package, you may have problems with a
|
||||
slight delay in updating the password information. You may notice
|
||||
@@ -27,7 +28,7 @@ support. PAM documentation is available in several formats in the
|
||||
libpam-doc package.
|
||||
|
||||
|
||||
---MD5 Encryption
|
||||
---Encryption
|
||||
|
||||
This is enabled now using the /etc/pam.d/* files. Examples are given.
|
||||
|
||||
|
||||
227
debian/changelog
vendored
227
debian/changelog
vendored
@@ -1,3 +1,230 @@
|
||||
shadow (1:4.17.4-2) unstable; urgency=medium
|
||||
|
||||
* Allow LOGIN_ENV_SAFELIST (from util-linux) in /etc/login.defs.
|
||||
Using patch from upstream.
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sat, 19 Apr 2025 12:20:28 +0200
|
||||
|
||||
shadow (1:4.17.4-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version 4.17.4
|
||||
* Rebase patches
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sat, 29 Mar 2025 13:28:35 +0100
|
||||
|
||||
shadow (1:4.17.3-3) unstable; urgency=medium
|
||||
|
||||
* Accept /usr/sbin/nologin as an alternate to /sbin/nologin.
|
||||
Thanks to Marc Haber
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Fri, 28 Mar 2025 12:13:03 +0100
|
||||
|
||||
shadow (1:4.17.3-2) unstable; urgency=medium
|
||||
|
||||
* Do not warn about useradd --system with Debian-globally allocated uids
|
||||
(Closes: #1100563)
|
||||
* Refresh patches
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sun, 16 Mar 2025 13:39:58 +0100
|
||||
|
||||
shadow (1:4.17.3-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version 4.17.3
|
||||
* Refresh patches and include upstream patch for getdate.
|
||||
Include https://github.com/shadow-maint/shadow/pull/1214 to fix
|
||||
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095430 in the
|
||||
way upstream intends to fix it.
|
||||
* Explicitly pass {s,}bindir to configure.
|
||||
Avoids upstream hacks in configure.
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Mon, 24 Feb 2025 23:09:52 +0100
|
||||
|
||||
shadow (1:4.17.2-6) unstable; urgency=medium
|
||||
|
||||
* d/rules: ensure lib/getdate.c gets rebuilt
|
||||
* configure: always pick /usr/bin/passwd.
|
||||
Thanks to Jochen Sprickerhof <jspricke@debian.org>
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Mon, 24 Feb 2025 12:16:49 +0100
|
||||
|
||||
shadow (1:4.17.2-5) unstable; urgency=medium
|
||||
|
||||
* Warn about future --badname removal.
|
||||
Upstream PR 1158 plans to remove this flag, probably in the forky
|
||||
timeframe. Warn users now.
|
||||
* Import upstream patch to fix chfn (#1096187)
|
||||
* Add regression test for #1096187
|
||||
* Add regression test for #1095430
|
||||
* Remove "shadowconfig off"
|
||||
If needed please run pwunconv, grpunconv manually, but please understand
|
||||
you are on your own.
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Mon, 17 Feb 2025 19:54:09 +0100
|
||||
|
||||
shadow (1:4.17.2-4) unstable; urgency=medium
|
||||
|
||||
* Revert upstreams chfn.c strsep change (Closes: #1096187)
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Mon, 17 Feb 2025 12:28:56 +0100
|
||||
|
||||
shadow (1:4.17.2-3) unstable; urgency=medium
|
||||
|
||||
* Revert upstreams strtoday calculation "fix" (Closes: #1095430)
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sun, 16 Feb 2025 20:24:35 +0100
|
||||
|
||||
shadow (1:4.17.2-2) unstable; urgency=medium
|
||||
|
||||
* Upload to unstable.
|
||||
* Apply upstream revert of "Use local time for human-readable dates"
|
||||
(Closes: #1095430)
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sat, 15 Feb 2025 17:21:17 +0100
|
||||
|
||||
shadow (1:4.17.2-1) experimental; urgency=medium
|
||||
|
||||
* New upstream version 4.17.2
|
||||
* Apply upstream patch from Marc Haber to document E_BAD_NAME
|
||||
* Refresh patches
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sun, 09 Feb 2025 18:14:51 +0100
|
||||
|
||||
shadow (1:4.17.1-2) experimental; urgency=medium
|
||||
|
||||
* Rewrite shadowconfig(8) manpage.
|
||||
Thanks to Alejandro Colomar <alx@kernel.org>
|
||||
* Remove unnecessary Build-Depends: quilt.
|
||||
Thanks to Bastian Germann (Closes: #1092461)
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Wed, 08 Jan 2025 12:40:10 +0100
|
||||
|
||||
shadow (1:4.17.1-1) experimental; urgency=medium
|
||||
|
||||
* New upstream version 4.17.1
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sat, 04 Jan 2025 12:41:51 +0100
|
||||
|
||||
shadow (1:4.17.0-1) experimental; urgency=medium
|
||||
|
||||
* New upstream version 4.17.0
|
||||
* Refresh patches.
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sat, 28 Dec 2024 13:14:16 +0100
|
||||
|
||||
shadow (1:4.17.0~rc1-2) experimental; urgency=medium
|
||||
|
||||
* Remove Debian patch to relax username checks.
|
||||
Per discussion on d-devel, with upstream, and with the
|
||||
adduser maintainer.
|
||||
Thanks: Marc Haber
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sun, 22 Dec 2024 20:15:16 +0100
|
||||
|
||||
shadow (1:4.17.0~rc1-1) experimental; urgency=medium
|
||||
|
||||
* New upstream version 4.17.0~rc1
|
||||
* Add upstream patch for new return-code for bad usernames
|
||||
* Refresh patches
|
||||
* d/copyright: update
|
||||
* Forbid purely numeric user/group names, and "." and ".."
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Fri, 06 Dec 2024 19:55:32 +0100
|
||||
|
||||
shadow (1:4.16.0-7) unstable; urgency=medium
|
||||
|
||||
[ Florent 'Skia' Jacquet ]
|
||||
* d/patches: fix 'upstream' test suite
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Fri, 06 Dec 2024 13:51:40 +0100
|
||||
|
||||
shadow (1:4.16.0-6) unstable; urgency=medium
|
||||
|
||||
* Add NEWS entry about faillog (Closes: #1074320)
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Fri, 06 Dec 2024 13:29:54 +0100
|
||||
|
||||
shadow (1:4.16.0-5) unstable; urgency=medium
|
||||
|
||||
[ Chris Hofstaedtler ]
|
||||
* Always build with btrfs support on linux-any (Closes: #856557)
|
||||
* debputy.manifest: merge path-metadata entries
|
||||
* login.defs: remove info about write(1)
|
||||
Which is not part of Debian trixie. (Closes: #1087519)
|
||||
|
||||
[ Pino Toscano ]
|
||||
* Include <utmpx.h>, fixing the build on GNU/Hurd
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Fri, 15 Nov 2024 20:30:32 +0100
|
||||
|
||||
shadow (1:4.16.0-4) unstable; urgency=medium
|
||||
|
||||
* Drop Debian-only cppw, cpgr tools (Closes: #750752)
|
||||
* Stop patching login, not installed anymore
|
||||
* Define LOGIN_NAME_MAX on HURD
|
||||
* Remove libsystemd-dev Build-Depends.
|
||||
Only necessary for login(1).
|
||||
* Stop building programs we do not install
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Tue, 06 Aug 2024 00:29:18 +0200
|
||||
|
||||
shadow (1:4.16.0-3) unstable; urgency=medium
|
||||
|
||||
* Upload to unstable.
|
||||
* Fix FTBFS on hurd.
|
||||
DEB_HOST_ARCH_OS was unset.
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Mon, 05 Aug 2024 17:21:27 +0200
|
||||
|
||||
shadow (1:4.16.0-2) experimental; urgency=medium
|
||||
|
||||
* passwd: switch Depends from login to login.defs
|
||||
login will again be installed on fewer systems, but existing installs
|
||||
will retain it (it is Protected: yes).
|
||||
* Drop login package, to allow takeover by util-linux.
|
||||
Move shadow.mo to Package: passwd, have passwd Replaces: older login.
|
||||
* login.defs: ship manpage
|
||||
* Re-add workarounds for tests in tests/tests directory.
|
||||
4.15.3 fixed this, but 4.16.0 happened earlier.
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Mon, 05 Aug 2024 02:36:29 +0200
|
||||
|
||||
shadow (1:4.16.0-1) experimental; urgency=medium
|
||||
|
||||
* New upstream version 4.16.0
|
||||
* Rebase patches
|
||||
* Split /etc/login.defs into its own binary package (Closes: #1074394)
|
||||
* Rename libsubid4 to libsubid5 (soname bump)
|
||||
* d/watch: add versionmangle for -rc
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Fri, 02 Aug 2024 17:35:29 +0200
|
||||
|
||||
shadow (1:4.15.3-3) unstable; urgency=medium
|
||||
|
||||
* Forbid backslashes in user/group-names.
|
||||
They can still be used with --force-badname, but it's a start. In the
|
||||
long run I want to remove our relax patch, and upstream should fix the
|
||||
line continuation too. For #1076619.
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sun, 21 Jul 2024 21:05:32 +0200
|
||||
|
||||
shadow (1:4.15.3-2) unstable; urgency=medium
|
||||
|
||||
[ Pino Toscano ]
|
||||
* d/rules: actually enable Linux-only options on Linux
|
||||
This enables --enable-logind and --with-audit.
|
||||
|
||||
[ Chris Hofstaedtler ]
|
||||
* Stop installing groupmems(8) (Closes: #1004472, LP: #2039541)
|
||||
* login.defs: remove obsolete/confusing comments
|
||||
* login.defs: resync comments with upstream
|
||||
* login.defs: remove incomplete list of unused vars
|
||||
* login.defs: remove obscure, defaulted vars
|
||||
* login.defs: remove vars ignored by su(1)
|
||||
* login.defs: remove CONSOLE_GROUPS, ignored with PAM
|
||||
* login.defs: remove CONSOLE, ignored with PAM
|
||||
|
||||
-- Chris Hofstaedtler <zeha@debian.org> Sun, 07 Jul 2024 15:30:38 +0200
|
||||
|
||||
shadow (1:4.15.3-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version 4.15.3
|
||||
|
||||
34
debian/control
vendored
34
debian/control
vendored
@@ -23,10 +23,8 @@ Build-Depends:
|
||||
libpam0g-dev,
|
||||
libselinux1-dev [linux-any],
|
||||
libsemanage-dev [linux-any],
|
||||
libsystemd-dev [linux-any],
|
||||
libxml2-utils <!nodoc>,
|
||||
pkgconf,
|
||||
quilt,
|
||||
systemd-dev [linux-any],
|
||||
xsltproc <!nodoc>
|
||||
Standards-Version: 4.7.0
|
||||
@@ -41,33 +39,25 @@ Multi-Arch: foreign
|
||||
Depends:
|
||||
base-passwd (>= 3.6.4),
|
||||
libpam-modules,
|
||||
login
|
||||
login.defs
|
||||
Recommends:
|
||||
sensible-utils
|
||||
Replaces:
|
||||
login (<< 1:4.16.0-2~)
|
||||
Description: change and administer password and group data
|
||||
This package includes passwd, chsh, chfn, and many other programs to
|
||||
maintain password and group data.
|
||||
.
|
||||
Shadow passwords are supported. See /usr/share/doc/passwd/README.Debian
|
||||
|
||||
Package: login
|
||||
Architecture: any
|
||||
Package: login.defs
|
||||
Architecture: all
|
||||
Multi-Arch: foreign
|
||||
Protected: yes
|
||||
Depends:
|
||||
libpam-modules,
|
||||
libpam-runtime
|
||||
Breaks:
|
||||
hurd (<< 20140206~) [hurd-any]
|
||||
Conflicts:
|
||||
python-4suite (<< 0.99cvs20060405-1)
|
||||
Replaces:
|
||||
hurd (<< 20140206~) [hurd-any]
|
||||
Description: system login tools
|
||||
This package provides support for console-based logins and for
|
||||
changing effective user or group IDs, including:
|
||||
* login, the program that invokes a user shell on a virtual terminal;
|
||||
* nologin, a dummy shell for disabled user accounts;
|
||||
login (<< 1:4.16.0-2~)
|
||||
Description: system user management configuration
|
||||
This package provides the login.defs configuration file,
|
||||
used by otherwise unrelated tools managing system users.
|
||||
|
||||
Package: uidmap
|
||||
Architecture: any
|
||||
@@ -77,7 +67,7 @@ Description: programs to help use subuids
|
||||
These programs help unprivileged users to create uid and gid mappings in
|
||||
user namespaces.
|
||||
|
||||
Package: libsubid4
|
||||
Package: libsubid5
|
||||
Section: libs
|
||||
Priority: optional
|
||||
Architecture: any
|
||||
@@ -92,10 +82,10 @@ Priority: optional
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends:
|
||||
libsubid4 (= ${binary:Version})
|
||||
libsubid5 (= ${binary:Version})
|
||||
Description: subordinate id handling library -- shared library
|
||||
The library provides an interface for querying, granding and ungranting
|
||||
subordinate user and group ids.
|
||||
.
|
||||
This package contains the C header files that are
|
||||
needed for applications to use the libsubid4 library.
|
||||
needed for applications to use the libsubid library.
|
||||
|
||||
18
debian/copyright
vendored
18
debian/copyright
vendored
@@ -4,7 +4,7 @@ Source: https://github.com/shadow-maint/shadow
|
||||
|
||||
Files: *
|
||||
Copyright: 1989-1994, Julianne Frances Haugh
|
||||
2016-2022, Serge Hallyn <serge@hallyn.com>
|
||||
2016-2024, Serge Hallyn <serge@hallyn.com>
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: man/po/da.po
|
||||
@@ -57,8 +57,7 @@ Files: man/id/man1/login.1
|
||||
Copyright: 1993, Rickard E. Faith <faith@cs.unc.edu>
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: man/ja/man1/groups.1
|
||||
man/ja/man5/limits.5
|
||||
Files: man/ja/man5/limits.5
|
||||
man/ja/man8/vipw.8
|
||||
Copyright: 2001, Maki KURODA
|
||||
License: BSD-3-clause
|
||||
@@ -78,6 +77,10 @@ Files: man/po/fr.po
|
||||
Copyright: 2011-2013, Debian French l10n team <debian-l10n-french@lists.debian.org>
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: man/shadowconfig.8
|
||||
Copyright: 2025 Alejandro Colomar <alx@kernel.org>
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: man/zh_TW/man5/*
|
||||
Copyright: 1993, Michael Haardt <michael@moria.de>
|
||||
1993, Scorpio, www.linuxforum.net
|
||||
@@ -99,10 +102,6 @@ Files: man/hu/man1/su.1
|
||||
Copyright: 1999, Ragnar Hojland Espinosa <ragnar@macula.net>
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: man/ja/man1/id.1
|
||||
Copyright: 2000, ISHIKAWA Keisuke
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: man/ja/man8/pwconv.8
|
||||
Copyright: 2001, Yuichi SATO
|
||||
License: BSD-3-clause
|
||||
@@ -137,11 +136,6 @@ Copyright: 1999-2001, Ben Collins <bcollins@debian.org>
|
||||
2017-2022 Balint Reczey <balint@balintreczey.hu>
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: debian/patches/cppw-Add-tool.patch
|
||||
Copyright: 1997, Guy Maor <maor@ece.utexas.edu>
|
||||
1999, Stephen Frost <sfrost@snowman.net>
|
||||
License: GPL-2+
|
||||
|
||||
Files: debian/passwd.expire.cron
|
||||
Copyright: 1999, Ben Collins <bcollins@debian.org>
|
||||
License: BSD-3-clause
|
||||
|
||||
1
debian/cpgr.8
vendored
1
debian/cpgr.8
vendored
@@ -1 +0,0 @@
|
||||
.so man8/cppw.8
|
||||
27
debian/cppw.8
vendored
27
debian/cppw.8
vendored
@@ -1,27 +0,0 @@
|
||||
.TH CPPW 8 "7 Apr 2005"
|
||||
.SH NAME
|
||||
cppw, cpgr \- copy with locking the given file to the password or group file
|
||||
.SH SYNOPSIS
|
||||
\fBcppw\fR [\fB\-h\fR] [\fB\-s\fR] password_file
|
||||
.br
|
||||
\fBcpgr\fR [\fB\-h\fR] [\fB\-s\fR] group_file
|
||||
|
||||
.SH DESCRIPTION
|
||||
.BR cppw " and " cpgr
|
||||
will copy, with locking, the given file to
|
||||
.IR /etc/passwd " and " /etc/group ", respectively."
|
||||
With the \fB\-s\fR flag, they will copy the shadow versions of those files,
|
||||
.IR /etc/shadow " and " /etc/gshadow ", respectively."
|
||||
|
||||
With the \fB\-h\fR flag, the commands display a short help message and exit
|
||||
silently.
|
||||
.SH "SEE ALSO"
|
||||
.BR vipw (8),
|
||||
.BR vigr (8),
|
||||
.BR group (5),
|
||||
.BR passwd (5),
|
||||
.BR shadow (5),
|
||||
.BR gshadow (5)
|
||||
.SH AUTHOR
|
||||
\fBcppw\fR and \fBcpgr\fR were written by Stephen Frost, based on
|
||||
\fBvipw\fR and \fBvigr\fR written by Guy Maor.
|
||||
35
debian/debputy.manifest
vendored
35
debian/debputy.manifest
vendored
@@ -3,35 +3,22 @@ packages:
|
||||
passwd:
|
||||
transformations:
|
||||
- path-metadata:
|
||||
path: usr/bin/chfn
|
||||
paths:
|
||||
- usr/bin/chfn
|
||||
- usr/bin/chsh
|
||||
- usr/bin/gpasswd
|
||||
- usr/bin/passwd
|
||||
mode: "u=rwxs,go=rx"
|
||||
- path-metadata:
|
||||
path: usr/bin/chsh
|
||||
mode: "u=rwxs,go=rx"
|
||||
- path-metadata:
|
||||
path: usr/bin/gpasswd
|
||||
mode: "u=rwxs,go=rx"
|
||||
- path-metadata:
|
||||
path: usr/bin/passwd
|
||||
mode: "u=rwxs,go=rx"
|
||||
- path-metadata:
|
||||
path: usr/bin/chage
|
||||
paths:
|
||||
- usr/bin/chage
|
||||
- usr/bin/expiry
|
||||
group: "shadow"
|
||||
mode: "u=rwx,go=rxs"
|
||||
- path-metadata:
|
||||
path: usr/bin/expiry
|
||||
group: "shadow"
|
||||
mode: "u=rwx,go=rxs"
|
||||
login:
|
||||
transformations:
|
||||
- path-metadata:
|
||||
path: usr/bin/newgrp
|
||||
mode: "u=rwxs,go=rx"
|
||||
uidmap:
|
||||
transformations:
|
||||
- path-metadata:
|
||||
path: usr/bin/newgidmap
|
||||
mode: "u=rwxs,go=rx"
|
||||
- path-metadata:
|
||||
path: usr/bin/newuidmap
|
||||
paths:
|
||||
- usr/bin/newgidmap
|
||||
- usr/bin/newuidmap
|
||||
mode: "u=rwxs,go=rx"
|
||||
|
||||
78
debian/dependencies
vendored
78
debian/dependencies
vendored
@@ -1,19 +1,7 @@
|
||||
Build-Depends:
|
||||
==============
|
||||
* autoconf
|
||||
* automake1.9
|
||||
works with 1.7 or 1.9 (at least)
|
||||
* libtool
|
||||
* gettext
|
||||
POT, PO, GMO regenerated?
|
||||
* libpam0g-dev
|
||||
OK
|
||||
* debhelper (>= 4.1.16)
|
||||
* po-debconf
|
||||
OK
|
||||
* quilt
|
||||
patch system
|
||||
* dpkg-dev (>= 1.13.5)
|
||||
* xsltproc
|
||||
used to generate the manpages
|
||||
* docbook-xsl
|
||||
@@ -25,70 +13,4 @@ Build-Depends:
|
||||
Needed by JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN], [DocBook XML DTD V4.1.2], [], enable_man=no)
|
||||
* libxml2-utils
|
||||
needed by the JH_CHECK_XML_CATALOG macros
|
||||
* cdbs
|
||||
used in debian/rules
|
||||
* libselinux1-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
|
||||
* gnome-doc-utils (>= 0.4.3-1)
|
||||
xml2po, 0.4.3-1 needed for the -l switch.
|
||||
|
||||
passwd Depends:
|
||||
===============
|
||||
* ${shlibs:Depends}
|
||||
OK
|
||||
* ${loginpam}
|
||||
- hurd
|
||||
login
|
||||
libpam-modules (>= 0.72-5)
|
||||
- other archs
|
||||
+ login (>= 970502-1)
|
||||
login is needed because some passwd utils need /etc/login.defs
|
||||
login is Essential, so this is just to enforce the version
|
||||
+ libpam-modules (>= 0.72-5)
|
||||
* debianutils (>= 2.15.2)
|
||||
After 1:4.0.12-6, {add,remove}-shell are distributed in debianutils (2.15)
|
||||
/etc/shell was forgotten and introduced in debianutils in 2.15.2
|
||||
|
||||
passwd Conflicts:
|
||||
=================
|
||||
|
||||
passwd Replaces:
|
||||
================
|
||||
Some of the passwd man pages are also distributed in some manpages* packages.
|
||||
Look at the debian/02/run test to optimize these dependencies.
|
||||
NOTE: Not all maintainers have been notified.
|
||||
* manpages-de (<< 0.4-9), manpages-fi (<< 0.2-4), manpages-fr (<<1.64.0-1), manpages-hu (<< 20010119-5), manpages-it (<< 0.3.4-3), manpages-ja (<< 0.5.0.0.20050915-1), manpages-ko (<< 20050219-2), manpages-es (<< 1.55-4), manpages-es-extra (<< 0.8a-15), manpages-ru (<< 0.98-3)
|
||||
All those packages have been updated during sarge->etch. So these Replaces
|
||||
should be removed after lenny release
|
||||
* manpages-tr, manpages-zh
|
||||
Those packages are still in etch, so the Replaces should be kept even
|
||||
after lenny release
|
||||
|
||||
login Pre-Depends:
|
||||
==================
|
||||
* ${shlibs:Depends}
|
||||
* libpam-runtime (>= 0.76-14)
|
||||
sarge contained 0.76-22
|
||||
|
||||
Why Pre-Depends? (because it's an essential package?)
|
||||
|
||||
login Depends:
|
||||
==============
|
||||
* libpam-modules (>= 0.72-5)
|
||||
libpam-modules is needed.
|
||||
potato contained 0.72-9
|
||||
|
||||
login Conflicts:
|
||||
================
|
||||
|
||||
login Replaces:
|
||||
===============
|
||||
* Some of the login man pages are also distributed in some manpages* packages.
|
||||
Look at the debian/02/run test to optimize these dependencies.
|
||||
NOTE: Not all maintainers have been notified.
|
||||
- manpages-fi, manpages-fr (<<1.64.0-1), manpages-hu, manpages-it, manpages-ko, manpages-ja (<< 0.5.0.0.20050915-1), manpages-de (<< 0.4-10), manpages-es-extra (<<0.8a-15)
|
||||
Those are packages that have been updated during sarge->etch. These
|
||||
Replaces should be removed after lenny
|
||||
- manpages-tr, manpages-zh
|
||||
Those packages are still in etch, so the Replaces should be kept even
|
||||
after lenny release
|
||||
|
||||
|
||||
7
debian/gbp.conf
vendored
Normal file
7
debian/gbp.conf
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
[DEFAULT]
|
||||
upstream-branch = upstream
|
||||
pristine-tar = True
|
||||
sign-tags = True
|
||||
|
||||
[pq]
|
||||
patch-numbers = False
|
||||
10
debian/libsubid4.symbols
vendored
10
debian/libsubid4.symbols
vendored
@@ -1,10 +0,0 @@
|
||||
libsubid.so.4 libsubid4 #MINVER#
|
||||
subid_get_gid_owners@Base 1:4.11.1
|
||||
subid_get_gid_ranges@Base 1:4.11.1
|
||||
subid_get_uid_owners@Base 1:4.11.1
|
||||
subid_get_uid_ranges@Base 1:4.11.1
|
||||
subid_grant_gid_range@Base 1:4.11.1
|
||||
subid_grant_uid_range@Base 1:4.11.1
|
||||
subid_init@Base 1:4.11.1
|
||||
subid_ungrant_gid_range@Base 1:4.11.1
|
||||
subid_ungrant_uid_range@Base 1:4.11.1
|
||||
11
debian/libsubid5.symbols
vendored
Normal file
11
debian/libsubid5.symbols
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
libsubid.so.5 libsubid5 #MINVER#
|
||||
subid_free@Base 1:4.16.0
|
||||
subid_get_gid_owners@Base 1:4.16.0
|
||||
subid_get_gid_ranges@Base 1:4.16.0
|
||||
subid_get_uid_owners@Base 1:4.16.0
|
||||
subid_get_uid_ranges@Base 1:4.16.0
|
||||
subid_grant_gid_range@Base 1:4.16.0
|
||||
subid_grant_uid_range@Base 1:4.16.0
|
||||
subid_init@Base 1:4.16.0
|
||||
subid_ungrant_gid_range@Base 1:4.16.0
|
||||
subid_ungrant_uid_range@Base 1:4.16.0
|
||||
324
debian/login.defs
vendored
324
debian/login.defs
vendored
@@ -1,324 +0,0 @@
|
||||
#
|
||||
# /etc/login.defs - Configuration control definitions for the login package.
|
||||
#
|
||||
# Three items must be defined: MAIL_DIR, ENV_SUPATH, and ENV_PATH.
|
||||
# If unspecified, some arbitrary (and possibly incorrect) value will
|
||||
# be assumed. All other items are optional - if not specified then
|
||||
# the described action or option will be inhibited.
|
||||
#
|
||||
# Comment lines (lines beginning with "#") and blank lines are ignored.
|
||||
#
|
||||
# Modified for Linux. --marekm
|
||||
|
||||
# REQUIRED for useradd/userdel/usermod
|
||||
# Directory where mailboxes reside, _or_ name of file, relative to the
|
||||
# home directory. If you _do_ define MAIL_DIR and MAIL_FILE,
|
||||
# MAIL_DIR takes precedence.
|
||||
#
|
||||
# Essentially:
|
||||
# - MAIL_DIR defines the location of users mail spool files
|
||||
# (for mbox use) by appending the username to MAIL_DIR as defined
|
||||
# below.
|
||||
# - MAIL_FILE defines the location of the users mail spool files as the
|
||||
# fully-qualified filename obtained by prepending the user home
|
||||
# directory before $MAIL_FILE
|
||||
#
|
||||
# NOTE: This is no more used for setting up users MAIL environment variable
|
||||
# which is, starting from shadow 4.0.12-1 in Debian, entirely the
|
||||
# job of the pam_mail PAM modules
|
||||
# See default PAM configuration files provided for
|
||||
# login, su, etc.
|
||||
#
|
||||
# This is a temporary situation: setting these variables will soon
|
||||
# move to /etc/default/useradd and the variables will then be
|
||||
# no more supported
|
||||
MAIL_DIR /var/mail
|
||||
#MAIL_FILE .mail
|
||||
|
||||
#
|
||||
# Enable display of unknown usernames when login failures are recorded.
|
||||
#
|
||||
# WARNING: Unknown usernames may become world readable.
|
||||
# See #290803 and #298773 for details about how this could become a security
|
||||
# concern
|
||||
LOG_UNKFAIL_ENAB no
|
||||
|
||||
#
|
||||
# Enable logging of successful logins
|
||||
#
|
||||
LOG_OK_LOGINS no
|
||||
|
||||
#
|
||||
# Enable "syslog" logging of su activity - in addition to sulog file logging.
|
||||
# SYSLOG_SG_ENAB does the same for newgrp and sg.
|
||||
#
|
||||
SYSLOG_SU_ENAB yes
|
||||
SYSLOG_SG_ENAB yes
|
||||
|
||||
#
|
||||
# If defined, all su activity is logged to this file.
|
||||
#
|
||||
#SULOG_FILE /var/log/sulog
|
||||
|
||||
#
|
||||
# If defined, file which maps tty line to TERM environment parameter.
|
||||
# Each line of the file is in a format something like "vt100 tty01".
|
||||
#
|
||||
#TTYTYPE_FILE /etc/ttytype
|
||||
|
||||
#
|
||||
# If defined, the command name to display when running "su -". For
|
||||
# example, if this is defined as "su" then a "ps" will display the
|
||||
# command is "-su". If not defined, then "ps" would display the
|
||||
# name of the shell actually being run, e.g. something like "-sh".
|
||||
#
|
||||
SU_NAME su
|
||||
|
||||
#
|
||||
# If defined, file which inhibits all the usual chatter during the login
|
||||
# sequence. If a full pathname, then hushed mode will be enabled if the
|
||||
# user's name or shell are found in the file. If not a full pathname, then
|
||||
# hushed mode will be enabled if the file exists in the user's home directory.
|
||||
#
|
||||
HUSHLOGIN_FILE .hushlogin
|
||||
#HUSHLOGIN_FILE /etc/hushlogins
|
||||
|
||||
#
|
||||
# *REQUIRED* The default PATH settings, for superuser and normal users.
|
||||
#
|
||||
# (they are minimal, add the rest in the shell startup files)
|
||||
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
|
||||
|
||||
#
|
||||
# Terminal permissions
|
||||
#
|
||||
# TTYGROUP Login tty will be assigned this group ownership.
|
||||
# TTYPERM Login tty will be set to this permission.
|
||||
#
|
||||
# If you have a "write" program which is "setgid" to a special group
|
||||
# which owns the terminals, define TTYGROUP to the group number and
|
||||
# TTYPERM to 0620. Otherwise leave TTYGROUP commented out and assign
|
||||
# TTYPERM to either 622 or 600.
|
||||
#
|
||||
# In Debian /usr/bin/bsd-write or similar programs are setgid tty
|
||||
# However, the default and recommended value for TTYPERM is still 0600
|
||||
# to not allow anyone to write to anyone else console or terminal
|
||||
|
||||
# Users can still allow other people to write them by issuing
|
||||
# the "mesg y" command.
|
||||
|
||||
TTYGROUP tty
|
||||
TTYPERM 0600
|
||||
|
||||
#
|
||||
# Login configuration initializations:
|
||||
#
|
||||
# ERASECHAR Terminal ERASE character ('\010' = backspace).
|
||||
# KILLCHAR Terminal KILL character ('\025' = CTRL/U).
|
||||
#
|
||||
# The ERASECHAR and KILLCHAR are used only on System V machines.
|
||||
#
|
||||
ERASECHAR 0177
|
||||
KILLCHAR 025
|
||||
|
||||
# HOME_MODE is used by useradd(8) and newusers(8) to set the mode for new
|
||||
# home directories.
|
||||
HOME_MODE 0700
|
||||
|
||||
#
|
||||
# Password aging controls:
|
||||
#
|
||||
# PASS_MAX_DAYS Maximum number of days a password may be used.
|
||||
# PASS_MIN_DAYS Minimum number of days allowed between password changes.
|
||||
# PASS_WARN_AGE Number of days warning given before a password expires.
|
||||
#
|
||||
PASS_MAX_DAYS 99999
|
||||
PASS_MIN_DAYS 0
|
||||
PASS_WARN_AGE 7
|
||||
|
||||
#
|
||||
# Min/max values for automatic uid selection in useradd
|
||||
#
|
||||
UID_MIN 1000
|
||||
UID_MAX 60000
|
||||
# System accounts
|
||||
#SYS_UID_MIN 100
|
||||
#SYS_UID_MAX 999
|
||||
# Extra per user uids
|
||||
SUB_UID_MIN 100000
|
||||
SUB_UID_MAX 600100000
|
||||
SUB_UID_COUNT 65536
|
||||
|
||||
#
|
||||
# Min/max values for automatic gid selection in groupadd
|
||||
#
|
||||
GID_MIN 1000
|
||||
GID_MAX 60000
|
||||
# System accounts
|
||||
#SYS_GID_MIN 100
|
||||
#SYS_GID_MAX 999
|
||||
# Extra per user group ids
|
||||
SUB_GID_MIN 100000
|
||||
SUB_GID_MAX 600100000
|
||||
SUB_GID_COUNT 65536
|
||||
|
||||
#
|
||||
# Max number of login retries if password is bad. This will most likely be
|
||||
# overriden by PAM, since the default pam_unix module has it's own built
|
||||
# in of 3 retries. However, this is a safe fallback in case you are using
|
||||
# an authentication module that does not enforce PAM_MAXTRIES.
|
||||
#
|
||||
LOGIN_RETRIES 5
|
||||
|
||||
#
|
||||
# Max time in seconds for login
|
||||
#
|
||||
LOGIN_TIMEOUT 60
|
||||
|
||||
#
|
||||
# Which fields may be changed by regular users using chfn - use
|
||||
# any combination of letters "frwh" (full name, room number, work
|
||||
# phone, home phone). If not defined, no changes are allowed.
|
||||
# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
|
||||
#
|
||||
CHFN_RESTRICT rwh
|
||||
|
||||
#
|
||||
# Should login be allowed if we can't cd to the home directory?
|
||||
# Default is no.
|
||||
#
|
||||
DEFAULT_HOME yes
|
||||
|
||||
#
|
||||
# If defined, this command is run when removing a user.
|
||||
# It should remove any at/cron/print jobs etc. owned by
|
||||
# the user to be removed (passed as the first argument).
|
||||
#
|
||||
#USERDEL_CMD /usr/sbin/userdel_local
|
||||
|
||||
#
|
||||
# If set to yes, userdel will remove the user's group if it contains no
|
||||
# more members, and useradd will create by default a group with the name
|
||||
# of the user.
|
||||
#
|
||||
# Other former uses of this variable such as setting the umask when
|
||||
# user==primary group are not used in PAM environments, such as Debian
|
||||
#
|
||||
USERGROUPS_ENAB yes
|
||||
|
||||
#
|
||||
# Instead of the real user shell, the program specified by this parameter
|
||||
# will be launched, although its visible name (argv[0]) will be the shell's.
|
||||
# The program may do whatever it wants (logging, additional authentification,
|
||||
# banner, ...) before running the actual shell.
|
||||
#
|
||||
# FAKE_SHELL /bin/fakeshell
|
||||
|
||||
#
|
||||
# If defined, either full pathname of a file containing device names or
|
||||
# a ":" delimited list of device names. Root logins will be allowed only
|
||||
# upon these devices.
|
||||
#
|
||||
# This variable is used by login and su.
|
||||
#
|
||||
#CONSOLE /etc/consoles
|
||||
#CONSOLE console:tty01:tty02:tty03:tty04
|
||||
|
||||
#
|
||||
# List of groups to add to the user's supplementary group set
|
||||
# when logging in on the console (as determined by the CONSOLE
|
||||
# setting). Default is none.
|
||||
#
|
||||
# Use with caution - it is possible for users to gain permanent
|
||||
# access to these groups, even when not logged in on the console.
|
||||
# How to do it is left as an exercise for the reader...
|
||||
#
|
||||
# This variable is used by login and su.
|
||||
#
|
||||
#CONSOLE_GROUPS floppy:audio:cdrom
|
||||
|
||||
#
|
||||
# If set to MD5, MD5-based algorithm will be used for encrypting password
|
||||
# If set to SHA256, SHA256-based algorithm will be used for encrypting password
|
||||
# If set to SHA512, SHA512-based algorithm will be used for encrypting password
|
||||
# If set to BCRYPT, BCRYPT-based algorithm will be used for encrypting password
|
||||
# If set to YESCRYPT, YESCRYPT-based algorithm will be used for encrypting password
|
||||
# If set to DES, DES-based algorithm will be used for encrypting password (default)
|
||||
# MD5 and DES should not be used for new hashes, see crypt(5) for recommendations.
|
||||
# Overrides the MD5_CRYPT_ENAB option
|
||||
#
|
||||
# Note: It is recommended to use a value consistent with
|
||||
# the PAM modules configuration.
|
||||
#
|
||||
ENCRYPT_METHOD YESCRYPT
|
||||
|
||||
#
|
||||
# The pwck(8) utility emits a warning for any system account with a home
|
||||
# directory that does not exist. Some system accounts intentionally do
|
||||
# not have a home directory. Such accounts may have this string as
|
||||
# their home directory in /etc/passwd to avoid a spurious warning.
|
||||
#
|
||||
NONEXISTENT /nonexistent
|
||||
|
||||
#
|
||||
# Allow newuidmap and newgidmap when running under an alternative
|
||||
# primary group.
|
||||
#
|
||||
#GRANT_AUX_GROUP_SUBIDS yes
|
||||
|
||||
#
|
||||
# Select the HMAC cryptography algorithm.
|
||||
# Used in pam_timestamp module to calculate the keyed-hash message
|
||||
# authentication code.
|
||||
#
|
||||
# Note: It is recommended to check hmac(3) to see the possible algorithms
|
||||
# that are available in your system.
|
||||
#
|
||||
#HMAC_CRYPTO_ALGO SHA512
|
||||
|
||||
################# OBSOLETED BY PAM ##############
|
||||
# #
|
||||
# These options are now handled by PAM. Please #
|
||||
# edit the appropriate file in /etc/pam.d/ to #
|
||||
# enable the equivelants of them.
|
||||
#
|
||||
###############
|
||||
|
||||
#MOTD_FILE
|
||||
#DIALUPS_CHECK_ENAB
|
||||
#LASTLOG_ENAB
|
||||
#MAIL_CHECK_ENAB
|
||||
#OBSCURE_CHECKS_ENAB
|
||||
#PORTTIME_CHECKS_ENAB
|
||||
#SU_WHEEL_ONLY
|
||||
#CRACKLIB_DICTPATH
|
||||
#PASS_CHANGE_TRIES
|
||||
#PASS_ALWAYS_WARN
|
||||
#ENVIRON_FILE
|
||||
#NOLOGINS_FILE
|
||||
#ISSUE_FILE
|
||||
#PASS_MIN_LEN
|
||||
#PASS_MAX_LEN
|
||||
#ULIMIT
|
||||
#ENV_HZ
|
||||
#CHFN_AUTH
|
||||
#CHSH_AUTH
|
||||
#FAIL_DELAY
|
||||
|
||||
################# OBSOLETED #######################
|
||||
# #
|
||||
# These options are no more handled by shadow. #
|
||||
# #
|
||||
# Shadow utilities will display a warning if they #
|
||||
# still appear. #
|
||||
# #
|
||||
###################################################
|
||||
|
||||
# CLOSE_SESSIONS
|
||||
# LOGIN_STRING
|
||||
# NO_PASSWORD_CONSOLE
|
||||
# QMAIL_DIR
|
||||
|
||||
|
||||
|
||||
1
debian/login.defs.install
vendored
Normal file
1
debian/login.defs.install
vendored
Normal file
@@ -0,0 +1 @@
|
||||
etc/login.defs etc
|
||||
2
debian/login.defs.manpages
vendored
Normal file
2
debian/login.defs.manpages
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
usr/share/man/*/man5/login.defs.5
|
||||
usr/share/man/man5/login.defs.5
|
||||
26
debian/login.defs.postinst
vendored
Normal file
26
debian/login.defs.postinst
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
_adopt_conffile() {
|
||||
conffile=$1
|
||||
pkg=$2
|
||||
|
||||
[ -f ${conffile}.dpkg-bak ] || return 0
|
||||
|
||||
md5sum="$(md5sum ${conffile} | sed -e 's/ .*//')"
|
||||
old_md5sum="$(dpkg-query -W -f='${Conffiles}' $pkg | \
|
||||
sed -n -e "\' ${conffile} ' { s/ obsolete$//; s/.* //; p }")"
|
||||
# On new installs, if the conffile was preserved on upgrade by
|
||||
# dpkg-maintscript helper, copy it back if the new file has not been
|
||||
# modified yet
|
||||
if [ "$md5sum" = "$old_md5sum" ]; then
|
||||
mv ${conffile}.dpkg-bak ${conffile}
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$1" = configure ] && [ -z "$2" ]; then
|
||||
_adopt_conffile /etc/login.defs login.defs
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
1
debian/login.dirs
vendored
1
debian/login.dirs
vendored
@@ -1 +0,0 @@
|
||||
usr/share/lintian/overrides
|
||||
5
debian/login.install
vendored
5
debian/login.install
vendored
@@ -1,5 +0,0 @@
|
||||
bin/login usr/bin
|
||||
debian/login.defs etc
|
||||
sbin/nologin usr/sbin
|
||||
usr/bin/newgrp
|
||||
usr/share/locale/*/LC_MESSAGES/shadow.mo
|
||||
1
debian/login.links
vendored
1
debian/login.links
vendored
@@ -1 +0,0 @@
|
||||
usr/bin/newgrp usr/bin/sg
|
||||
1
debian/login.lintian-overrides
vendored
1
debian/login.lintian-overrides
vendored
@@ -1 +0,0 @@
|
||||
login: elevated-privileges 4755 root/root [usr/bin/newgrp]
|
||||
1
debian/login.maintscript
vendored
1
debian/login.maintscript
vendored
@@ -1 +0,0 @@
|
||||
rm_conffile /etc/securetty 1:4.7-1~
|
||||
10
debian/login.manpages
vendored
10
debian/login.manpages
vendored
@@ -1,10 +0,0 @@
|
||||
usr/share/man/*/man1/login.1
|
||||
usr/share/man/*/man1/newgrp.1
|
||||
usr/share/man/*/man1/sg.1
|
||||
usr/share/man/*/man5/login.defs.5
|
||||
usr/share/man/*/man8/nologin.8
|
||||
usr/share/man/man1/login.1
|
||||
usr/share/man/man1/newgrp.1
|
||||
usr/share/man/man1/sg.1
|
||||
usr/share/man/man5/login.defs.5
|
||||
usr/share/man/man8/nologin.8
|
||||
96
debian/login.pam
vendored
96
debian/login.pam
vendored
@@ -1,96 +0,0 @@
|
||||
#
|
||||
# The PAM configuration file for the Shadow `login' service
|
||||
#
|
||||
|
||||
# Enforce a minimal delay in case of failure (in microseconds).
|
||||
# (Replaces the `FAIL_DELAY' setting from login.defs)
|
||||
# Note that other modules may require another minimal delay. (for example,
|
||||
# to disable any delay, you should add the nodelay option to pam_unix)
|
||||
auth optional pam_faildelay.so delay=3000000
|
||||
|
||||
# Outputs an issue file prior to each login prompt (Replaces the
|
||||
# ISSUE_FILE option from login.defs). Uncomment for use
|
||||
# auth required pam_issue.so issue=/etc/issue
|
||||
|
||||
# Disallows other than root logins when /etc/nologin exists
|
||||
# (Replaces the `NOLOGINS_FILE' option from login.defs)
|
||||
auth requisite pam_nologin.so
|
||||
|
||||
# SELinux needs to be the first session rule. This ensures that any
|
||||
# lingering context has been cleared. Without this it is possible
|
||||
# that a module could execute code in the wrong domain.
|
||||
# When the module is present, "required" would be sufficient (When SELinux
|
||||
# is disabled, this returns success.)
|
||||
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close
|
||||
|
||||
# Sets the loginuid process attribute
|
||||
session required pam_loginuid.so
|
||||
|
||||
# Prints the message of the day upon successful login.
|
||||
# (Replaces the `MOTD_FILE' option in login.defs)
|
||||
# This includes a dynamically generated part from /run/motd.dynamic
|
||||
# and a static (admin-editable) part from /etc/motd.
|
||||
session optional pam_motd.so motd=/run/motd.dynamic
|
||||
session optional pam_motd.so noupdate
|
||||
|
||||
# SELinux needs to intervene at login time to ensure that the process
|
||||
# starts in the proper default security context. Only sessions which are
|
||||
# intended to run in the user's context should be run after this.
|
||||
# pam_selinux.so changes the SELinux context of the used TTY and configures
|
||||
# SELinux in order to transition to the user context with the next execve()
|
||||
# call.
|
||||
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open
|
||||
# When the module is present, "required" would be sufficient (When SELinux
|
||||
# is disabled, this returns success.)
|
||||
|
||||
# This module parses environment configuration file(s)
|
||||
# and also allows you to use an extended config
|
||||
# file /etc/security/pam_env.conf.
|
||||
#
|
||||
# parsing /etc/environment needs "readenv=1"
|
||||
session required pam_env.so readenv=1
|
||||
# locale variables can also be set in /etc/default/locale
|
||||
# reading this file *in addition to /etc/environment* does not hurt
|
||||
session required pam_env.so readenv=1 envfile=/etc/default/locale
|
||||
|
||||
# Standard Un*x authentication.
|
||||
@include common-auth
|
||||
|
||||
# This allows certain extra groups to be granted to a user
|
||||
# based on things like time of day, tty, service, and user.
|
||||
# Please edit /etc/security/group.conf to fit your needs
|
||||
# (Replaces the `CONSOLE_GROUPS' option in login.defs)
|
||||
auth optional pam_group.so
|
||||
|
||||
# Uncomment and edit /etc/security/time.conf if you need to set
|
||||
# time restraint on logins.
|
||||
# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
|
||||
# as well as /etc/porttime)
|
||||
# account requisite pam_time.so
|
||||
|
||||
# Uncomment and edit /etc/security/access.conf if you need to
|
||||
# set access limits.
|
||||
# (Replaces /etc/login.access file)
|
||||
# account required pam_access.so
|
||||
|
||||
# Sets up user limits according to /etc/security/limits.conf
|
||||
# (Replaces the use of /etc/limits in old login)
|
||||
session required pam_limits.so
|
||||
|
||||
# Prints the status of the user's mailbox upon successful login
|
||||
# (Replaces the `MAIL_CHECK_ENAB' option from login.defs).
|
||||
#
|
||||
# This also defines the MAIL environment variable
|
||||
# However, userdel also needs MAIL_DIR and MAIL_FILE variables
|
||||
# in /etc/login.defs to make sure that removing a user
|
||||
# also removes the user's mail spool file.
|
||||
# See comments in /etc/login.defs
|
||||
session optional pam_mail.so standard
|
||||
|
||||
# Create a new session keyring.
|
||||
session optional pam_keyinit.so force revoke
|
||||
|
||||
# Standard Un*x account and session
|
||||
@include common-account
|
||||
@include common-session
|
||||
@include common-password
|
||||
16
debian/not-installed
vendored
16
debian/not-installed
vendored
@@ -1,4 +1,6 @@
|
||||
bin/groups
|
||||
bin/login
|
||||
# Workaround debhelper complaining about login.defs, although we install it.
|
||||
etc/login.defs
|
||||
etc/pam.d/chfn
|
||||
etc/pam.d/chage
|
||||
@@ -14,27 +16,39 @@ etc/pam.d/passwd
|
||||
etc/pam.d/useradd
|
||||
etc/pam.d/userdel
|
||||
etc/pam.d/usermod
|
||||
sbin/nologin
|
||||
usr/bin/newgrp
|
||||
usr/bin/faillog
|
||||
usr/bin/sg
|
||||
usr/lib/*/libsubid.la
|
||||
usr/sbin/groupmems
|
||||
usr/sbin/logoutd
|
||||
usr/sbin/vigr
|
||||
usr/share/man/*/man1/groups.1
|
||||
usr/share/man/*/man1/login.1
|
||||
usr/share/man/*/man1/logoutd.1
|
||||
usr/share/man/*/man1/newgrp.1
|
||||
usr/share/man/*/man1/sg.1
|
||||
usr/share/man/*/man1/su.1
|
||||
usr/share/man/*/man3/getspnam.3
|
||||
usr/share/man/*/man3/shadow.3
|
||||
usr/share/man/*/man5/faillog.5
|
||||
usr/share/man/*/man5/suauth.5
|
||||
usr/share/man/*/man8/faillog.8
|
||||
usr/share/man/*/man8/groupmems.8
|
||||
usr/share/man/*/man8/logoutd.8
|
||||
usr/share/man/*/man8/nologin.8
|
||||
usr/share/man/man1/groups.1
|
||||
usr/share/man/man1/login.1
|
||||
usr/share/man/man1/logoutd.1
|
||||
usr/share/man/man1/newgrp.1
|
||||
usr/share/man/man1/sg.1
|
||||
usr/share/man/man1/su.1
|
||||
usr/share/man/man3/getspnam.3
|
||||
usr/share/man/man3/shadow.3
|
||||
usr/share/man/man5/faillog.5
|
||||
usr/share/man/man5/suauth.5
|
||||
usr/share/man/man8/faillog.8
|
||||
usr/share/man/man8/groupmems.8
|
||||
usr/share/man/man8/logoutd.8
|
||||
|
||||
usr/share/man/man8/nologin.8
|
||||
|
||||
3
debian/passwd.install
vendored
3
debian/passwd.install
vendored
@@ -8,10 +8,8 @@ usr/bin/gpasswd
|
||||
usr/bin/passwd
|
||||
usr/sbin/chgpasswd
|
||||
usr/sbin/chpasswd
|
||||
usr/sbin/cppw
|
||||
usr/sbin/groupadd
|
||||
usr/sbin/groupdel
|
||||
usr/sbin/groupmems
|
||||
usr/sbin/groupmod
|
||||
usr/sbin/grpck
|
||||
usr/sbin/grpconv
|
||||
@@ -24,3 +22,4 @@ usr/sbin/useradd
|
||||
usr/sbin/userdel
|
||||
usr/sbin/usermod
|
||||
usr/sbin/vipw
|
||||
usr/share/locale/*/LC_MESSAGES/shadow.mo
|
||||
|
||||
1
debian/passwd.links
vendored
1
debian/passwd.links
vendored
@@ -1,2 +1 @@
|
||||
usr/sbin/cppw usr/sbin/cpgr
|
||||
usr/sbin/vipw usr/sbin/vigr
|
||||
|
||||
5
debian/passwd.manpages
vendored
5
debian/passwd.manpages
vendored
@@ -1,5 +1,3 @@
|
||||
debian/cpgr.8
|
||||
debian/cppw.8
|
||||
usr/share/man/*/man1/chage.1
|
||||
usr/share/man/*/man1/chfn.1
|
||||
usr/share/man/*/man1/chsh.1
|
||||
@@ -15,7 +13,6 @@ usr/share/man/*/man8/chgpasswd.8
|
||||
usr/share/man/*/man8/chpasswd.8
|
||||
usr/share/man/*/man8/groupadd.8
|
||||
usr/share/man/*/man8/groupdel.8
|
||||
usr/share/man/*/man8/groupmems.8
|
||||
usr/share/man/*/man8/groupmod.8
|
||||
usr/share/man/*/man8/grpck.8
|
||||
usr/share/man/*/man8/grpconv.8
|
||||
@@ -24,7 +21,6 @@ usr/share/man/*/man8/newusers.8
|
||||
usr/share/man/*/man8/pwck.8
|
||||
usr/share/man/*/man8/pwconv.8
|
||||
usr/share/man/*/man8/pwunconv.8
|
||||
usr/share/man/*/man8/shadowconfig.8
|
||||
usr/share/man/*/man8/useradd.8
|
||||
usr/share/man/*/man8/userdel.8
|
||||
usr/share/man/*/man8/usermod.8
|
||||
@@ -45,7 +41,6 @@ usr/share/man/man8/chgpasswd.8
|
||||
usr/share/man/man8/chpasswd.8
|
||||
usr/share/man/man8/groupadd.8
|
||||
usr/share/man/man8/groupdel.8
|
||||
usr/share/man/man8/groupmems.8
|
||||
usr/share/man/man8/groupmod.8
|
||||
usr/share/man/man8/grpck.8
|
||||
usr/share/man/man8/grpconv.8
|
||||
|
||||
514
debian/patches/debian/Adapt-login.defs-for-Debian.patch
vendored
Normal file
514
debian/patches/debian/Adapt-login.defs-for-Debian.patch
vendored
Normal file
@@ -0,0 +1,514 @@
|
||||
From: Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>
|
||||
Date: Sun, 7 Jul 2024 14:06:39 +0200
|
||||
Subject: Adapt login.defs for Debian
|
||||
|
||||
Remove settings only applicable to shadow's su, which we do not use.
|
||||
Remove settings only applicable without PAM support enabled.
|
||||
Remove obscure commented-out settings.
|
||||
Remove explanation about write(1), which Debian does not ship anymore.
|
||||
---
|
||||
etc/login.defs | 369 +++++++--------------------------------------------------
|
||||
1 file changed, 44 insertions(+), 325 deletions(-)
|
||||
|
||||
diff --git a/etc/login.defs b/etc/login.defs
|
||||
index 33622c2..91d3ec4 100644
|
||||
--- a/etc/login.defs
|
||||
+++ b/etc/login.defs
|
||||
@@ -1,24 +1,38 @@
|
||||
#
|
||||
# /etc/login.defs - Configuration control definitions for the shadow package.
|
||||
#
|
||||
-# $Id$
|
||||
-#
|
||||
|
||||
+# REQUIRED for useradd/userdel/usermod
|
||||
+# Directory where mailboxes reside, _or_ name of file, relative to the
|
||||
+# home directory. If you _do_ define MAIL_DIR and MAIL_FILE,
|
||||
+# MAIL_DIR takes precedence.
|
||||
#
|
||||
-# Delay in seconds before being allowed another attempt after a login failure
|
||||
-# Note: When PAM is used, some modules may enforce a minimum delay (e.g.
|
||||
-# pam_unix(8) enforces a 2s delay)
|
||||
+# Essentially:
|
||||
+# - MAIL_DIR defines the location of users mail spool files
|
||||
+# (for mbox use) by appending the username to MAIL_DIR as defined
|
||||
+# below.
|
||||
+# - MAIL_FILE defines the location of the users mail spool files as the
|
||||
+# fully-qualified filename obtained by prepending the user home
|
||||
+# directory before $MAIL_FILE
|
||||
#
|
||||
-FAIL_DELAY 3
|
||||
-
|
||||
+# NOTE: This is no more used for setting up users MAIL environment variable
|
||||
+# which is, starting from shadow 4.0.12-1 in Debian, entirely the
|
||||
+# job of the pam_mail PAM modules
|
||||
+# See default PAM configuration files provided for
|
||||
+# login, su, etc.
|
||||
#
|
||||
-# Enable logging and display of /var/log/faillog login(1) failure info.
|
||||
-#
|
||||
-FAILLOG_ENAB yes
|
||||
+# This is a temporary situation: setting these variables will soon
|
||||
+# move to /etc/default/useradd and the variables will then be
|
||||
+# no more supported
|
||||
+MAIL_DIR /var/mail
|
||||
+#MAIL_FILE .mail
|
||||
|
||||
#
|
||||
# Enable display of unknown usernames when login(1) failures are recorded.
|
||||
#
|
||||
+# WARNING: Unknown usernames may become world readable.
|
||||
+# See #290803 and #298773 for details about how this could become a security
|
||||
+# concern
|
||||
LOG_UNKFAIL_ENAB no
|
||||
|
||||
#
|
||||
@@ -26,110 +40,12 @@ LOG_UNKFAIL_ENAB no
|
||||
#
|
||||
LOG_OK_LOGINS no
|
||||
|
||||
-#
|
||||
-# Enable logging and display of /var/log/lastlog login(1) time info.
|
||||
-#
|
||||
-LASTLOG_ENAB yes
|
||||
-
|
||||
-#
|
||||
-# Limit the highest user ID number for which the lastlog entries should
|
||||
-# be updated.
|
||||
-#
|
||||
-# No LASTLOG_UID_MAX means that there is no user ID limit for writing
|
||||
-# lastlog entries.
|
||||
-#
|
||||
-#LASTLOG_UID_MAX
|
||||
-
|
||||
-#
|
||||
-# Enable checking and display of mailbox status upon login.
|
||||
-#
|
||||
-# Disable if the shell startup files already check for mail
|
||||
-# ("mailx -e" or equivalent).
|
||||
-#
|
||||
-MAIL_CHECK_ENAB yes
|
||||
-
|
||||
-#
|
||||
-# Enable additional checks upon password changes.
|
||||
-#
|
||||
-OBSCURE_CHECKS_ENAB yes
|
||||
-
|
||||
-#
|
||||
-# Enable checking of time restrictions specified in /etc/porttime.
|
||||
-#
|
||||
-PORTTIME_CHECKS_ENAB yes
|
||||
-
|
||||
-#
|
||||
-# Enable setting of ulimit, umask, and niceness from passwd(5) gecos field.
|
||||
-#
|
||||
-QUOTAS_ENAB yes
|
||||
-
|
||||
-#
|
||||
-# Enable "syslog" logging of su(1) activity - in addition to sulog file logging.
|
||||
-# SYSLOG_SG_ENAB does the same for newgrp(1) and sg(1).
|
||||
-#
|
||||
-SYSLOG_SU_ENAB yes
|
||||
-SYSLOG_SG_ENAB yes
|
||||
-
|
||||
-#
|
||||
-# If defined, either full pathname of a file containing device names or
|
||||
-# a ":" delimited list of device names. Root logins will be allowed only
|
||||
-# from these devices.
|
||||
-#
|
||||
-CONSOLE /etc/securetty
|
||||
-#CONSOLE console:tty01:tty02:tty03:tty04
|
||||
-
|
||||
-#
|
||||
-# If defined, all su(1) activity is logged to this file.
|
||||
-#
|
||||
-#SULOG_FILE /var/log/sulog
|
||||
-
|
||||
-#
|
||||
-# If defined, ":" delimited list of "message of the day" files to
|
||||
-# be displayed upon login.
|
||||
-#
|
||||
-MOTD_FILE /etc/motd
|
||||
-#MOTD_FILE /etc/motd:/usr/lib/news/news-motd
|
||||
-
|
||||
-#
|
||||
-# If defined, this file will be output before each login(1) prompt.
|
||||
-#
|
||||
-#ISSUE_FILE /etc/issue
|
||||
-
|
||||
#
|
||||
# If defined, file which maps tty line to TERM environment parameter.
|
||||
# Each line of the file is in a format similar to "vt100 tty01".
|
||||
#
|
||||
#TTYTYPE_FILE /etc/ttytype
|
||||
|
||||
-#
|
||||
-# If defined, login(1) failures will be logged here in a utmp format.
|
||||
-# last(1), when invoked as lastb(1), will read /var/log/btmp, so...
|
||||
-#
|
||||
-FTMP_FILE /var/log/btmp
|
||||
-
|
||||
-#
|
||||
-# If defined, name of file whose presence will inhibit non-root
|
||||
-# logins. The content of this file should be a message indicating
|
||||
-# why logins are inhibited.
|
||||
-#
|
||||
-NOLOGINS_FILE /etc/nologin
|
||||
-
|
||||
-#
|
||||
-# If defined, the command name to display when running "su -". For
|
||||
-# example, if this is defined as "su" then ps(1) will display the
|
||||
-# command as "-su". If not defined, then ps(1) will display the
|
||||
-# name of the shell actually being run, e.g. something like "-sh".
|
||||
-#
|
||||
-SU_NAME su
|
||||
-
|
||||
-#
|
||||
-# *REQUIRED*
|
||||
-# Directory where mailboxes reside, _or_ name of file, relative to the
|
||||
-# home directory. If you _do_ define both, MAIL_DIR takes precedence.
|
||||
-#
|
||||
-MAIL_DIR /var/spool/mail
|
||||
-#MAIL_FILE .mail
|
||||
-
|
||||
#
|
||||
# If defined, file which inhibits all the usual chatter during the login
|
||||
# sequence. If a full pathname, then hushed mode will be enabled if the
|
||||
@@ -139,40 +55,21 @@ MAIL_DIR /var/spool/mail
|
||||
HUSHLOGIN_FILE .hushlogin
|
||||
#HUSHLOGIN_FILE /etc/hushlogins
|
||||
|
||||
-#
|
||||
-# If defined, either a TZ environment parameter spec or the
|
||||
-# fully-rooted pathname of a file containing such a spec.
|
||||
-#
|
||||
-#ENV_TZ TZ=CST6CDT
|
||||
-#ENV_TZ /etc/tzname
|
||||
-
|
||||
-#
|
||||
-# If defined, an HZ environment parameter spec.
|
||||
-#
|
||||
-# for Linux/x86
|
||||
-ENV_HZ HZ=100
|
||||
-# For Linux/Alpha...
|
||||
-#ENV_HZ HZ=1024
|
||||
-
|
||||
#
|
||||
# *REQUIRED* The default PATH settings, for superuser and normal users.
|
||||
#
|
||||
# (they are minimal, add the rest in the shell startup files)
|
||||
-ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
-ENV_PATH PATH=/bin:/usr/bin
|
||||
+ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
+ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
|
||||
|
||||
#
|
||||
-# Terminal permissions
|
||||
+# Terminal permissions for terminals after login(1).
|
||||
+# These settings are ignored for remote and other logins.
|
||||
#
|
||||
# TTYGROUP Login tty will be assigned this group ownership.
|
||||
# TTYPERM Login tty will be set to this permission.
|
||||
#
|
||||
-# If you have a write(1) program which is "setgid" to a special group
|
||||
-# which owns the terminals, define TTYGROUP as the number of such group
|
||||
-# and TTYPERM as 0620. Otherwise leave TTYGROUP commented out and
|
||||
-# set TTYPERM to either 622 or 600.
|
||||
-#
|
||||
-TTYGROUP tty
|
||||
+#TTYGROUP tty
|
||||
TTYPERM 0600
|
||||
|
||||
#
|
||||
@@ -180,61 +77,35 @@ TTYPERM 0600
|
||||
#
|
||||
# ERASECHAR Terminal ERASE character ('\010' = backspace).
|
||||
# KILLCHAR Terminal KILL character ('\025' = CTRL/U).
|
||||
-# ULIMIT Default "ulimit" value.
|
||||
#
|
||||
# The ERASECHAR and KILLCHAR are used only on System V machines.
|
||||
-# The ULIMIT is used only if the system supports it.
|
||||
-# (now it works with setrlimit too; ulimit is in 512-byte units)
|
||||
-#
|
||||
-# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
|
||||
#
|
||||
ERASECHAR 0177
|
||||
KILLCHAR 025
|
||||
-#ULIMIT 2097152
|
||||
-
|
||||
-# Default initial "umask" value used by login(1) on non-PAM enabled systems.
|
||||
-# Default "umask" value for pam_umask(8) on PAM enabled systems.
|
||||
-# UMASK is also used by useradd(8) and newusers(8) to set the mode for new
|
||||
-# home directories if HOME_MODE is not set.
|
||||
-# 022 is the default value, but 027, or even 077, could be considered
|
||||
-# for increased privacy. There is no One True Answer here: each sysadmin
|
||||
-# must make up their mind.
|
||||
-UMASK 022
|
||||
|
||||
# HOME_MODE is used by useradd(8) and newusers(8) to set the mode for new
|
||||
# home directories.
|
||||
-# If HOME_MODE is not set, the value of UMASK is used to create the mode.
|
||||
-#HOME_MODE 0700
|
||||
+HOME_MODE 0700
|
||||
|
||||
#
|
||||
# Password aging controls:
|
||||
#
|
||||
# PASS_MAX_DAYS Maximum number of days a password may be used.
|
||||
# PASS_MIN_DAYS Minimum number of days allowed between password changes.
|
||||
-# PASS_MIN_LEN Minimum acceptable password length.
|
||||
# PASS_WARN_AGE Number of days warning given before a password expires.
|
||||
#
|
||||
PASS_MAX_DAYS 99999
|
||||
PASS_MIN_DAYS 0
|
||||
-PASS_MIN_LEN 5
|
||||
PASS_WARN_AGE 7
|
||||
|
||||
-#
|
||||
-# If "yes", the user must be listed as a member of the first gid 0 group
|
||||
-# in /etc/group (called "root" on most Linux systems) to be able to "su"
|
||||
-# to uid 0 accounts. If the group doesn't exist or is empty, no one
|
||||
-# will be able to "su" to uid 0.
|
||||
-#
|
||||
-SU_WHEEL_ONLY no
|
||||
-
|
||||
#
|
||||
# Min/max values for automatic uid selection in useradd(8)
|
||||
#
|
||||
UID_MIN 1000
|
||||
UID_MAX 60000
|
||||
# System accounts
|
||||
-SYS_UID_MIN 101
|
||||
-SYS_UID_MAX 999
|
||||
+#SYS_UID_MIN 101
|
||||
+#SYS_UID_MAX 999
|
||||
# Extra per user uids
|
||||
SUB_UID_MIN 100000
|
||||
SUB_UID_MAX 600100000
|
||||
@@ -246,8 +117,8 @@ SUB_UID_COUNT 65536
|
||||
GID_MIN 1000
|
||||
GID_MAX 60000
|
||||
# System accounts
|
||||
-SYS_GID_MIN 101
|
||||
-SYS_GID_MAX 999
|
||||
+#SYS_GID_MIN 101
|
||||
+#SYS_GID_MAX 999
|
||||
# Extra per user group ids
|
||||
SUB_GID_MIN 100000
|
||||
SUB_GID_MAX 600100000
|
||||
@@ -255,6 +126,9 @@ SUB_GID_COUNT 65536
|
||||
|
||||
#
|
||||
# Max number of login(1) retries if password is bad
|
||||
+# This will most likely be overriden by PAM, since the default pam_unix module
|
||||
+# has it's own built in of 3 retries. However, this is a safe fallback in case
|
||||
+# you are using an authentication module that does not enforce PAM_MAXTRIES.
|
||||
#
|
||||
LOGIN_RETRIES 5
|
||||
|
||||
@@ -263,28 +137,6 @@ LOGIN_RETRIES 5
|
||||
#
|
||||
LOGIN_TIMEOUT 60
|
||||
|
||||
-#
|
||||
-# Maximum number of attempts to change password if rejected (too easy)
|
||||
-#
|
||||
-PASS_CHANGE_TRIES 5
|
||||
-
|
||||
-#
|
||||
-# Warn about weak passwords (but still allow them) if you are root.
|
||||
-#
|
||||
-PASS_ALWAYS_WARN yes
|
||||
-
|
||||
-#
|
||||
-# Number of significant characters in the password for crypt().
|
||||
-# Default is 8, don't change unless your crypt() is better.
|
||||
-# Ignored if MD5_CRYPT_ENAB set to "yes".
|
||||
-#
|
||||
-#PASS_MAX_LEN 8
|
||||
-
|
||||
-#
|
||||
-# Require password before chfn(1)/chsh(1) can make any changes.
|
||||
-#
|
||||
-CHFN_AUTH yes
|
||||
-
|
||||
#
|
||||
# Which fields may be changed by regular users using chfn(1) - use
|
||||
# any combination of letters "frwh" (full name, room number, work
|
||||
@@ -294,29 +146,6 @@ CHFN_AUTH yes
|
||||
CHFN_RESTRICT rwh
|
||||
|
||||
#
|
||||
-# Password prompt (%s will be replaced by user name).
|
||||
-#
|
||||
-# XXX - it doesn't work correctly yet, for now leave it commented out
|
||||
-# to use the default which is just "Password: ".
|
||||
-#LOGIN_STRING "%s's Password: "
|
||||
-
|
||||
-#
|
||||
-# Only works if compiled with MD5_CRYPT defined:
|
||||
-# If set to "yes", new passwords will be encrypted using the MD5-based
|
||||
-# algorithm compatible with the one used by recent releases of FreeBSD.
|
||||
-# It supports passwords of unlimited length and longer salt strings.
|
||||
-# Set to "no" if you need to copy encrypted passwords to other systems
|
||||
-# which don't understand the new algorithm. Default is "no".
|
||||
-#
|
||||
-# Note: If you use PAM, it is recommended to use a value consistent with
|
||||
-# the PAM modules configuration.
|
||||
-#
|
||||
-# This variable is deprecated. You should use ENCRYPT_METHOD instead.
|
||||
-#
|
||||
-#MD5_CRYPT_ENAB no
|
||||
-
|
||||
-#
|
||||
-# Only works if compiled with ENCRYPTMETHOD_SELECT defined:
|
||||
# If set to MD5, MD5-based algorithm will be used for encrypting password
|
||||
# If set to SHA256, SHA256-based algorithm will be used for encrypting password
|
||||
# If set to SHA512, SHA512-based algorithm will be used for encrypting password
|
||||
@@ -326,66 +155,10 @@ CHFN_RESTRICT rwh
|
||||
# MD5 and DES should not be used for new hashes, see crypt(5) for recommendations.
|
||||
# Overrides the MD5_CRYPT_ENAB option
|
||||
#
|
||||
-# Note: If you use PAM, it is recommended to use a value consistent with
|
||||
+# Note: It is recommended to use a value consistent with
|
||||
# the PAM modules configuration.
|
||||
#
|
||||
-#ENCRYPT_METHOD DES
|
||||
-
|
||||
-#
|
||||
-# Only works if ENCRYPT_METHOD is set to SHA256 or SHA512.
|
||||
-#
|
||||
-# Define the number of SHA rounds.
|
||||
-# With a lot of rounds, it is more difficult to brute-force the password.
|
||||
-# However, more CPU resources will be needed to authenticate users if
|
||||
-# this value is increased.
|
||||
-#
|
||||
-# If not specified, the libc will choose the default number of rounds (5000),
|
||||
-# which is orders of magnitude too low for modern hardware.
|
||||
-# The values must be within the 1000-999999999 range.
|
||||
-# If only one of the MIN or MAX values is set, then this value will be used.
|
||||
-# If MIN > MAX, the highest value will be used.
|
||||
-#
|
||||
-#SHA_CRYPT_MIN_ROUNDS 5000
|
||||
-#SHA_CRYPT_MAX_ROUNDS 5000
|
||||
-
|
||||
-#
|
||||
-# Only works if ENCRYPT_METHOD is set to BCRYPT.
|
||||
-#
|
||||
-# Define the number of BCRYPT rounds.
|
||||
-# With a lot of rounds, it is more difficult to brute-force the password.
|
||||
-# However, more CPU resources will be needed to authenticate users if
|
||||
-# this value is increased.
|
||||
-#
|
||||
-# If not specified, 13 rounds will be attempted.
|
||||
-# If only one of the MIN or MAX values is set, then this value will be used.
|
||||
-# If MIN > MAX, the highest value will be used.
|
||||
-#
|
||||
-#BCRYPT_MIN_ROUNDS 13
|
||||
-#BCRYPT_MAX_ROUNDS 13
|
||||
-
|
||||
-#
|
||||
-# Only works if ENCRYPT_METHOD is set to YESCRYPT.
|
||||
-#
|
||||
-# Define the YESCRYPT cost factor.
|
||||
-# With a higher cost factor, it is more difficult to brute-force the password.
|
||||
-# However, more CPU time and more memory will be needed to authenticate users
|
||||
-# if this value is increased.
|
||||
-#
|
||||
-# If not specified, a cost factor of 5 will be used.
|
||||
-# The value must be within the 1-11 range.
|
||||
-#
|
||||
-#YESCRYPT_COST_FACTOR 5
|
||||
-
|
||||
-#
|
||||
-# List of groups to add to the user's supplementary group set
|
||||
-# when logging in from the console (as determined by the CONSOLE
|
||||
-# setting). Default is none.
|
||||
-#
|
||||
-# Use with caution - it is possible for users to gain permanent
|
||||
-# access to these groups, even when not logged in from the console.
|
||||
-# How to do it is left as an exercise for the reader...
|
||||
-#
|
||||
-#CONSOLE_GROUPS floppy:audio:cdrom
|
||||
+ENCRYPT_METHOD YESCRYPT
|
||||
|
||||
#
|
||||
# Should login be allowed if we can't cd to the home directory?
|
||||
@@ -401,12 +174,6 @@ DEFAULT_HOME yes
|
||||
#
|
||||
NONEXISTENT /nonexistent
|
||||
|
||||
-#
|
||||
-# If this file exists and is readable, login environment will be
|
||||
-# read from it. Every line should be in the form name=value.
|
||||
-#
|
||||
-ENVIRON_FILE /etc/environment
|
||||
-
|
||||
#
|
||||
# If defined, this command is run when removing a user.
|
||||
# It should remove any at/cron/print jobs etc. owned by
|
||||
@@ -415,59 +182,11 @@ ENVIRON_FILE /etc/environment
|
||||
#USERDEL_CMD /usr/sbin/userdel_local
|
||||
|
||||
#
|
||||
-# Enable setting of the umask group bits to be the same as owner bits
|
||||
-# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
|
||||
-# the same as gid, and username is the same as the primary group name.
|
||||
+# If set to yes, userdel(8) will remove the user's group if it contains no more
|
||||
+# members, and useradd(8) will create by default a group with the name of the
|
||||
+# user.
|
||||
#
|
||||
-# This also enables userdel(8) to remove user groups if no members exist.
|
||||
+# Other former uses of this variable are not used in PAM environments, such as
|
||||
+# Debian.
|
||||
#
|
||||
USERGROUPS_ENAB yes
|
||||
-
|
||||
-#
|
||||
-# If set to a non-zero number, the shadow utilities will make sure that
|
||||
-# groups never have more than this number of users on one line.
|
||||
-# This permits to support split groups (groups split into multiple lines,
|
||||
-# with the same group ID, to avoid limitation of the line length in the
|
||||
-# group file).
|
||||
-#
|
||||
-# 0 is the default value and disables this feature.
|
||||
-#
|
||||
-#MAX_MEMBERS_PER_GROUP 0
|
||||
-
|
||||
-#
|
||||
-# If useradd(8) should create home directories for users by default (non
|
||||
-# system users only).
|
||||
-# This option is overridden with the -M or -m flags on the useradd(8)
|
||||
-# command-line.
|
||||
-#
|
||||
-#CREATE_HOME yes
|
||||
-
|
||||
-#
|
||||
-# Force use shadow, even if shadow passwd & shadow group files are
|
||||
-# missing.
|
||||
-#
|
||||
-#FORCE_SHADOW yes
|
||||
-
|
||||
-#
|
||||
-# Allow newuidmap and newgidmap when running under an alternative
|
||||
-# primary group.
|
||||
-#
|
||||
-#GRANT_AUX_GROUP_SUBIDS yes
|
||||
-
|
||||
-#
|
||||
-# Prevents an empty password field to be interpreted as "no authentication
|
||||
-# required".
|
||||
-# Set to "yes" to prevent for all accounts
|
||||
-# Set to "superuser" to prevent for UID 0 / root (default)
|
||||
-# Set to "no" to not prevent for any account (dangerous, historical default)
|
||||
-PREVENT_NO_AUTH superuser
|
||||
-
|
||||
-#
|
||||
-# Select the HMAC cryptography algorithm.
|
||||
-# Used in pam_timestamp module to calculate the keyed-hash message
|
||||
-# authentication code.
|
||||
-#
|
||||
-# Note: It is recommended to check hmac(3) to see the possible algorithms
|
||||
-# that are available in your system.
|
||||
-#
|
||||
-#HMAC_CRYPTO_ALGO SHA512
|
||||
25
debian/patches/debian/Define-LOGIN_NAME_MAX-on-HURD.patch
vendored
Normal file
25
debian/patches/debian/Define-LOGIN_NAME_MAX-on-HURD.patch
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
From: Chris Hofstaedtler <zeha@debian.org>
|
||||
Date: Tue, 6 Aug 2024 00:16:59 +0200
|
||||
Subject: Define LOGIN_NAME_MAX on HURD
|
||||
|
||||
---
|
||||
lib/chkname.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/lib/chkname.c b/lib/chkname.c
|
||||
index 57d6d96..6af55a9 100644
|
||||
--- a/lib/chkname.c
|
||||
+++ b/lib/chkname.c
|
||||
@@ -29,6 +29,12 @@
|
||||
#include <stddef.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+#ifdef __GNU__
|
||||
+#ifndef LOGIN_NAME_MAX
|
||||
+#define LOGIN_NAME_MAX 256
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
#include "defines.h"
|
||||
#include "chkname.h"
|
||||
#include "string/ctype/strisascii/strisdigit.h"
|
||||
@@ -2,30 +2,20 @@ From: Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>
|
||||
Date: Sat, 22 Jun 2024 17:39:41 +0200
|
||||
Subject: Document the shadowconfig utility
|
||||
|
||||
Status wrt upstream: The shadowconfig utility is debian specific.
|
||||
Its man page also (but it used to be distributed)
|
||||
Status wrt upstream: The shadowconfig utility is Debian-specific.
|
||||
The man page is Debian-specific, but it used to be distributed by
|
||||
upstream.
|
||||
---
|
||||
man/Makefile.am | 2 ++
|
||||
man/fr/Makefile.am | 1 +
|
||||
man/fr/man8/shadowconfig.8 | 26 +++++++++++++++++++++++
|
||||
man/ja/Makefile.am | 1 +
|
||||
man/ja/man8/shadowconfig.8 | 25 ++++++++++++++++++++++
|
||||
man/pl/Makefile.am | 1 +
|
||||
man/pl/man8/shadowconfig.8 | 27 ++++++++++++++++++++++++
|
||||
man/shadowconfig.8 | 41 ++++++++++++++++++++++++++++++++++++
|
||||
man/shadowconfig.8.xml | 52 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
9 files changed, 176 insertions(+)
|
||||
create mode 100644 man/fr/man8/shadowconfig.8
|
||||
create mode 100644 man/ja/man8/shadowconfig.8
|
||||
create mode 100644 man/pl/man8/shadowconfig.8
|
||||
create mode 100644 man/shadowconfig.8
|
||||
create mode 100644 man/shadowconfig.8.xml
|
||||
man/Makefile.am | 1 +
|
||||
man/man8/shadowconfig.8 | 34 ++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 35 insertions(+)
|
||||
create mode 100644 man/man8/shadowconfig.8
|
||||
|
||||
diff --git a/man/Makefile.am b/man/Makefile.am
|
||||
index 83b1d68..dab98f4 100644
|
||||
index f34ed7a..2523e84 100644
|
||||
--- a/man/Makefile.am
|
||||
+++ b/man/Makefile.am
|
||||
@@ -37,6 +37,7 @@ man_MANS = \
|
||||
@@ -36,6 +36,7 @@ man_MANS = \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
@@ -33,248 +23,43 @@ index 83b1d68..dab98f4 100644
|
||||
man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
man5/shadow.5 \
|
||||
@@ -108,6 +109,7 @@ man_XMANS = \
|
||||
porttime.5.xml \
|
||||
pwck.8.xml \
|
||||
pwconv.8.xml \
|
||||
+ shadowconfig.8.xml \
|
||||
shadow.3.xml \
|
||||
shadow.5.xml \
|
||||
sg.1.xml \
|
||||
diff --git a/man/fr/Makefile.am b/man/fr/Makefile.am
|
||||
index 335e029..78aee9a 100644
|
||||
--- a/man/fr/Makefile.am
|
||||
+++ b/man/fr/Makefile.am
|
||||
@@ -32,6 +32,7 @@ man_MANS = \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
+ man8/shadowconfig.8 \
|
||||
man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
man5/shadow.5 \
|
||||
diff --git a/man/fr/man8/shadowconfig.8 b/man/fr/man8/shadowconfig.8
|
||||
diff --git a/man/man8/shadowconfig.8 b/man/man8/shadowconfig.8
|
||||
new file mode 100644
|
||||
index 0000000..784da70
|
||||
index 0000000..a463a92
|
||||
--- /dev/null
|
||||
+++ b/man/fr/man8/shadowconfig.8
|
||||
@@ -0,0 +1,26 @@
|
||||
+.\" This file was generated with po4a. Translate the source file.
|
||||
+.\"
|
||||
+.\"$Id: shadowconfig.8,v 1.4 2001/08/23 23:10:48 kloczek Exp $
|
||||
+.TH SHADOWCONFIG 8 "19 avril 1997" "Debian GNU/Linux"
|
||||
+.SH NOM
|
||||
+shadowconfig \- active ou désactive les mots de passe cachés
|
||||
+.SH SYNOPSIS
|
||||
+\fBshadowconfig\fP \fIon\fP | \fIoff\fP
|
||||
+.SH DESCRIPTION
|
||||
+.PP
|
||||
+\fBshadowconfig on\fP active les mots de passe cachés («\ shadow passwords\ »)\ ; \fBshadowconfig off\fP les désactive. \fBShadowconfig\fP affiche un message
|
||||
+d'erreur et quitte avec une valeur de retour non nulle s'il rencontre
|
||||
+quelque chose d'inattendu. Dans ce cas, vous devrez corriger l'erreur avant
|
||||
+de recommencer.
|
||||
+
|
||||
+Activer les mots de passe cachés lorsqu'ils sont déjà activés, ou les
|
||||
+désactiver lorsqu'ils ne sont pas actifs est sans effet.
|
||||
+
|
||||
+Lisez \fI/usr/share/doc/passwd/README.Debian\fP pour une brève introduction aux
|
||||
+mots de passe cachés et à leurs fonctionnalités.
|
||||
+
|
||||
+Notez que désactiver puis réactiver les mots de passe cachés aura pour
|
||||
+conséquence la perte des informations d'âge sur les mots de passe.
|
||||
+.SH TRADUCTION
|
||||
+Nicolas FRANÇOIS, 2004.
|
||||
+Veuillez signaler toute erreur à <\fIdebian\-l10\-french@lists.debian.org\fR>.
|
||||
diff --git a/man/ja/Makefile.am b/man/ja/Makefile.am
|
||||
index 13f18da..c72097f 100644
|
||||
--- a/man/ja/Makefile.am
|
||||
+++ b/man/ja/Makefile.am
|
||||
@@ -27,6 +27,7 @@ man_MANS = \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
+ man8/shadowconfig.8 \
|
||||
man1/sg.1 \
|
||||
man5/shadow.5 \
|
||||
man1/su.1 \
|
||||
diff --git a/man/ja/man8/shadowconfig.8 b/man/ja/man8/shadowconfig.8
|
||||
new file mode 100644
|
||||
index 0000000..a75c6f7
|
||||
--- /dev/null
|
||||
+++ b/man/ja/man8/shadowconfig.8
|
||||
@@ -0,0 +1,25 @@
|
||||
+.\" all right reserved,
|
||||
+.\" Translated Tue Oct 30 11:59:11 JST 2001
|
||||
+.\" by Maki KURODA <mkuroda@aisys-jp.com>
|
||||
+.\"
|
||||
+.TH SHADOWCONFIG 8 "19 Apr 1997" "Debian GNU/Linux"
|
||||
+.SH 名前
|
||||
+shadowconfig \- shadow パスワードの設定をオン及びオフに切替える
|
||||
+.SH 書式
|
||||
+.B "shadowconfig"
|
||||
+.IR on " | " off
|
||||
+.SH 説明
|
||||
+.PP
|
||||
+.B shadowconfig on
|
||||
+は shadow パスワードを有効にする。
|
||||
+.B shadowconfig off
|
||||
+は shadow パスワードを無効にする。
|
||||
+++ b/man/man8/shadowconfig.8
|
||||
@@ -0,0 +1,34 @@
|
||||
+.TH shadowconfig 8 2025-02-17 "Debian shadow-utils"
|
||||
+.SH Name
|
||||
+shadowconfig \- turn shadow passwords on
|
||||
+.
|
||||
+.
|
||||
+.SH Synopsis
|
||||
+.SY shadowconfig on
|
||||
+.YS
|
||||
+.
|
||||
+.
|
||||
+.SH Description
|
||||
+.I shadowconfig\ on
|
||||
+will turn shadow passwords on.
|
||||
+.
|
||||
+.
|
||||
+.SH Errors
|
||||
+.B shadowconfig
|
||||
+は何らかの間違いがあると、エラーメッセージを表示し、
|
||||
+ゼロではない返り値を返す。
|
||||
+もしそのようなことが起こった場合、エラーを修正し、再度実行しなければならない。
|
||||
+shadow パスワードの設定がすでにオンの場合にオンに設定したり、
|
||||
+すでにオフの場合にオフに設定しても、何の影響もない。
|
||||
+
|
||||
+.I /usr/share/doc/passwd/README.debian.gz
|
||||
+には shadow パスワードとそれに関する特徴の簡単な紹介が書かれている。
|
||||
diff --git a/man/pl/Makefile.am b/man/pl/Makefile.am
|
||||
index b2f096f..aa79af2 100644
|
||||
--- a/man/pl/Makefile.am
|
||||
+++ b/man/pl/Makefile.am
|
||||
@@ -18,6 +18,7 @@ man_MANS = \
|
||||
man8/logoutd.8 \
|
||||
man1/newgrp.1 \
|
||||
man1/sg.1 \
|
||||
+ man8/shadowconfig.8 \
|
||||
man3/shadow.3 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8 \
|
||||
diff --git a/man/pl/man8/shadowconfig.8 b/man/pl/man8/shadowconfig.8
|
||||
new file mode 100644
|
||||
index 0000000..2016c9f
|
||||
--- /dev/null
|
||||
+++ b/man/pl/man8/shadowconfig.8
|
||||
@@ -0,0 +1,27 @@
|
||||
+.\" $Id: shadowconfig.8,v 1.3 2001/08/23 23:10:51 kloczek Exp $
|
||||
+.\" {PTM/WK/1999-09-14}
|
||||
+.TH SHADOWCONFIG 8 "19 kwietnia 1997" "Debian GNU/Linux"
|
||||
+.SH NAZWA
|
||||
+shadowconfig - przełącza ochronę haseł i grup przez pliki shadow
|
||||
+.SH SKŁADNIA
|
||||
+.B "shadowconfig"
|
||||
+.IR on " | " off
|
||||
+.SH OPIS
|
||||
+.PP
|
||||
+.B shadowconfig on
|
||||
+włącza ochronę haseł i grup przez dodatkowe, przesłaniane pliki (shadow);
|
||||
+.B shadowconfig off
|
||||
+wyłącza dodatkowe pliki haseł i grup.
|
||||
+.B shadowconfig
|
||||
+wyświetla komunikat o błędzie i kończy pracę z niezerowym kodem jeśli
|
||||
+znajdzie coś nieprawidłowego. W takim wypadku powinieneś poprawić błąd
|
||||
+.\" if it finds anything awry.
|
||||
+i uruchomić program ponownie.
|
||||
+
|
||||
+Włączenie ochrony haseł, gdy jest ona już włączona lub jej wyłączenie,
|
||||
+gdy jest wyłączona jest nieszkodliwe.
|
||||
+
|
||||
+Przeczytaj
|
||||
+.IR /usr/share/doc/passwd/README.debian.gz ,
|
||||
+gdzie znajdziesz krótkie wprowadzenie do ochrony haseł z użyciem dodatkowych
|
||||
+plików haseł przesłanianych (shadow passwords) i związanych tematów.
|
||||
diff --git a/man/shadowconfig.8 b/man/shadowconfig.8
|
||||
new file mode 100644
|
||||
index 0000000..c0ee0af
|
||||
--- /dev/null
|
||||
+++ b/man/shadowconfig.8
|
||||
@@ -0,0 +1,41 @@
|
||||
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
|
||||
+.de Sh \" Subsection
|
||||
+.br
|
||||
+.if t .Sp
|
||||
+.ne 5
|
||||
+.PP
|
||||
+\fB\\$1\fR
|
||||
+.PP
|
||||
+..
|
||||
+.de Sp \" Vertical space (when we can't use .PP)
|
||||
+.if t .sp .5v
|
||||
+.if n .sp
|
||||
+..
|
||||
+.de Ip \" List item
|
||||
+.br
|
||||
+.ie \\n(.$>=3 .ne \\$3
|
||||
+.el .ne 3
|
||||
+.IP "\\$1" \\$2
|
||||
+..
|
||||
+.TH "SHADOWCONFIG" 8 "19 Apr 1997" "" ""
|
||||
+.SH NAME
|
||||
+shadowconfig \- toggle shadow passwords on and off
|
||||
+.SH "SYNOPSIS"
|
||||
+.ad l
|
||||
+.hy 0
|
||||
+.HP 13
|
||||
+\fBshadowconfig\fR \fB\fIon\fR\fR | \fB\fIoff\fR\fR
|
||||
+.ad
|
||||
+.hy
|
||||
+
|
||||
+.SH "DESCRIPTION"
|
||||
+
|
||||
+.PP
|
||||
+\fBshadowconfig\fR on will turn shadow passwords on; \fIshadowconfig off\fR will turn shadow passwords off\&. \fBshadowconfig\fR will print an error message and exit with a nonzero code if it finds anything awry\&. If that happens, you should correct the error and run it again\&. Turning shadow passwords on when they are already on, or off when they are already off, is harmless\&.
|
||||
+
|
||||
+.PP
|
||||
+Read \fI/usr/share/doc/passwd/README\&.Debian\fR for a brief introduction to shadow passwords and related features\&.
|
||||
+
|
||||
+.PP
|
||||
+Note that turning shadow passwords off and on again will lose all password aging information\&.
|
||||
+
|
||||
diff --git a/man/shadowconfig.8.xml b/man/shadowconfig.8.xml
|
||||
new file mode 100644
|
||||
index 0000000..b4080ea
|
||||
--- /dev/null
|
||||
+++ b/man/shadowconfig.8.xml
|
||||
@@ -0,0 +1,52 @@
|
||||
+<?xml version="1.0" encoding="UTF-8"?>
|
||||
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
|
||||
+<refentry id='shadowconfig.8'>
|
||||
+ <!-- $Id: shadowconfig.8.xml,v 1.6 2005/06/15 12:39:27 kloczek Exp $ -->
|
||||
+ <refentryinfo>
|
||||
+ <date>19 Apr 1997</date>
|
||||
+ </refentryinfo>
|
||||
+ <refmeta>
|
||||
+ <refentrytitle>shadowconfig</refentrytitle>
|
||||
+ <manvolnum>8</manvolnum>
|
||||
+ <refmiscinfo class='date'>19 Apr 1997</refmiscinfo>
|
||||
+ <refmiscinfo class='source'>Debian GNU/Linux</refmiscinfo>
|
||||
+ </refmeta>
|
||||
+ <refnamediv id='name'>
|
||||
+ <refname>shadowconfig</refname>
|
||||
+ <refpurpose>toggle shadow passwords on and off</refpurpose>
|
||||
+ </refnamediv>
|
||||
+
|
||||
+ <refsynopsisdiv id='synopsis'>
|
||||
+ <cmdsynopsis>
|
||||
+ <command>shadowconfig</command>
|
||||
+ <group choice='plain'>
|
||||
+ <arg choice='plain'><replaceable>on</replaceable></arg>
|
||||
+ <arg choice='plain'><replaceable>off</replaceable></arg>
|
||||
+ </group>
|
||||
+ </cmdsynopsis>
|
||||
+ </refsynopsisdiv>
|
||||
+
|
||||
+ <refsect1 id='description'>
|
||||
+ <title>DESCRIPTION</title>
|
||||
+ <para><command>shadowconfig</command> on will turn shadow passwords on;
|
||||
+ <emphasis remap='B'>shadowconfig off</emphasis> will turn shadow
|
||||
+ passwords off. <command>shadowconfig</command> will print an error
|
||||
+ message and exit with a nonzero code if it finds anything awry. If
|
||||
+ that happens, you should correct the error and run it again. Turning
|
||||
+ shadow passwords on when they are already on, or off when they are
|
||||
+ already off, is harmless.
|
||||
+ </para>
|
||||
+
|
||||
+ <para>
|
||||
+ Read <filename>/usr/share/doc/passwd/README.Debian</filename> for a
|
||||
+ brief introduction
|
||||
+ to shadow passwords and related features.
|
||||
+ </para>
|
||||
+
|
||||
+ <para>Note that turning shadow passwords off and on again will lose all
|
||||
+ password
|
||||
+ aging information.
|
||||
+ </para>
|
||||
+ </refsect1>
|
||||
+</refentry>
|
||||
+will print an error message and exit with a nonzero code
|
||||
+if it finds anything awry.
|
||||
+If that happens,
|
||||
+you should correct the error and run it again.
|
||||
+Turning shadow passwords on when they are already on
|
||||
+is harmless.
|
||||
+.
|
||||
+.
|
||||
+.SH Caveats
|
||||
+Turning shadow passwords off using shadowconfig
|
||||
+is not supported anymore.
|
||||
+.
|
||||
+.
|
||||
+.SH See also
|
||||
+Read
|
||||
+.I /usr/share/doc/passwd/README.Debian
|
||||
+for a brief introduction to shadow passwords and related features.
|
||||
|
||||
37
debian/patches/debian/Exclude-Debian-globally-allocated-UIDs-from-sys_uid-range.patch
vendored
Normal file
37
debian/patches/debian/Exclude-Debian-globally-allocated-UIDs-from-sys_uid-range.patch
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
From: Chris Hofstaedtler <zeha@debian.org>
|
||||
Date: Sun, 16 Mar 2025 13:29:45 +0100
|
||||
Subject: Exclude Debian-globally allocated UIDs from sys_uid range warning
|
||||
|
||||
Bug: http://bugs.debian.org/1100563
|
||||
---
|
||||
src/useradd.c | 11 +++++++++--
|
||||
1 file changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/useradd.c b/src/useradd.c
|
||||
index dc65618..25a5920 100644
|
||||
--- a/src/useradd.c
|
||||
+++ b/src/useradd.c
|
||||
@@ -2382,14 +2382,21 @@ static void create_mail (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
+/* See Debian Policy 9.2.2 "UID and GID classes"
|
||||
+ * https://www.debian.org/doc/debian-policy/ch-opersys.html#uid-and-gid-classes
|
||||
+ */
|
||||
+#define DEBIAN_GLOBAL_UID_MIN ((uid_t)60000)
|
||||
+#define DEBIAN_GLOBAL_UID_MAX ((uid_t)64999)
|
||||
+
|
||||
static void check_uid_range(int rflg, uid_t user_id)
|
||||
{
|
||||
uid_t uid_min ;
|
||||
uid_t uid_max ;
|
||||
if (rflg) {
|
||||
uid_max = getdef_ulong("SYS_UID_MAX",getdef_ulong("UID_MIN",1000UL)-1);
|
||||
- if (user_id > uid_max) {
|
||||
- fprintf(stderr, _("%s warning: %s's uid %d is greater than SYS_UID_MAX %d\n"), Prog, user_name, user_id, uid_max);
|
||||
+ if (user_id > uid_max
|
||||
+ && (!(user_id >= DEBIAN_GLOBAL_UID_MIN && user_id <= DEBIAN_GLOBAL_UID_MAX))) {
|
||||
+ fprintf(stderr, _("%s warning: %s's uid %d is greater than SYS_UID_MAX %d\n"), Prog, user_name, user_id, uid_max);
|
||||
}
|
||||
}else{
|
||||
uid_min = getdef_ulong("UID_MIN", 1000UL);
|
||||
@@ -17,7 +17,7 @@ configuration files shipped in Debian (debian/default/useradd).
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/man/useradd.8.xml b/man/useradd.8.xml
|
||||
index 001e7d1..4888100 100644
|
||||
index eda1fef..38f2c68 100644
|
||||
--- a/man/useradd.8.xml
|
||||
+++ b/man/useradd.8.xml
|
||||
@@ -248,7 +248,7 @@
|
||||
@@ -30,10 +30,10 @@ index 001e7d1..4888100 100644
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
diff --git a/src/useradd.c b/src/useradd.c
|
||||
index 347334a..ac43edd 100644
|
||||
index 6e744b0..dc65618 100644
|
||||
--- a/src/useradd.c
|
||||
+++ b/src/useradd.c
|
||||
@@ -91,14 +91,14 @@ static const char Prog[] = "useradd";
|
||||
@@ -97,14 +97,14 @@ static const char Prog[] = "useradd";
|
||||
/*
|
||||
* These defaults are used if there is no defaults file.
|
||||
*/
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
From: Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>
|
||||
Date: Sat, 22 Jun 2024 17:39:41 +0200
|
||||
Subject: Let pam_unix handle login failure delays
|
||||
|
||||
Fixes: #87648
|
||||
|
||||
Status wrt upstream: Forwarded but not applied yet
|
||||
|
||||
Note: If removed, FAIL_DELAY must be re-added to /etc/login.defs
|
||||
---
|
||||
lib/getdef.c | 1 -
|
||||
src/login.c | 19 +++++--------------
|
||||
2 files changed, 5 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/lib/getdef.c b/lib/getdef.c
|
||||
index 30f54ba..21307bb 100644
|
||||
--- a/lib/getdef.c
|
||||
+++ b/lib/getdef.c
|
||||
@@ -84,7 +84,6 @@ static struct itemdef def_table[] = {
|
||||
{"ENV_PATH", NULL},
|
||||
{"ENV_SUPATH", NULL},
|
||||
{"ERASECHAR", NULL},
|
||||
- {"FAIL_DELAY", NULL},
|
||||
{"FAKE_SHELL", NULL},
|
||||
{"GID_MAX", NULL},
|
||||
{"GID_MIN", NULL},
|
||||
diff --git a/src/login.c b/src/login.c
|
||||
index 9fed7b3..a5512d1 100644
|
||||
--- a/src/login.c
|
||||
+++ b/src/login.c
|
||||
@@ -490,7 +490,6 @@ int main (int argc, char **argv)
|
||||
const char *tmptty;
|
||||
const char *cp;
|
||||
const char *tmp;
|
||||
- unsigned int delay;
|
||||
unsigned int retries;
|
||||
unsigned int timeout;
|
||||
struct passwd *pwd = NULL;
|
||||
@@ -500,6 +499,7 @@ int main (int argc, char **argv)
|
||||
char *pam_user = NULL;
|
||||
pid_t child;
|
||||
#else
|
||||
+ unsigned int delay;
|
||||
bool is_console;
|
||||
struct spwd *spwd = NULL;
|
||||
# if defined(ENABLE_LASTLOG)
|
||||
@@ -669,7 +669,6 @@ int main (int argc, char **argv)
|
||||
}
|
||||
|
||||
environ = newenvp; /* make new environment active */
|
||||
- delay = getdef_unum ("FAIL_DELAY", 1);
|
||||
retries = getdef_unum ("LOGIN_RETRIES", RETRIES);
|
||||
|
||||
#ifdef USE_PAM
|
||||
@@ -685,8 +684,7 @@ int main (int argc, char **argv)
|
||||
|
||||
/*
|
||||
* hostname & tty are either set to NULL or their correct values,
|
||||
- * depending on how much we know. We also set PAM's fail delay to
|
||||
- * ours.
|
||||
+ * depending on how much we know.
|
||||
*
|
||||
* PAM_RHOST and PAM_TTY are used for authentication, only use
|
||||
* information coming from login or from the caller (e.g. no utmp)
|
||||
@@ -695,10 +693,6 @@ int main (int argc, char **argv)
|
||||
PAM_FAIL_CHECK;
|
||||
retcode = pam_set_item (pamh, PAM_TTY, tty);
|
||||
PAM_FAIL_CHECK;
|
||||
-#ifdef HAS_PAM_FAIL_DELAY
|
||||
- retcode = pam_fail_delay (pamh, 1000000 * delay);
|
||||
- PAM_FAIL_CHECK;
|
||||
-#endif
|
||||
/* if fflg, then the user has already been authenticated */
|
||||
if (!fflg) {
|
||||
char hostn[256];
|
||||
@@ -736,12 +730,6 @@ int main (int argc, char **argv)
|
||||
bool failed = false;
|
||||
|
||||
failcount++;
|
||||
-#ifdef HAS_PAM_FAIL_DELAY
|
||||
- if (delay > 0) {
|
||||
- retcode = pam_fail_delay(pamh, 1000000*delay);
|
||||
- PAM_FAIL_CHECK;
|
||||
- }
|
||||
-#endif
|
||||
|
||||
retcode = pam_authenticate (pamh, 0);
|
||||
|
||||
@@ -1032,14 +1020,17 @@ int main (int argc, char **argv)
|
||||
free (username);
|
||||
username = NULL;
|
||||
|
||||
+#ifndef USE_PAM
|
||||
/*
|
||||
* Wait a while (a la SVR4 /usr/bin/login) before attempting
|
||||
* to login the user again. If the earlier alarm occurs
|
||||
* before the sleep() below completes, login will exit.
|
||||
*/
|
||||
+ delay = getdef_unum ("FAIL_DELAY", 1);
|
||||
if (delay > 0) {
|
||||
(void) sleep (delay);
|
||||
}
|
||||
+#endif
|
||||
|
||||
(void) puts (_("Login incorrect"));
|
||||
|
||||
@@ -11,7 +11,7 @@ Status wrt upstream: Debian specific patch.
|
||||
2 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/man/useradd.8.xml b/man/useradd.8.xml
|
||||
index 4888100..17987a6 100644
|
||||
index 38f2c68..9009d83 100644
|
||||
--- a/man/useradd.8.xml
|
||||
+++ b/man/useradd.8.xml
|
||||
@@ -82,6 +82,12 @@
|
||||
@@ -28,7 +28,7 @@ index 4888100..17987a6 100644
|
||||
When invoked without the <option>-D</option> option, the
|
||||
<command>useradd</command> command creates a new user account using
|
||||
diff --git a/man/userdel.8.xml b/man/userdel.8.xml
|
||||
index 5bd2981..384cc86 100644
|
||||
index 32851f1..4373cd8 100644
|
||||
--- a/man/userdel.8.xml
|
||||
+++ b/man/userdel.8.xml
|
||||
@@ -58,6 +58,12 @@
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
From: Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>
|
||||
Date: Sat, 22 Jun 2024 17:39:41 +0200
|
||||
Subject: Relax usernames/groupnames checking
|
||||
|
||||
Allows any non-empty user/grounames that don't contain ':', ',' or '\n'
|
||||
characters and don't start with '-', '+', or '~'. This patch is more
|
||||
restrictive than original Karl's version. closes: #264879
|
||||
Also closes: #377844
|
||||
|
||||
Comments from Karl Ramm (shadow 1:4.0.3-9, 20 Aug 2003 02:06:50 -0400):
|
||||
|
||||
I can't come up with a good justification as to why characters other
|
||||
than ':'s and '\0's should be disallowed in group and usernames (other
|
||||
than '-' as the leading character). Thus, the maintenance tools don't
|
||||
anymore. closes: #79682, #166798, #171179
|
||||
|
||||
Status wrt upstream: Debian specific. Not to be used upstream
|
||||
---
|
||||
lib/chkname.c | 47 +++++++++++++++--------------------------------
|
||||
man/groupadd.8.xml | 6 ++++++
|
||||
man/useradd.8.xml | 8 ++++++++
|
||||
3 files changed, 29 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/lib/chkname.c b/lib/chkname.c
|
||||
index 995562f..d9678c6 100644
|
||||
--- a/lib/chkname.c
|
||||
+++ b/lib/chkname.c
|
||||
@@ -54,44 +54,27 @@ static bool is_valid_name (const char *name)
|
||||
}
|
||||
|
||||
/*
|
||||
- * User/group names must match BRE regex:
|
||||
- * [a-zA-Z0-9_.][a-zA-Z0-9_.-]*$\?
|
||||
- *
|
||||
- * as a non-POSIX, extension, allow "$" as the last char for
|
||||
- * sake of Samba 3.x "add machine script"
|
||||
- *
|
||||
- * Also do not allow fully numeric names or just "." or "..".
|
||||
- */
|
||||
- int numeric;
|
||||
-
|
||||
- if ('\0' == *name ||
|
||||
- ('.' == *name && (('.' == name[1] && '\0' == name[2]) ||
|
||||
- '\0' == name[1])) ||
|
||||
- !((*name >= 'a' && *name <= 'z') ||
|
||||
- (*name >= 'A' && *name <= 'Z') ||
|
||||
- (*name >= '0' && *name <= '9') ||
|
||||
- *name == '_' ||
|
||||
- *name == '.')) {
|
||||
+ * POSIX indicate that usernames are composed of characters from the
|
||||
+ * portable filename character set [A-Za-z0-9._-], and that the hyphen
|
||||
+ * should not be used as the first character of a portable user name.
|
||||
+ *
|
||||
+ * Allow more relaxed user/group names in Debian -- ^[^-~+:,\s][^:,\s]*$
|
||||
+ */
|
||||
+ if ( ('\0' == *name)
|
||||
+ || ('-' == *name)
|
||||
+ || ('~' == *name)
|
||||
+ || ('+' == *name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
- numeric = isdigit(*name);
|
||||
-
|
||||
- while ('\0' != *++name) {
|
||||
- if (!((*name >= 'a' && *name <= 'z') ||
|
||||
- (*name >= 'A' && *name <= 'Z') ||
|
||||
- (*name >= '0' && *name <= '9') ||
|
||||
- *name == '_' ||
|
||||
- *name == '.' ||
|
||||
- *name == '-' ||
|
||||
- (*name == '$' && name[1] == '\0')
|
||||
- )) {
|
||||
+ do {
|
||||
+ if ((':' == *name) || (',' == *name) || isspace(*name)) {
|
||||
return false;
|
||||
}
|
||||
- numeric &= isdigit(*name);
|
||||
- }
|
||||
+ name++;
|
||||
+ } while ('\0' != *name);
|
||||
|
||||
- return !numeric;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
|
||||
diff --git a/man/groupadd.8.xml b/man/groupadd.8.xml
|
||||
index 61a548f..d472bd0 100644
|
||||
--- a/man/groupadd.8.xml
|
||||
+++ b/man/groupadd.8.xml
|
||||
@@ -71,6 +71,12 @@
|
||||
Fully numeric groupnames and groupnames . or .. are
|
||||
also disallowed.
|
||||
</para>
|
||||
+ <para>
|
||||
+ On Debian, the only constraints are that groupnames must neither start
|
||||
+ with a dash ('-') nor plus ('+') nor tilde ('~') nor contain a
|
||||
+ colon (':'), a comma (','), or a whitespace (space:' ',
|
||||
+ end of line: '\n', tabulation: '\t', etc.).
|
||||
+ </para>
|
||||
<para>
|
||||
Groupnames may only be up to &GROUP_NAME_MAX_LENGTH; characters long.
|
||||
</para>
|
||||
diff --git a/man/useradd.8.xml b/man/useradd.8.xml
|
||||
index 17987a6..c98b214 100644
|
||||
--- a/man/useradd.8.xml
|
||||
+++ b/man/useradd.8.xml
|
||||
@@ -735,6 +735,14 @@
|
||||
<para>
|
||||
Usernames may only be up to 256 characters long.
|
||||
</para>
|
||||
+ <para>
|
||||
+ On Debian, the only constraints are that usernames must neither start
|
||||
+ with a dash ('-') nor plus ('+') nor tilde ('~') nor contain a
|
||||
+ colon (':'), a comma (','), or a whitespace (space: ' ',
|
||||
+ end of line: '\n', tabulation: '\t', etc.). Note that using a slash
|
||||
+ ('/') may break the default algorithm for the definition of the
|
||||
+ user's home directory.
|
||||
+ </para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='configuration'>
|
||||
@@ -12,19 +12,19 @@ Fixes: #166793
|
||||
3 files changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/commonio.c b/lib/commonio.c
|
||||
index 01a26c9..72e53b0 100644
|
||||
index fc8ad7a..24a3230 100644
|
||||
--- a/lib/commonio.c
|
||||
+++ b/lib/commonio.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <utime.h>
|
||||
+#include <grp.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "memzero.h"
|
||||
@@ -956,12 +957,23 @@ int commonio_close (struct commonio_db *db)
|
||||
if (errors != 0)
|
||||
#include "alloc/malloc.h"
|
||||
#include "alloc/reallocf.h"
|
||||
@@ -944,12 +945,23 @@ int commonio_close (struct commonio_db *db)
|
||||
if (errors)
|
||||
goto fail;
|
||||
} else {
|
||||
+ struct group *grp;
|
||||
@@ -48,10 +48,10 @@ index 01a26c9..72e53b0 100644
|
||||
|
||||
if (SNPRINTF(buf, "%s+", db->filename) == -1)
|
||||
diff --git a/lib/sgroupio.c b/lib/sgroupio.c
|
||||
index 0297df4..107b1e5 100644
|
||||
index 9805761..e3c0458 100644
|
||||
--- a/lib/sgroupio.c
|
||||
+++ b/lib/sgroupio.c
|
||||
@@ -209,7 +209,7 @@ static struct commonio_db gshadow_db = {
|
||||
@@ -210,7 +210,7 @@ static struct commonio_db gshadow_db = {
|
||||
#ifdef WITH_SELINUX
|
||||
NULL, /* scontext */
|
||||
#endif
|
||||
|
||||
561
debian/patches/debian/Stop-building-programs-we-do-not-install.patch
vendored
Normal file
561
debian/patches/debian/Stop-building-programs-we-do-not-install.patch
vendored
Normal file
@@ -0,0 +1,561 @@
|
||||
From: Chris Hofstaedtler <zeha@debian.org>
|
||||
Date: Tue, 6 Aug 2024 00:27:13 +0200
|
||||
Subject: Stop building programs we do not install
|
||||
|
||||
---
|
||||
man/Makefile.am | 15 ---------------
|
||||
man/cs/Makefile.am | 9 ---------
|
||||
man/da/Makefile.am | 3 ---
|
||||
man/de/Makefile.am | 10 ----------
|
||||
man/fr/Makefile.am | 10 ----------
|
||||
man/hu/Makefile.am | 3 ---
|
||||
man/id/Makefile.am | 1 -
|
||||
man/it/Makefile.am | 10 ----------
|
||||
man/ja/Makefile.am | 8 --------
|
||||
man/ko/Makefile.am | 2 --
|
||||
man/pl/Makefile.am | 6 ------
|
||||
man/ru/Makefile.am | 9 ---------
|
||||
man/sv/Makefile.am | 8 --------
|
||||
man/tr/Makefile.am | 2 --
|
||||
man/uk/Makefile.am | 9 ---------
|
||||
man/zh_CN/Makefile.am | 10 ----------
|
||||
man/zh_TW/Makefile.am | 2 --
|
||||
src/Makefile.am | 7 +++----
|
||||
18 files changed, 3 insertions(+), 121 deletions(-)
|
||||
|
||||
diff --git a/man/Makefile.am b/man/Makefile.am
|
||||
index 2523e84..05a0c86 100644
|
||||
--- a/man/Makefile.am
|
||||
+++ b/man/Makefile.am
|
||||
@@ -13,8 +13,6 @@ man_MANS = \
|
||||
man8/chpasswd.8 \
|
||||
man1/chsh.1 \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man3/getspnam.3 \
|
||||
man1/gpasswd.1 \
|
||||
man8/groupadd.8 \
|
||||
@@ -25,19 +23,14 @@ man_MANS = \
|
||||
man8/grpconv.8 \
|
||||
man8/grpunconv.8 \
|
||||
man5/gshadow.5 \
|
||||
- man1/login.1 \
|
||||
man5/login.defs.5 \
|
||||
- man8/logoutd.8 \
|
||||
- man1/newgrp.1 \
|
||||
man8/newusers.8 \
|
||||
- man8/nologin.8 \
|
||||
man1/passwd.1 \
|
||||
man5/passwd.5 \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
man8/shadowconfig.8 \
|
||||
- man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
man5/shadow.5 \
|
||||
man8/useradd.8 \
|
||||
@@ -82,8 +75,6 @@ man_XMANS = \
|
||||
chpasswd.8.xml \
|
||||
chsh.1.xml \
|
||||
expiry.1.xml \
|
||||
- faillog.5.xml \
|
||||
- faillog.8.xml \
|
||||
getsubids.1.xml \
|
||||
gpasswd.1.xml \
|
||||
groupadd.8.xml \
|
||||
@@ -96,12 +87,9 @@ man_XMANS = \
|
||||
login.1.xml \
|
||||
login.access.5.xml \
|
||||
login.defs.5.xml \
|
||||
- logoutd.8.xml \
|
||||
newgidmap.1.xml \
|
||||
- newgrp.1.xml \
|
||||
newuidmap.1.xml \
|
||||
newusers.8.xml \
|
||||
- nologin.8.xml \
|
||||
passwd.1.xml \
|
||||
passwd.5.xml \
|
||||
porttime.5.xml \
|
||||
@@ -109,9 +97,6 @@ man_XMANS = \
|
||||
pwconv.8.xml \
|
||||
shadow.3.xml \
|
||||
shadow.5.xml \
|
||||
- sg.1.xml \
|
||||
- su.1.xml \
|
||||
- suauth.5.xml \
|
||||
subgid.5.xml \
|
||||
subuid.5.xml \
|
||||
useradd.8.xml \
|
||||
diff --git a/man/cs/Makefile.am b/man/cs/Makefile.am
|
||||
index 45aec38..e1f9f87 100644
|
||||
--- a/man/cs/Makefile.am
|
||||
+++ b/man/cs/Makefile.am
|
||||
@@ -3,25 +3,16 @@ mandir = @mandir@/cs
|
||||
|
||||
man_MANS = \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man1/gpasswd.1 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
man8/groupmod.8 \
|
||||
man8/grpck.8 \
|
||||
man5/gshadow.5 \
|
||||
- man8/nologin.8 \
|
||||
man5/passwd.5 \
|
||||
man5/shadow.5 \
|
||||
- man1/su.1 \
|
||||
man8/vipw.8
|
||||
|
||||
if ENABLE_LASTLOG
|
||||
man_MANS += man8/lastlog.8
|
||||
endif
|
||||
-
|
||||
-EXTRA_DIST = $(man_MANS) \
|
||||
- man8/groupmems.8 \
|
||||
- man8/logoutd.8
|
||||
-
|
||||
diff --git a/man/da/Makefile.am b/man/da/Makefile.am
|
||||
index c61b787..12234cb 100644
|
||||
--- a/man/da/Makefile.am
|
||||
+++ b/man/da/Makefile.am
|
||||
@@ -6,10 +6,7 @@ man_MANS = \
|
||||
man1/chfn.1 \
|
||||
man8/groupdel.8 \
|
||||
man5/gshadow.5 \
|
||||
- man8/logoutd.8 \
|
||||
man1/newgrp.1 \
|
||||
- man8/nologin.8 \
|
||||
- man1/sg.1 \
|
||||
man8/vigr.8 \
|
||||
man8/vipw.8
|
||||
|
||||
diff --git a/man/de/Makefile.am b/man/de/Makefile.am
|
||||
index d3a6d6c..59602aa 100644
|
||||
--- a/man/de/Makefile.am
|
||||
+++ b/man/de/Makefile.am
|
||||
@@ -8,34 +8,24 @@ man_MANS = \
|
||||
man8/chpasswd.8 \
|
||||
man1/chsh.1 \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man3/getspnam.3 \
|
||||
man1/gpasswd.1 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
- man8/groupmems.8 \
|
||||
man8/groupmod.8 \
|
||||
man8/grpck.8 \
|
||||
man8/grpconv.8 \
|
||||
man8/grpunconv.8 \
|
||||
man5/gshadow.5 \
|
||||
- man1/login.1 \
|
||||
man5/login.defs.5 \
|
||||
- man8/logoutd.8 \
|
||||
- man1/newgrp.1 \
|
||||
man8/newusers.8 \
|
||||
- man8/nologin.8 \
|
||||
man1/passwd.1 \
|
||||
man5/passwd.5 \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
- man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
man5/shadow.5 \
|
||||
- man1/su.1 \
|
||||
- man5/suauth.5 \
|
||||
man8/useradd.8 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8 \
|
||||
diff --git a/man/fr/Makefile.am b/man/fr/Makefile.am
|
||||
index 2365e23..6cbaadc 100644
|
||||
--- a/man/fr/Makefile.am
|
||||
+++ b/man/fr/Makefile.am
|
||||
@@ -8,34 +8,24 @@ man_MANS = \
|
||||
man8/chpasswd.8 \
|
||||
man1/chsh.1 \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man3/getspnam.3 \
|
||||
man1/gpasswd.1 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
- man8/groupmems.8 \
|
||||
man8/groupmod.8 \
|
||||
man8/grpck.8 \
|
||||
man8/grpconv.8 \
|
||||
man8/grpunconv.8 \
|
||||
man5/gshadow.5 \
|
||||
- man1/login.1 \
|
||||
man5/login.defs.5 \
|
||||
- man8/logoutd.8 \
|
||||
- man1/newgrp.1 \
|
||||
man8/newusers.8 \
|
||||
- man8/nologin.8 \
|
||||
man1/passwd.1 \
|
||||
man5/passwd.5 \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
- man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
man5/shadow.5 \
|
||||
- man1/su.1 \
|
||||
- man5/suauth.5 \
|
||||
man8/useradd.8 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8 \
|
||||
diff --git a/man/hu/Makefile.am b/man/hu/Makefile.am
|
||||
index 6bf68e8..2930da3 100644
|
||||
--- a/man/hu/Makefile.am
|
||||
+++ b/man/hu/Makefile.am
|
||||
@@ -4,11 +4,8 @@ mandir = @mandir@/hu
|
||||
man_MANS = \
|
||||
man1/chsh.1 \
|
||||
man1/gpasswd.1 \
|
||||
- man1/login.1 \
|
||||
- man1/newgrp.1 \
|
||||
man1/passwd.1 \
|
||||
man5/passwd.5 \
|
||||
- man1/sg.1 \
|
||||
man1/su.1
|
||||
|
||||
if ENABLE_LASTLOG
|
||||
diff --git a/man/id/Makefile.am b/man/id/Makefile.am
|
||||
index 21f3dbe..566fa8b 100644
|
||||
--- a/man/id/Makefile.am
|
||||
+++ b/man/id/Makefile.am
|
||||
@@ -3,7 +3,6 @@ mandir = @mandir@/id
|
||||
|
||||
man_MANS = \
|
||||
man1/chsh.1 \
|
||||
- man1/login.1 \
|
||||
man8/useradd.8
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
diff --git a/man/it/Makefile.am b/man/it/Makefile.am
|
||||
index 736576c..3312232 100644
|
||||
--- a/man/it/Makefile.am
|
||||
+++ b/man/it/Makefile.am
|
||||
@@ -8,34 +8,24 @@ man_MANS = \
|
||||
man8/chpasswd.8 \
|
||||
man1/chsh.1 \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man3/getspnam.3 \
|
||||
man1/gpasswd.1 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
- man8/groupmems.8 \
|
||||
man8/groupmod.8 \
|
||||
man8/grpck.8 \
|
||||
man8/grpconv.8 \
|
||||
man8/grpunconv.8 \
|
||||
man5/gshadow.5 \
|
||||
- man1/login.1 \
|
||||
man5/login.defs.5 \
|
||||
- man8/logoutd.8 \
|
||||
- man1/newgrp.1 \
|
||||
man8/newusers.8 \
|
||||
- man8/nologin.8 \
|
||||
man1/passwd.1 \
|
||||
man5/passwd.5 \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
- man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
man5/shadow.5 \
|
||||
- man1/su.1 \
|
||||
- man5/suauth.5 \
|
||||
man8/useradd.8 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8 \
|
||||
diff --git a/man/ja/Makefile.am b/man/ja/Makefile.am
|
||||
index b759726..1e22da2 100644
|
||||
--- a/man/ja/Makefile.am
|
||||
+++ b/man/ja/Makefile.am
|
||||
@@ -7,8 +7,6 @@ man_MANS = \
|
||||
man8/chpasswd.8 \
|
||||
man1/chsh.1 \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man1/gpasswd.1 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
@@ -16,20 +14,14 @@ man_MANS = \
|
||||
man8/grpck.8 \
|
||||
man8/grpconv.8 \
|
||||
man8/grpunconv.8 \
|
||||
- man1/login.1 \
|
||||
man5/login.defs.5 \
|
||||
- man8/logoutd.8 \
|
||||
- man1/newgrp.1 \
|
||||
man8/newusers.8 \
|
||||
man1/passwd.1 \
|
||||
man5/passwd.5 \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
- man1/sg.1 \
|
||||
man5/shadow.5 \
|
||||
- man1/su.1 \
|
||||
- man5/suauth.5 \
|
||||
man8/useradd.8 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8 \
|
||||
diff --git a/man/ko/Makefile.am b/man/ko/Makefile.am
|
||||
index 4f73651..0f17a17 100644
|
||||
--- a/man/ko/Makefile.am
|
||||
+++ b/man/ko/Makefile.am
|
||||
@@ -4,9 +4,7 @@ mandir = @mandir@/ko
|
||||
man_MANS = \
|
||||
man1/chfn.1 \
|
||||
man1/chsh.1 \
|
||||
- man1/login.1 \
|
||||
man5/passwd.5 \
|
||||
- man1/su.1 \
|
||||
man8/vigr.8 \
|
||||
man8/vipw.8
|
||||
# newgrp.1 must be updated
|
||||
diff --git a/man/pl/Makefile.am b/man/pl/Makefile.am
|
||||
index 2a015f3..02f4533 100644
|
||||
--- a/man/pl/Makefile.am
|
||||
+++ b/man/pl/Makefile.am
|
||||
@@ -6,17 +6,11 @@ man_MANS = \
|
||||
man1/chage.1 \
|
||||
man1/chsh.1 \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man3/getspnam.3 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
- man8/groupmems.8 \
|
||||
man8/groupmod.8 \
|
||||
man8/grpck.8 \
|
||||
- man8/logoutd.8 \
|
||||
- man1/newgrp.1 \
|
||||
- man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8 \
|
||||
diff --git a/man/ru/Makefile.am b/man/ru/Makefile.am
|
||||
index 845a603..9afcb22 100644
|
||||
--- a/man/ru/Makefile.am
|
||||
+++ b/man/ru/Makefile.am
|
||||
@@ -8,22 +8,16 @@ man_MANS = \
|
||||
man8/chpasswd.8 \
|
||||
man1/chsh.1 \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man3/getspnam.3 \
|
||||
man1/gpasswd.1 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
- man8/groupmems.8 \
|
||||
man8/groupmod.8 \
|
||||
man8/grpck.8 \
|
||||
man8/grpconv.8 \
|
||||
man8/grpunconv.8 \
|
||||
man5/gshadow.5 \
|
||||
- man1/login.1 \
|
||||
man5/login.defs.5 \
|
||||
- man8/logoutd.8 \
|
||||
- man1/newgrp.1 \
|
||||
man8/newusers.8 \
|
||||
man8/nologin.8 \
|
||||
man1/passwd.1 \
|
||||
@@ -31,11 +25,8 @@ man_MANS = \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
- man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
man5/shadow.5 \
|
||||
- man1/su.1 \
|
||||
- man5/suauth.5 \
|
||||
man8/useradd.8 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8 \
|
||||
diff --git a/man/sv/Makefile.am b/man/sv/Makefile.am
|
||||
index 1918af7..d572c36 100644
|
||||
--- a/man/sv/Makefile.am
|
||||
+++ b/man/sv/Makefile.am
|
||||
@@ -5,24 +5,16 @@ man_MANS = \
|
||||
man1/chage.1 \
|
||||
man1/chsh.1 \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man3/getspnam.3 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
- man8/groupmems.8 \
|
||||
man8/groupmod.8 \
|
||||
man8/grpck.8 \
|
||||
man5/gshadow.5 \
|
||||
- man8/logoutd.8 \
|
||||
- man1/newgrp.1 \
|
||||
- man8/nologin.8 \
|
||||
man1/passwd.1 \
|
||||
man5/passwd.5 \
|
||||
man8/pwck.8 \
|
||||
- man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
- man5/suauth.5 \
|
||||
man8/userdel.8 \
|
||||
man8/vigr.8 \
|
||||
man8/vipw.8
|
||||
diff --git a/man/tr/Makefile.am b/man/tr/Makefile.am
|
||||
index 8d8b916..8b2aa2d 100644
|
||||
--- a/man/tr/Makefile.am
|
||||
+++ b/man/tr/Makefile.am
|
||||
@@ -6,11 +6,9 @@ man_MANS = \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
man8/groupmod.8 \
|
||||
- man1/login.1 \
|
||||
man1/passwd.1 \
|
||||
man5/passwd.5 \
|
||||
man5/shadow.5 \
|
||||
- man1/su.1 \
|
||||
man8/useradd.8 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8
|
||||
diff --git a/man/uk/Makefile.am b/man/uk/Makefile.am
|
||||
index a0f106d..f069eea 100644
|
||||
--- a/man/uk/Makefile.am
|
||||
+++ b/man/uk/Makefile.am
|
||||
@@ -8,34 +8,25 @@ man_MANS = \
|
||||
man8/chpasswd.8 \
|
||||
man1/chsh.1 \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man3/getspnam.3 \
|
||||
man1/gpasswd.1 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
- man8/groupmems.8 \
|
||||
man8/groupmod.8 \
|
||||
man8/grpck.8 \
|
||||
man8/grpconv.8 \
|
||||
man8/grpunconv.8 \
|
||||
man5/gshadow.5 \
|
||||
- man1/login.1 \
|
||||
man5/login.defs.5 \
|
||||
- man8/logoutd.8 \
|
||||
man1/newgrp.1 \
|
||||
man8/newusers.8 \
|
||||
- man8/nologin.8 \
|
||||
man1/passwd.1 \
|
||||
man5/passwd.5 \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
- man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
man5/shadow.5 \
|
||||
- man1/su.1 \
|
||||
- man5/suauth.5 \
|
||||
man8/useradd.8 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8 \
|
||||
diff --git a/man/zh_CN/Makefile.am b/man/zh_CN/Makefile.am
|
||||
index 59d1072..9402a9e 100644
|
||||
--- a/man/zh_CN/Makefile.am
|
||||
+++ b/man/zh_CN/Makefile.am
|
||||
@@ -8,34 +8,24 @@ man_MANS = \
|
||||
man8/chpasswd.8 \
|
||||
man1/chsh.1 \
|
||||
man1/expiry.1 \
|
||||
- man5/faillog.5 \
|
||||
- man8/faillog.8 \
|
||||
man3/getspnam.3 \
|
||||
man1/gpasswd.1 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
- man8/groupmems.8 \
|
||||
man8/groupmod.8 \
|
||||
man8/grpck.8 \
|
||||
man8/grpconv.8 \
|
||||
man8/grpunconv.8 \
|
||||
man5/gshadow.5 \
|
||||
- man1/login.1 \
|
||||
man5/login.defs.5 \
|
||||
- man8/logoutd.8 \
|
||||
- man1/newgrp.1 \
|
||||
man8/newusers.8 \
|
||||
- man8/nologin.8 \
|
||||
man1/passwd.1 \
|
||||
man5/passwd.5 \
|
||||
man8/pwck.8 \
|
||||
man8/pwconv.8 \
|
||||
man8/pwunconv.8 \
|
||||
- man1/sg.1 \
|
||||
man3/shadow.3 \
|
||||
man5/shadow.5 \
|
||||
- man1/su.1 \
|
||||
- man5/suauth.5 \
|
||||
man8/useradd.8 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8 \
|
||||
diff --git a/man/zh_TW/Makefile.am b/man/zh_TW/Makefile.am
|
||||
index c36ed2c..6fb6a15 100644
|
||||
--- a/man/zh_TW/Makefile.am
|
||||
+++ b/man/zh_TW/Makefile.am
|
||||
@@ -5,12 +5,10 @@ man_MANS = \
|
||||
man1/chfn.1 \
|
||||
man1/chsh.1 \
|
||||
man8/chpasswd.8 \
|
||||
- man1/newgrp.1 \
|
||||
man8/groupadd.8 \
|
||||
man8/groupdel.8 \
|
||||
man8/groupmod.8 \
|
||||
man5/passwd.5 \
|
||||
- man1/su.1 \
|
||||
man8/useradd.8 \
|
||||
man8/userdel.8 \
|
||||
man8/usermod.8
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index 6981815..5ca78ed 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -26,8 +26,8 @@ AM_CFLAGS = $(LIBBSD_CFLAGS)
|
||||
# and installation would be much simpler (just two directories,
|
||||
# $prefix/bin and $prefix/sbin, no install-data hacks...)
|
||||
|
||||
-bin_PROGRAMS = login
|
||||
-sbin_PROGRAMS = nologin
|
||||
+bin_PROGRAMS =
|
||||
+sbin_PROGRAMS =
|
||||
ubin_PROGRAMS = faillog chage chfn chsh expiry gpasswd newgrp passwd
|
||||
if ENABLE_SUBIDS
|
||||
ubin_PROGRAMS += newgidmap newuidmap
|
||||
@@ -48,7 +48,6 @@ usbin_PROGRAMS = \
|
||||
grpck \
|
||||
grpconv \
|
||||
grpunconv \
|
||||
- logoutd \
|
||||
newusers \
|
||||
pwck \
|
||||
pwconv \
|
||||
@@ -59,7 +58,7 @@ usbin_PROGRAMS = \
|
||||
vipw
|
||||
|
||||
# sulogin from sysvinit
|
||||
-noinst_PROGRAMS = sulogin
|
||||
+noinst_PROGRAMS =
|
||||
|
||||
suidusbins =
|
||||
suidbins =
|
||||
104
debian/patches/debian/Warn-when-badname-and-variants-are-given.patch
vendored
Normal file
104
debian/patches/debian/Warn-when-badname-and-variants-are-given.patch
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
From: Chris Hofstaedtler <zeha@debian.org>
|
||||
Date: Mon, 17 Feb 2025 18:17:15 +0100
|
||||
Subject: Warn when --badname (and variants) are given
|
||||
|
||||
Upstream PR 1158 will remove them, probably in the forky timeframe.
|
||||
---
|
||||
src/newusers.c | 5 ++++-
|
||||
src/pwck.c | 5 ++++-
|
||||
src/useradd.c | 5 ++++-
|
||||
src/usermod.c | 5 ++++-
|
||||
4 files changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/newusers.c b/src/newusers.c
|
||||
index e3685ef..16abd81 100644
|
||||
--- a/src/newusers.c
|
||||
+++ b/src/newusers.c
|
||||
@@ -127,7 +127,7 @@ static void usage (int status)
|
||||
"\n"
|
||||
"Options:\n"),
|
||||
Prog);
|
||||
- (void) fputs (_(" -b, --badname allow bad names\n"), usageout);
|
||||
+ (void) fputs (_(" -b, --badname allow bad names (DEPRECATED)\n"), usageout);
|
||||
#ifndef USE_PAM
|
||||
(void) fprintf (usageout,
|
||||
_(" -c, --crypt-method METHOD the crypt method (one of %s)\n"),
|
||||
@@ -660,6 +660,9 @@ static void process_flags (int argc, char **argv)
|
||||
switch (c) {
|
||||
case 'b':
|
||||
allow_bad_names = true;
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: WARNING: -b and --badname are deprecated and will be removed\n"),
|
||||
+ Prog);
|
||||
break;
|
||||
#ifndef USE_PAM
|
||||
case 'c':
|
||||
diff --git a/src/pwck.c b/src/pwck.c
|
||||
index b485a5a..e20be0f 100644
|
||||
--- a/src/pwck.c
|
||||
+++ b/src/pwck.c
|
||||
@@ -133,7 +133,7 @@ usage (int status)
|
||||
"Options:\n"),
|
||||
Prog);
|
||||
}
|
||||
- (void) fputs (_(" -b, --badname allow bad names\n"), usageout);
|
||||
+ (void) fputs (_(" -b, --badname allow bad names (DEPRECATED)\n"), usageout);
|
||||
(void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
|
||||
(void) fputs (_(" -q, --quiet report errors only\n"), usageout);
|
||||
(void) fputs (_(" -r, --read-only display errors and warnings\n"
|
||||
@@ -175,6 +175,9 @@ static void process_flags (int argc, char **argv)
|
||||
switch (c) {
|
||||
case 'b':
|
||||
allow_bad_names = true;
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: WARNING: --badname is deprecated and will be removed\n"),
|
||||
+ Prog);
|
||||
break;
|
||||
case 'h':
|
||||
usage (E_SUCCESS);
|
||||
diff --git a/src/useradd.c b/src/useradd.c
|
||||
index 25a5920..7e9dbce 100644
|
||||
--- a/src/useradd.c
|
||||
+++ b/src/useradd.c
|
||||
@@ -879,7 +879,7 @@ static void usage (int status)
|
||||
"\n"
|
||||
"Options:\n"),
|
||||
Prog, Prog, Prog);
|
||||
- (void) fputs (_(" --badname do not check for bad names\n"), usageout);
|
||||
+ (void) fputs (_(" --badname do not check for bad names (DEPRECATED)\n"), usageout);
|
||||
(void) fputs (_(" -b, --base-dir BASE_DIR base directory for the home directory of the\n"
|
||||
" new account\n"), usageout);
|
||||
#ifdef WITH_BTRFS
|
||||
@@ -1202,6 +1202,9 @@ static void process_flags (int argc, char **argv)
|
||||
break;
|
||||
case 201:
|
||||
allow_bad_names = true;
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: WARNING: --badname is deprecated and will be removed\n"),
|
||||
+ Prog);
|
||||
break;
|
||||
case 'c':
|
||||
if (!VALID (optarg)) {
|
||||
diff --git a/src/usermod.c b/src/usermod.c
|
||||
index 22113da..9030883 100644
|
||||
--- a/src/usermod.c
|
||||
+++ b/src/usermod.c
|
||||
@@ -383,7 +383,7 @@ usage (int status)
|
||||
(void) fputs (_(" -a, --append append the user to the supplemental GROUPS\n"
|
||||
" mentioned by the -G option without removing\n"
|
||||
" the user from other groups\n"), usageout);
|
||||
- (void) fputs (_(" -b, --badname allow bad names\n"), usageout);
|
||||
+ (void) fputs (_(" -b, --badname allow bad names (DEPRECATED)\n"), usageout);
|
||||
(void) fputs (_(" -c, --comment COMMENT new value of the GECOS field\n"), usageout);
|
||||
(void) fputs (_(" -d, --home HOME_DIR new home directory for the user account\n"), usageout);
|
||||
(void) fputs (_(" -e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE\n"), usageout);
|
||||
@@ -1054,6 +1054,9 @@ process_flags(int argc, char **argv)
|
||||
break;
|
||||
case 'b':
|
||||
allow_bad_names = true;
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: WARNING: -b, --badname and --badnames are deprecated and will be removed\n"),
|
||||
+ Prog);
|
||||
break;
|
||||
case 'c':
|
||||
if (!VALID (optarg)) {
|
||||
23
debian/patches/debian/configure.ac-align-exec_prefix-with-prefix.patch
vendored
Normal file
23
debian/patches/debian/configure.ac-align-exec_prefix-with-prefix.patch
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
From: Chris Hofstaedtler <zeha@debian.org>
|
||||
Date: Mon, 24 Feb 2025 23:24:41 +0100
|
||||
Subject: configure.ac: align exec_prefix with prefix
|
||||
|
||||
Hopefully upstream will fix this one day.
|
||||
Reported as https://github.com/shadow-maint/shadow/issues/1229
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 571e20d..c9cd472 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -18,7 +18,7 @@ AC_SUBST([LIBSUBID_ABI], [libsubid_abi])
|
||||
|
||||
dnl Some hacks...
|
||||
test "$prefix" = "NONE" && prefix="/usr"
|
||||
-test "$prefix" = "/usr" && exec_prefix=""
|
||||
+test "$prefix" = "/usr" && exec_prefix="/usr"
|
||||
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
287
debian/patches/debian/cppw-Add-tool.patch
vendored
287
debian/patches/debian/cppw-Add-tool.patch
vendored
@@ -1,287 +0,0 @@
|
||||
From: Nicolas FRANCOIS <nicolas.francois@centraliens.net>
|
||||
Date: Sat, 22 Jun 2024 17:39:41 +0200
|
||||
Subject: cppw: Add tool
|
||||
|
||||
---
|
||||
po/POTFILES.in | 1 +
|
||||
src/Makefile.am | 2 +
|
||||
src/cppw.c | 238 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 241 insertions(+)
|
||||
create mode 100644 src/cppw.c
|
||||
|
||||
diff --git a/po/POTFILES.in b/po/POTFILES.in
|
||||
index 9ff6100..a60c93e 100644
|
||||
--- a/po/POTFILES.in
|
||||
+++ b/po/POTFILES.in
|
||||
@@ -86,6 +86,7 @@ src/chfn.c
|
||||
src/chgpasswd.c
|
||||
src/chpasswd.c
|
||||
src/chsh.c
|
||||
+src/cppw.c
|
||||
src/expiry.c
|
||||
src/faillog.c
|
||||
src/gpasswd.c
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index b6cb09e..c86ba52 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -39,6 +39,7 @@ if WITH_SU
|
||||
bin_PROGRAMS += su
|
||||
endif
|
||||
usbin_PROGRAMS = \
|
||||
+ cppw \
|
||||
chgpasswd \
|
||||
chpasswd \
|
||||
groupadd \
|
||||
@@ -104,6 +105,7 @@ newuidmap_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCAP) $(LIBECONF) -l
|
||||
newgidmap_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCAP) $(LIBECONF) -ldl
|
||||
chfn_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) $(LIBECONF)
|
||||
chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) $(LIBECONF)
|
||||
+cppw_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX)
|
||||
chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) $(LIBECONF)
|
||||
chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) $(LIBECONF) -ldl
|
||||
expiry_LDADD = $(LDADD) $(LIBECONF)
|
||||
diff --git a/src/cppw.c b/src/cppw.c
|
||||
new file mode 100644
|
||||
index 0000000..beb4c36
|
||||
--- /dev/null
|
||||
+++ b/src/cppw.c
|
||||
@@ -0,0 +1,238 @@
|
||||
+/*
|
||||
+ cppw, cpgr copy with locking given file over the password or group file
|
||||
+ with -s will copy with locking given file over shadow or gshadow file
|
||||
+
|
||||
+ Copyright (C) 1999 Stephen Frost <sfrost@snowman.net>
|
||||
+
|
||||
+ Based on vipw, vigr by:
|
||||
+ Copyright (C) 1997 Guy Maor <maor@ece.utexas.edu>
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful, but
|
||||
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+
|
||||
+ */
|
||||
+
|
||||
+#include <config.h>
|
||||
+#include "defines.h"
|
||||
+
|
||||
+#include <errno.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <unistd.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <signal.h>
|
||||
+#include <utime.h>
|
||||
+#include "exitcodes.h"
|
||||
+#include "prototypes.h"
|
||||
+#include "pwio.h"
|
||||
+#include "shadowio.h"
|
||||
+#include "groupio.h"
|
||||
+#include "sgroupio.h"
|
||||
+
|
||||
+
|
||||
+const char *Prog;
|
||||
+
|
||||
+const char *filename, *filenewname;
|
||||
+static bool filelocked = false;
|
||||
+static int (*unlock) (void);
|
||||
+
|
||||
+/* local function prototypes */
|
||||
+static int create_copy (FILE *fp, const char *dest, struct stat *sb);
|
||||
+static void cppwexit (const char *msg, int syserr, int ret);
|
||||
+static void cppwcopy (const char *file,
|
||||
+ const char *in_file,
|
||||
+ int (*file_lock) (void),
|
||||
+ int (*file_unlock) (void));
|
||||
+
|
||||
+static int create_copy (FILE *fp, const char *dest, struct stat *sb)
|
||||
+{
|
||||
+ struct utimbuf ub;
|
||||
+ FILE *bkfp;
|
||||
+ int c;
|
||||
+ mode_t mask;
|
||||
+
|
||||
+ mask = umask (077);
|
||||
+ bkfp = fopen (dest, "w");
|
||||
+ (void) umask (mask);
|
||||
+ if (NULL == bkfp) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ rewind (fp);
|
||||
+ while ((c = getc (fp)) != EOF) {
|
||||
+ if (putc (c, bkfp) == EOF) {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if ( (c != EOF)
|
||||
+ || (fflush (bkfp) != 0)) {
|
||||
+ (void) fclose (bkfp);
|
||||
+ (void) unlink (dest);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if ( (fsync (fileno (bkfp)) != 0)
|
||||
+ || (fclose (bkfp) != 0)) {
|
||||
+ (void) unlink (dest);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ ub.actime = sb->st_atime;
|
||||
+ ub.modtime = sb->st_mtime;
|
||||
+ if ( (utime (dest, &ub) != 0)
|
||||
+ || (chmod (dest, sb->st_mode) != 0)
|
||||
+ || (chown (dest, sb->st_uid, sb->st_gid) != 0)) {
|
||||
+ (void) unlink (dest);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void cppwexit (const char *msg, int syserr, int ret)
|
||||
+{
|
||||
+ int err = errno;
|
||||
+ if (filelocked) {
|
||||
+ (*unlock) ();
|
||||
+ }
|
||||
+ if (NULL != msg) {
|
||||
+ fprintf (stderr, "%s: %s", Prog, msg);
|
||||
+ if (0 != syserr) {
|
||||
+ fprintf (stderr, ": %s", strerror (err));
|
||||
+ }
|
||||
+ (void) fputs ("\n", stderr);
|
||||
+ }
|
||||
+ if (NULL != filename) {
|
||||
+ fprintf (stderr, _("%s: %s is unchanged\n"), Prog, filename);
|
||||
+ } else {
|
||||
+ fprintf (stderr, _("%s: no changes\n"), Prog);
|
||||
+ }
|
||||
+
|
||||
+ exit (ret);
|
||||
+}
|
||||
+
|
||||
+static void cppwcopy (const char *file,
|
||||
+ const char *in_file,
|
||||
+ int (*file_lock) (void),
|
||||
+ int (*file_unlock) (void))
|
||||
+{
|
||||
+ struct stat st1;
|
||||
+ FILE *f;
|
||||
+ char filenew[1024];
|
||||
+
|
||||
+ snprintf (filenew, sizeof filenew, "%s.new", file);
|
||||
+ unlock = file_unlock;
|
||||
+ filename = file;
|
||||
+ filenewname = filenew;
|
||||
+
|
||||
+ if (access (file, F_OK) != 0) {
|
||||
+ cppwexit (file, 1, 1);
|
||||
+ }
|
||||
+ if (file_lock () == 0) {
|
||||
+ cppwexit (_("Couldn't lock file"), 0, 5);
|
||||
+ }
|
||||
+ filelocked = true;
|
||||
+
|
||||
+ /* file to copy has same owners, perm */
|
||||
+ if (stat (file, &st1) != 0) {
|
||||
+ cppwexit (file, 1, 1);
|
||||
+ }
|
||||
+ f = fopen (in_file, "r");
|
||||
+ if (NULL == f) {
|
||||
+ cppwexit (in_file, 1, 1);
|
||||
+ }
|
||||
+ if (create_copy (f, filenew, &st1) != 0) {
|
||||
+ cppwexit (_("Couldn't make copy"), errno, 1);
|
||||
+ }
|
||||
+
|
||||
+ /* XXX - here we should check filenew for errors; if there are any,
|
||||
+ * fail w/ an appropriate error code and let the user manually fix
|
||||
+ * it. Use pwck or grpck to do the check. - Stephen (Shamelessly
|
||||
+ * stolen from '--marekm's comment) */
|
||||
+
|
||||
+ if (rename (filenew, file) != 0) {
|
||||
+ fprintf (stderr, _("%s: can't copy %s: %s)\n"),
|
||||
+ Prog, filenew, strerror (errno));
|
||||
+ cppwexit (NULL,0,1);
|
||||
+ }
|
||||
+
|
||||
+ (*file_unlock) ();
|
||||
+}
|
||||
+
|
||||
+int main (int argc, char **argv)
|
||||
+{
|
||||
+ int flag;
|
||||
+ bool cpshadow = false;
|
||||
+ char *in_file;
|
||||
+ int e = E_USAGE;
|
||||
+ bool do_cppw = true;
|
||||
+
|
||||
+ (void) setlocale (LC_ALL, "");
|
||||
+ (void) bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
+ (void) textdomain (PACKAGE);
|
||||
+
|
||||
+ Prog = Basename (argv[0]);
|
||||
+ if (strcmp (Prog, "cpgr") == 0) {
|
||||
+ do_cppw = false;
|
||||
+ }
|
||||
+
|
||||
+ while ((flag = getopt (argc, argv, "ghps")) != EOF) {
|
||||
+ switch (flag) {
|
||||
+ case 'p':
|
||||
+ do_cppw = true;
|
||||
+ break;
|
||||
+ case 'g':
|
||||
+ do_cppw = false;
|
||||
+ break;
|
||||
+ case 's':
|
||||
+ cpshadow = true;
|
||||
+ break;
|
||||
+ case 'h':
|
||||
+ e = E_SUCCESS;
|
||||
+ /*pass through*/
|
||||
+ default:
|
||||
+ (void) fputs (_("Usage:\n\
|
||||
+`cppw <file>' copys over /etc/passwd `cppw -s <file>' copys over /etc/shadow\n\
|
||||
+`cpgr <file>' copys over /etc/group `cpgr -s <file>' copys over /etc/gshadow\n\
|
||||
+"), (E_SUCCESS != e) ? stderr : stdout);
|
||||
+ exit (e);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (argc != optind + 1) {
|
||||
+ cppwexit (_("wrong number of arguments, -h for usage"),0,1);
|
||||
+ }
|
||||
+
|
||||
+ in_file = argv[optind];
|
||||
+
|
||||
+ if (do_cppw) {
|
||||
+ if (cpshadow) {
|
||||
+ cppwcopy (SHADOW_FILE, in_file, spw_lock, spw_unlock);
|
||||
+ } else {
|
||||
+ cppwcopy (PASSWD_FILE, in_file, pw_lock, pw_unlock);
|
||||
+ }
|
||||
+ } else {
|
||||
+#ifdef SHADOWGRP
|
||||
+ if (cpshadow) {
|
||||
+ cppwcopy (SGROUP_FILE, in_file, sgr_lock, sgr_unlock);
|
||||
+ } else
|
||||
+#endif /* SHADOWGRP */
|
||||
+ {
|
||||
+ cppwcopy (GROUP_FILE, in_file, gr_lock, gr_unlock);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
@@ -1,63 +0,0 @@
|
||||
From: Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>
|
||||
Date: Sat, 22 Jun 2024 17:39:41 +0200
|
||||
Subject: cppw: add selinux support
|
||||
|
||||
Status wrt upstream: cppw is not available upstream.
|
||||
Needs to be reviewed by an SE-Linux aware person.
|
||||
---
|
||||
src/cppw.c | 28 ++++++++++++++++++++++++++++
|
||||
1 file changed, 28 insertions(+)
|
||||
|
||||
diff --git a/src/cppw.c b/src/cppw.c
|
||||
index beb4c36..2cbbbc0 100644
|
||||
--- a/src/cppw.c
|
||||
+++ b/src/cppw.c
|
||||
@@ -34,6 +34,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#include <utime.h>
|
||||
+#ifdef WITH_SELINUX
|
||||
+#include <selinux/selinux.h>
|
||||
+#endif /* WITH_SELINUX */
|
||||
#include "exitcodes.h"
|
||||
#include "prototypes.h"
|
||||
#include "pwio.h"
|
||||
@@ -139,6 +142,22 @@ static void cppwcopy (const char *file,
|
||||
if (access (file, F_OK) != 0) {
|
||||
cppwexit (file, 1, 1);
|
||||
}
|
||||
+#ifdef WITH_SELINUX
|
||||
+ /* if SE Linux is enabled then set the context of all new files
|
||||
+ * to be the context of the file we are editing */
|
||||
+ if (is_selinux_enabled () > 0) {
|
||||
+ security_context_t passwd_context=NULL;
|
||||
+ int ret = 0;
|
||||
+ if (getfilecon (file, &passwd_context) < 0) {
|
||||
+ cppwexit (_("Couldn't get file context"), errno, 1);
|
||||
+ }
|
||||
+ ret = setfscreatecon (passwd_context);
|
||||
+ freecon (passwd_context);
|
||||
+ if (0 != ret) {
|
||||
+ cppwexit (_("setfscreatecon () failed"), errno, 1);
|
||||
+ }
|
||||
+ }
|
||||
+#endif /* WITH_SELINUX */
|
||||
if (file_lock () == 0) {
|
||||
cppwexit (_("Couldn't lock file"), 0, 5);
|
||||
}
|
||||
@@ -167,6 +186,15 @@ static void cppwcopy (const char *file,
|
||||
cppwexit (NULL,0,1);
|
||||
}
|
||||
|
||||
+#ifdef WITH_SELINUX
|
||||
+ /* unset the fscreatecon */
|
||||
+ if (is_selinux_enabled () > 0) {
|
||||
+ if (setfscreatecon (NULL)) {
|
||||
+ cppwexit (_("setfscreatecon() failed"), errno, 1);
|
||||
+ }
|
||||
+ }
|
||||
+#endif /* WITH_SELINUX */
|
||||
+
|
||||
(*file_unlock) ();
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
From: Chris Hofstaedtler <zeha@debian.org>
|
||||
Date: Sat, 6 Jul 2024 23:35:51 +0200
|
||||
Subject: tests/libsubid/04_nss: fix setting basedir
|
||||
|
||||
---
|
||||
tests/libsubid/04_nss/Makefile | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/libsubid/04_nss/Makefile b/tests/libsubid/04_nss/Makefile
|
||||
index 7d7ae3e..3fbf989 100644
|
||||
--- a/tests/libsubid/04_nss/Makefile
|
||||
+++ b/tests/libsubid/04_nss/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
all: test_nss libsubid_zzz.so
|
||||
|
||||
-BASE_TEST_DIR ?= $(shell git rev-parse --show-toplevel)
|
||||
-basedir := $(BASE_TEST_DIR)
|
||||
+BUILD_BASE_DIR ?= $(shell git rev-parse --show-toplevel)
|
||||
+basedir := $(BUILD_BASE_DIR)
|
||||
|
||||
test_nss: test_nss.c $(basedir)/lib/nss.c
|
||||
gcc -c -I$(basedir)/lib/ -I$(basedir) -o test_nss.o test_nss.c
|
||||
13
debian/patches/series
vendored
13
debian/patches/series
vendored
@@ -1,10 +1,13 @@
|
||||
debian/cppw-Add-tool.patch
|
||||
debian/cppw-add-selinux-support.patch
|
||||
debian/Let-pam_unix-handle-login-failure-delays.patch
|
||||
debian/Set-group-and-mode-for-g-shadow-files.patch
|
||||
debian/Keep-using-Debian-adduser-defaults.patch
|
||||
debian/Exclude-Debian-globally-allocated-UIDs-from-sys_uid-range.patch
|
||||
debian/Document-the-shadowconfig-utility.patch
|
||||
debian/Recommend-using-adduser-and-deluser.patch
|
||||
debian/Relax-usernames-groupnames-checking.patch
|
||||
debian/tests-disable-su.patch
|
||||
debian/tests-libsubid-04_nss-fix-setting-basedir.patch
|
||||
debian/Adapt-login.defs-for-Debian.patch
|
||||
debian/Define-LOGIN_NAME_MAX-on-HURD.patch
|
||||
debian/Stop-building-programs-we-do-not-install.patch
|
||||
debian/Warn-when-badname-and-variants-are-given.patch
|
||||
debian/configure.ac-align-exec_prefix-with-prefix.patch
|
||||
upstream/Accept-usr-sbin-nologin-as-an-alternate-to-sbin-nologin.patch
|
||||
upstream/Add-LOGIN_ENV_SAFELIST-to-FOREIGNDEFS.patch
|
||||
|
||||
36
debian/patches/upstream/Accept-usr-sbin-nologin-as-an-alternate-to-sbin-nologin.patch
vendored
Normal file
36
debian/patches/upstream/Accept-usr-sbin-nologin-as-an-alternate-to-sbin-nologin.patch
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
From: Chris Hofstaedtler <zeha@debian.org>
|
||||
Date: Fri, 28 Mar 2025 12:12:13 +0100
|
||||
Subject: Accept /usr/sbin/nologin as an alternate to /sbin/nologin
|
||||
|
||||
Noticed by adduser's autopkgtests, thanks: Marc Haber
|
||||
|
||||
Link: https://github.com/shadow-maint/shadow/pull/1246
|
||||
---
|
||||
src/useradd.c | 1 +
|
||||
src/usermod.c | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/useradd.c b/src/useradd.c
|
||||
index 7e9dbce..0653d1d 100644
|
||||
--- a/src/useradd.c
|
||||
+++ b/src/useradd.c
|
||||
@@ -1380,6 +1380,7 @@ static void process_flags (int argc, char **argv)
|
||||
if (!streq(optarg, "")
|
||||
&& '*' != optarg[0]
|
||||
&& !streq(optarg, "/sbin/nologin")
|
||||
+ && !streq(optarg, "/usr/sbin/nologin")
|
||||
&& ( stat(optarg, &st) != 0
|
||||
|| S_ISDIR(st.st_mode)
|
||||
|| access(optarg, X_OK) != 0)) {
|
||||
diff --git a/src/usermod.c b/src/usermod.c
|
||||
index 9030883..4156ce5 100644
|
||||
--- a/src/usermod.c
|
||||
+++ b/src/usermod.c
|
||||
@@ -1179,6 +1179,7 @@ process_flags(int argc, char **argv)
|
||||
if (!streq(optarg, "")
|
||||
&& '*' != optarg[0]
|
||||
&& !streq(optarg, "/sbin/nologin")
|
||||
+ && !streq(optarg, "/usr/sbin/nologin")
|
||||
&& ( stat(optarg, &st) != 0
|
||||
|| S_ISDIR(st.st_mode)
|
||||
|| access(optarg, X_OK) != 0)) {
|
||||
24
debian/patches/upstream/Add-LOGIN_ENV_SAFELIST-to-FOREIGNDEFS.patch
vendored
Normal file
24
debian/patches/upstream/Add-LOGIN_ENV_SAFELIST-to-FOREIGNDEFS.patch
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
From: Stanislav Brabec <sbrabec@suse.cz>
|
||||
Date: Wed, 9 Apr 2025 02:03:10 +0200
|
||||
Subject: Add LOGIN_ENV_SAFELIST to FOREIGNDEFS
|
||||
|
||||
util-linux-2.41 introduced new variable: LOGIN_ENV_SAFELIST.
|
||||
Add it to known login.defs variables.
|
||||
|
||||
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
|
||||
---
|
||||
lib/getdef.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/getdef.c b/lib/getdef.c
|
||||
index e354d89..8883a29 100644
|
||||
--- a/lib/getdef.c
|
||||
+++ b/lib/getdef.c
|
||||
@@ -76,6 +76,7 @@ struct itemdef {
|
||||
#define FOREIGNDEFS \
|
||||
{"ALWAYS_SET_PATH", NULL}, \
|
||||
{"ENV_ROOTPATH", NULL}, \
|
||||
+ {"LOGIN_ENV_SAFELIST", NULL}, \
|
||||
{"LOGIN_KEEP_USERNAME", NULL}, \
|
||||
{"LOGIN_PLAIN_PROMPT", NULL}, \
|
||||
{"MOTD_FIRSTONLY", NULL}, \
|
||||
25
debian/rules
vendored
25
debian/rules
vendored
@@ -4,11 +4,14 @@
|
||||
# Enable PIE, BINDNOW, and possible future flags.
|
||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
DPKG_EXPORT_BUILDFLAGS = 1
|
||||
include /usr/share/dpkg/architecture.mk
|
||||
include /usr/share/dpkg/buildflags.mk
|
||||
include /usr/share/debhelper/dh_package_notes/package-notes.mk
|
||||
|
||||
# Adds extra options when calling the configure script:
|
||||
DEB_CONFIGURE_EXTRA_FLAGS := \
|
||||
--bindir=/usr/bin \
|
||||
--sbindir=/usr/sbin \
|
||||
--mandir=/usr/share/man \
|
||||
--with-libpam \
|
||||
--with-yescrypt \
|
||||
@@ -24,9 +27,9 @@ DEB_CONFIGURE_EXTRA_FLAGS := \
|
||||
--without-tcb \
|
||||
|
||||
|
||||
ifneq ($(DEB_HOST_ARCH_OS),linux)
|
||||
DEB_CONFIGURE_EXTRA_FLAGS += --enable-logind
|
||||
ifeq ($(DEB_HOST_ARCH_OS),linux)
|
||||
DEB_CONFIGURE_EXTRA_FLAGS += --with-audit
|
||||
DEB_CONFIGURE_EXTRA_FLAGS += --with-btrfs
|
||||
endif
|
||||
|
||||
ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
|
||||
@@ -41,29 +44,19 @@ CFLAGS += -DDEFAULT_EDITOR="\"sensible-editor\""
|
||||
%:
|
||||
dh $@
|
||||
|
||||
execute_after_dh_auto_clean:
|
||||
# rebuild lib/getdate.c
|
||||
rm -f lib/getdate.c
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS)
|
||||
|
||||
override_dh_install-arch:
|
||||
ifneq ($(DEB_HOST_ARCH_OS),linux)
|
||||
sed -i 's/session optional pam_keyinit.so/# Linux only # session optional pam_keyinit.so/' debian/login.pam
|
||||
endif
|
||||
dh_install -a
|
||||
ifeq ($(DEB_HOST_ARCH_OS),hurd)
|
||||
# /bin/login is provided by the hurd package.
|
||||
rm -f debian/login/usr/bin/login
|
||||
endif
|
||||
|
||||
override_dh_installpam:
|
||||
# Distribute the pam.d files; unless for the commands with disabled PAM
|
||||
# support
|
||||
dh_installpam -p login
|
||||
dh_installpam -p passwd --name=passwd
|
||||
dh_installpam -p passwd --name=chfn
|
||||
dh_installpam -p passwd --name=chsh
|
||||
dh_installpam -p passwd --name=chpasswd
|
||||
dh_installpam -p passwd --name=newusers
|
||||
|
||||
override_dh_auto_clean:
|
||||
sed -i 's/# Linux only # //' debian/login.pam
|
||||
dh_auto_clean
|
||||
|
||||
40
debian/salsa-ci.yml
vendored
Normal file
40
debian/salsa-ci.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
include: https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
|
||||
|
||||
extract-source:
|
||||
extends: .provisioning-extract-source
|
||||
|
||||
variables:
|
||||
RELEASE: 'unstable'
|
||||
|
||||
build:
|
||||
extends: .build-package
|
||||
|
||||
test-build-any:
|
||||
extends: .test-build-package-any
|
||||
|
||||
test-build-all:
|
||||
extends: .test-build-package-all
|
||||
|
||||
lintian:
|
||||
extends: .test-lintian
|
||||
|
||||
autopkgtest:
|
||||
extends: .test-autopkgtest
|
||||
|
||||
blhc:
|
||||
extends: .test-blhc
|
||||
|
||||
reprotest:
|
||||
extends: .test-reprotest
|
||||
|
||||
variables:
|
||||
SALSA_CI_ENABLE_BUILD_PACKAGE_PROFILES: 1
|
||||
|
||||
test-build-profiles:
|
||||
extends: .test-build-package-profiles
|
||||
parallel:
|
||||
matrix:
|
||||
- BUILD_PROFILES: nocheck
|
||||
- BUILD_PROFILES: nodoc
|
||||
|
||||
22
debian/shadowconfig
vendored
22
debian/shadowconfig
vendored
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# turn shadow passwords on or off on a Debian system
|
||||
# turn shadow passwords on on a Debian system
|
||||
|
||||
set -e
|
||||
|
||||
@@ -36,16 +36,6 @@ shadowon () {
|
||||
chmod 640 "${DPKG_ROOT}/etc/shadow" "${DPKG_ROOT}/etc/gshadow"
|
||||
}
|
||||
|
||||
shadowoff () {
|
||||
set -e
|
||||
pwck -q -r
|
||||
grpck -r
|
||||
pwunconv
|
||||
grpunconv
|
||||
# sometimes the passwd perms get munged
|
||||
chown root:root /etc/passwd /etc/group
|
||||
chmod 644 /etc/passwd /etc/group
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"on")
|
||||
@@ -57,14 +47,10 @@ case "$1" in
|
||||
fi
|
||||
;;
|
||||
"off")
|
||||
if shadowoff ; then
|
||||
echo Shadow passwords are now off.
|
||||
else
|
||||
echo Please correct the error and rerun \`$0 off\'
|
||||
exit 1
|
||||
fi
|
||||
echo E: Turning shadow passwords off is no longer supported.
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo Usage: $0 on \| off
|
||||
echo Usage: $0 on
|
||||
;;
|
||||
esac
|
||||
|
||||
2
debian/shlibs.local
vendored
2
debian/shlibs.local
vendored
@@ -1 +1 @@
|
||||
deb: libsubid 4 libsubid4 (= ${binary:Version})
|
||||
deb: libsubid 5 libsubid5 (= ${binary:Version})
|
||||
|
||||
6
debian/source/lintian-overrides
vendored
Normal file
6
debian/source/lintian-overrides
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# debputy does not need misc:Depends
|
||||
debhelper-but-no-misc-depends libsubid-dev
|
||||
debhelper-but-no-misc-depends libsubid5
|
||||
debhelper-but-no-misc-depends login.defs
|
||||
debhelper-but-no-misc-depends passwd
|
||||
debhelper-but-no-misc-depends uidmap
|
||||
15
debian/tests/smoke
vendored
15
debian/tests/smoke
vendored
@@ -2,12 +2,23 @@
|
||||
|
||||
set -e
|
||||
|
||||
echo "Adding an user works"
|
||||
echo "Adding a user works"
|
||||
useradd shadow-test-user
|
||||
grep '^shadow-test-user:x:' /etc/passwd
|
||||
grep '^shadow-test-user:!:' /etc/shadow
|
||||
|
||||
echo "Removing an user works"
|
||||
# Regression test for #1096187. adduser uses this sequence.
|
||||
echo "Changing a users name and work phone number works"
|
||||
chfn "-f" "foo" "-r" "" shadow-test-user
|
||||
chfn -w "" shadow-test-user
|
||||
|
||||
# Regression test for #1095430
|
||||
TZ=Asia/Tokyo usermod --expiredate 1970-01-02 shadow-test-user
|
||||
TZ=Asia/Tokyo LC_ALL=C chage -l shadow-test-user | grep 'Account expires'
|
||||
# We expect 1970-01-02, as passed.
|
||||
TZ=Asia/Tokyo LC_ALL=C chage -l shadow-test-user | grep -P '^Account expires.*Jan 02, 1970'
|
||||
|
||||
echo "Removing a user works"
|
||||
userdel shadow-test-user
|
||||
! grep 'shadow-test-user' /etc/passwd
|
||||
! grep 'shadow-test-user' /etc/shadow
|
||||
|
||||
2
debian/uidmap.install
vendored
2
debian/uidmap.install
vendored
@@ -1,3 +1,3 @@
|
||||
bin/getsubids usr/bin
|
||||
usr/bin/getsubids
|
||||
usr/bin/newgidmap
|
||||
usr/bin/newuidmap
|
||||
|
||||
12
doc/HOWTO
12
doc/HOWTO
@@ -471,12 +471,12 @@
|
||||
|
||||
The Shadow Suite contains replacement programs for:
|
||||
|
||||
su, login, passwd, newgrp, chfn, chsh, and id
|
||||
su, login, passwd, newgrp, chfn, chsh
|
||||
|
||||
The package also contains the new programs:
|
||||
|
||||
chage, newusers, dpasswd, gpasswd, useradd, userdel, usermod,
|
||||
groupadd, groupdel, groupmod, groups, pwck, grpck, lastlog, pwconv,
|
||||
groupadd, groupdel, groupmod, pwck, grpck, lastlog, pwconv,
|
||||
and pwunconv
|
||||
|
||||
Additionally, the library: libshadow.a is included for writing and/or
|
||||
@@ -586,8 +586,6 @@
|
||||
|
||||
· /usr/bin/chsh
|
||||
|
||||
· /usr/bin/id
|
||||
|
||||
The BETA package has a save target in the Makefile, but it's commented
|
||||
out because different distributions place the programs in different
|
||||
places.
|
||||
@@ -637,8 +635,6 @@
|
||||
|
||||
· /usr/man/man1/chsh.1.gz
|
||||
|
||||
· /usr/man/man1/id.1.gz
|
||||
|
||||
· /usr/man/man1/login.1.gz
|
||||
|
||||
· /usr/man/man1/passwd.1.gz
|
||||
@@ -1377,7 +1373,7 @@
|
||||
users or changing the group password, the /etc/gshadow file will be
|
||||
changed.
|
||||
|
||||
The programs groups, groupadd, groupmod, and groupdel are provided as
|
||||
The programs groupadd, groupmod, and groupdel are provided as
|
||||
part of the Shadow Suite to modify groups.
|
||||
|
||||
The format of the /etc/group file is as follows:
|
||||
@@ -1755,7 +1751,7 @@
|
||||
}
|
||||
#ifdef HAS_SHADOW
|
||||
if ((pw->pw_passwd && pw->pw_passwd[0] == '@'
|
||||
&& pw_auth (pw->pw_passwd+1, pw->pw_name, PW_LOGIN, NULL))
|
||||
&& pw_auth(pw->pw_passwd+1, pw->pw_name))
|
||||
|| !valid (passwd, pw)) {
|
||||
return (UPAP_AUTHNAK);
|
||||
}
|
||||
|
||||
@@ -161,7 +161,6 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
|
||||
@@ -250,7 +250,6 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
|
||||
@@ -11,7 +11,6 @@ pamd_files = \
|
||||
passwd
|
||||
|
||||
pamd_acct_tools_files = \
|
||||
chage \
|
||||
chgpasswd \
|
||||
groupadd \
|
||||
groupdel \
|
||||
|
||||
@@ -193,7 +193,6 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
@@ -343,7 +342,6 @@ top_srcdir = @top_srcdir@
|
||||
pamd_files = chpasswd chfn chsh groupmems login newusers passwd \
|
||||
$(am__append_2)
|
||||
pamd_acct_tools_files = \
|
||||
chage \
|
||||
chgpasswd \
|
||||
groupadd \
|
||||
groupdel \
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#%PAM-1.0
|
||||
auth sufficient pam_rootok.so
|
||||
account required pam_permit.so
|
||||
password include system-auth
|
||||
@@ -158,7 +158,6 @@ EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
|
||||
128
lib/Makefile.am
128
lib/Makefile.am
@@ -29,16 +29,48 @@ libshadow_la_SOURCES = \
|
||||
age.c \
|
||||
agetpass.c \
|
||||
agetpass.h \
|
||||
alloc.c \
|
||||
alloc.h \
|
||||
atoi/a2i.c \
|
||||
atoi/a2i.h \
|
||||
atoi/str2i.c \
|
||||
atoi/str2i.h \
|
||||
atoi/strtoi.c \
|
||||
atoi/strtoi.h \
|
||||
atoi/strtou_noneg.c \
|
||||
atoi/strtou_noneg.h \
|
||||
alloc/calloc.c \
|
||||
alloc/calloc.h \
|
||||
alloc/malloc.c \
|
||||
alloc/malloc.h \
|
||||
alloc/realloc.c \
|
||||
alloc/realloc.h \
|
||||
alloc/reallocf.c \
|
||||
alloc/reallocf.h \
|
||||
alloc/x/xcalloc.c \
|
||||
alloc/x/xcalloc.h \
|
||||
alloc/x/xmalloc.c \
|
||||
alloc/x/xmalloc.h \
|
||||
alloc/x/xrealloc.c \
|
||||
alloc/x/xrealloc.h \
|
||||
atoi/a2i/a2i.c \
|
||||
atoi/a2i/a2i.h \
|
||||
atoi/a2i/a2s.c \
|
||||
atoi/a2i/a2s.h \
|
||||
atoi/a2i/a2s_c.c \
|
||||
atoi/a2i/a2s_c.h \
|
||||
atoi/a2i/a2s_nc.c \
|
||||
atoi/a2i/a2s_nc.h \
|
||||
atoi/a2i/a2u.c \
|
||||
atoi/a2i/a2u.h \
|
||||
atoi/a2i/a2u_c.c \
|
||||
atoi/a2i/a2u_c.h \
|
||||
atoi/a2i/a2u_nc.c \
|
||||
atoi/a2i/a2u_nc.h \
|
||||
atoi/getnum.c \
|
||||
atoi/getnum.h \
|
||||
atoi/str2i/str2i.c \
|
||||
atoi/str2i/str2i.h \
|
||||
atoi/str2i/str2s.c \
|
||||
atoi/str2i/str2s.h \
|
||||
atoi/str2i/str2u.c \
|
||||
atoi/str2i/str2u.h \
|
||||
atoi/strtoi/strtoi.c \
|
||||
atoi/strtoi/strtoi.h \
|
||||
atoi/strtoi/strtou.c \
|
||||
atoi/strtoi/strtou.h \
|
||||
atoi/strtoi/strtou_noneg.c \
|
||||
atoi/strtoi/strtou_noneg.h \
|
||||
attr.h \
|
||||
audit_help.c \
|
||||
basename.c \
|
||||
@@ -71,9 +103,11 @@ libshadow_la_SOURCES = \
|
||||
find_new_sub_gids.c \
|
||||
find_new_sub_uids.c \
|
||||
fputsx.c \
|
||||
get_gid.c \
|
||||
fs/readlink/areadlink.c \
|
||||
fs/readlink/areadlink.h \
|
||||
fs/readlink/readlinknul.c \
|
||||
fs/readlink/readlinknul.h \
|
||||
get_pid.c \
|
||||
get_uid.c \
|
||||
getdate.h \
|
||||
getdate.y \
|
||||
getdef.c \
|
||||
@@ -94,8 +128,6 @@ libshadow_la_SOURCES = \
|
||||
lockpw.c \
|
||||
loginprompt.c \
|
||||
mail.c \
|
||||
memzero.c \
|
||||
memzero.h \
|
||||
motd.c \
|
||||
must_be.h \
|
||||
myname.c \
|
||||
@@ -119,11 +151,18 @@ libshadow_la_SOURCES = \
|
||||
pwdcheck.c \
|
||||
pwmem.c \
|
||||
remove_tree.c \
|
||||
rlogin.c \
|
||||
root_flag.c \
|
||||
run_part.h \
|
||||
run_part.c \
|
||||
salt.c \
|
||||
search/cmp/cmp.c \
|
||||
search/cmp/cmp.h \
|
||||
search/l/lfind.c \
|
||||
search/l/lfind.h \
|
||||
search/l/lsearch.c \
|
||||
search/l/lsearch.h \
|
||||
search/sort/qsort.c \
|
||||
search/sort/qsort.h \
|
||||
selinux.c \
|
||||
semanage.c \
|
||||
setugid.c \
|
||||
@@ -134,6 +173,8 @@ libshadow_la_SOURCES = \
|
||||
sgroupio.c \
|
||||
sgroupio.h\
|
||||
shadow.c \
|
||||
shadow/grp/agetgroups.c \
|
||||
shadow/grp/agetgroups.h \
|
||||
shadowio.c \
|
||||
shadowio.h \
|
||||
shadowlog.c \
|
||||
@@ -145,18 +186,54 @@ libshadow_la_SOURCES = \
|
||||
spawn.c \
|
||||
sssd.c \
|
||||
sssd.h \
|
||||
string/sprintf.c \
|
||||
string/sprintf.h \
|
||||
string/stpecpy.c \
|
||||
string/stpecpy.h \
|
||||
string/stpeprintf.c \
|
||||
string/stpeprintf.h \
|
||||
string/ctype/strisascii/strisdigit.c \
|
||||
string/ctype/strisascii/strisdigit.h \
|
||||
string/memset/memzero.c \
|
||||
string/memset/memzero.h \
|
||||
string/sprintf/snprintf.c \
|
||||
string/sprintf/snprintf.h \
|
||||
string/sprintf/stpeprintf.c \
|
||||
string/sprintf/stpeprintf.h \
|
||||
string/sprintf/xasprintf.c \
|
||||
string/sprintf/xasprintf.h \
|
||||
string/strchr/strchrcnt.c \
|
||||
string/strchr/strchrcnt.h \
|
||||
string/strchr/strchrscnt.c \
|
||||
string/strchr/strchrscnt.h \
|
||||
string/strchr/strnul.c \
|
||||
string/strchr/strnul.h \
|
||||
string/strcmp/strcaseeq.c \
|
||||
string/strcmp/strcaseeq.h \
|
||||
string/strcmp/streq.c \
|
||||
string/strcmp/streq.h \
|
||||
string/strcpy/stpecpy.c \
|
||||
string/strcpy/stpecpy.h \
|
||||
string/strcpy/strncat.c \
|
||||
string/strcpy/strncat.h \
|
||||
string/strcpy/strncpy.c \
|
||||
string/strcpy/strncpy.h \
|
||||
string/strcpy/strtcpy.c \
|
||||
string/strcpy/strtcpy.h \
|
||||
string/strdup/strndupa.c \
|
||||
string/strdup/strndupa.h \
|
||||
string/strdup/xstrdup.c \
|
||||
string/strdup/xstrdup.h \
|
||||
string/strdup/xstrndup.c \
|
||||
string/strdup/xstrndup.h \
|
||||
string/strftime.c \
|
||||
string/strftime.h \
|
||||
string/strncpy.h \
|
||||
string/strtcpy.c \
|
||||
string/strtcpy.h \
|
||||
string/zustr2stp.h \
|
||||
string/strspn/stpspn.c \
|
||||
string/strspn/stpspn.h \
|
||||
string/strspn/stprcspn.c \
|
||||
string/strspn/stprcspn.h \
|
||||
string/strspn/stprspn.c \
|
||||
string/strspn/stprspn.h \
|
||||
string/strspn/strrcspn.c \
|
||||
string/strspn/strrcspn.h \
|
||||
string/strspn/strrspn.c \
|
||||
string/strspn/strrspn.h \
|
||||
string/strtok/stpsep.c \
|
||||
string/strtok/stpsep.h \
|
||||
strtoday.c \
|
||||
sub.c \
|
||||
subordinateio.h \
|
||||
@@ -165,6 +242,7 @@ libshadow_la_SOURCES = \
|
||||
time/day_to_str.c \
|
||||
time/day_to_str.h \
|
||||
ttytype.c \
|
||||
typetraits.h \
|
||||
tz.c \
|
||||
ulimit.c \
|
||||
user_busy.c \
|
||||
|
||||
1290
lib/Makefile.in
1290
lib/Makefile.in
File diff suppressed because it is too large
Load Diff
129
lib/addgrps.c
129
lib/addgrps.c
@@ -1,114 +1,81 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2001 - 2006, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
// SPDX-FileCopyrightText: 1989-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2001-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2007-2009, Nicolas François
|
||||
// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if defined (HAVE_SETGROUPS) && ! defined (USE_PAM)
|
||||
#if !defined(USE_PAM)
|
||||
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <grp.h>
|
||||
#include <errno.h>
|
||||
#include <grp.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/reallocf.h"
|
||||
#include "search/l/lsearch.h"
|
||||
#include "shadow/grp/agetgroups.h"
|
||||
#include "shadowlog.h"
|
||||
#include "string/strchr/strchrscnt.h"
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
#define SEP ",:"
|
||||
/*
|
||||
* Add groups with names from LIST (separated by commas or colons)
|
||||
* to the supplementary group set. Silently ignore groups which are
|
||||
* already there. Warning: uses strtok().
|
||||
* already there.
|
||||
*/
|
||||
int add_groups (const char *list)
|
||||
int
|
||||
add_groups(const char *list)
|
||||
{
|
||||
GETGROUPS_T *grouplist;
|
||||
size_t i;
|
||||
int ngroups;
|
||||
bool added;
|
||||
char *token;
|
||||
char buf[1024];
|
||||
int ret;
|
||||
char *g, *p, *dup;
|
||||
FILE *shadow_logfd = log_get_logfd();
|
||||
gid_t *gids;
|
||||
size_t n;
|
||||
|
||||
if (strlen (list) >= sizeof (buf)) {
|
||||
errno = EINVAL;
|
||||
gids = agetgroups(&n);
|
||||
if (gids == NULL)
|
||||
return -1;
|
||||
}
|
||||
strcpy (buf, list);
|
||||
|
||||
i = 16;
|
||||
for (;;) {
|
||||
grouplist = MALLOC(i, GETGROUPS_T);
|
||||
if (NULL == grouplist) {
|
||||
return -1;
|
||||
}
|
||||
ngroups = getgroups (i, grouplist);
|
||||
if ( ( (-1 == ngroups)
|
||||
&& (EINVAL != errno))
|
||||
|| (i > (size_t)ngroups)) {
|
||||
/* Unexpected failure of getgroups or successful
|
||||
* reception of the groups */
|
||||
break;
|
||||
}
|
||||
/* not enough room, so try allocating a larger buffer */
|
||||
free (grouplist);
|
||||
i *= 2;
|
||||
}
|
||||
if (ngroups < 0) {
|
||||
free (grouplist);
|
||||
gids = REALLOCF(gids, n + strchrscnt(list, ",:") + 1, gid_t);
|
||||
if (gids == NULL)
|
||||
return -1;
|
||||
}
|
||||
|
||||
added = false;
|
||||
for (token = strtok (buf, SEP); NULL != token; token = strtok (NULL, SEP)) {
|
||||
struct group *grp;
|
||||
p = dup = strdup(list);
|
||||
if (dup == NULL)
|
||||
goto free_gids;
|
||||
|
||||
grp = getgrnam (token); /* local, no need for xgetgrnam */
|
||||
while (NULL != (g = strsep(&p, ",:"))) {
|
||||
struct group *grp;
|
||||
|
||||
grp = getgrnam(g); /* local, no need for xgetgrnam */
|
||||
if (NULL == grp) {
|
||||
fprintf (shadow_logfd, _("Warning: unknown group %s\n"),
|
||||
token);
|
||||
fprintf(shadow_logfd, _("Warning: unknown group %s\n"), g);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (i = 0; i < (size_t)ngroups && grouplist[i] != grp->gr_gid; i++);
|
||||
LSEARCH(&grp->gr_gid, gids, &n);
|
||||
}
|
||||
free(dup);
|
||||
|
||||
if (i < (size_t)ngroups) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ngroups >= sysconf (_SC_NGROUPS_MAX)) {
|
||||
fputs (_("Warning: too many groups\n"), shadow_logfd);
|
||||
break;
|
||||
}
|
||||
grouplist = REALLOCF(grouplist, (size_t) ngroups + 1, GETGROUPS_T);
|
||||
if (grouplist == NULL) {
|
||||
return -1;
|
||||
}
|
||||
grouplist[ngroups] = grp->gr_gid;
|
||||
ngroups++;
|
||||
added = true;
|
||||
if (setgroups(n, gids) == -1) {
|
||||
fprintf(shadow_logfd, "setgroups: %s\n", strerror(errno));
|
||||
goto free_gids;
|
||||
}
|
||||
|
||||
if (added) {
|
||||
ret = setgroups (ngroups, grouplist);
|
||||
free (grouplist);
|
||||
return ret;
|
||||
}
|
||||
|
||||
free (grouplist);
|
||||
free(gids);
|
||||
return 0;
|
||||
}
|
||||
#else /* HAVE_SETGROUPS && !USE_PAM */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif /* HAVE_SETGROUPS && !USE_PAM */
|
||||
|
||||
free_gids:
|
||||
free(gids);
|
||||
return -1;
|
||||
}
|
||||
#else /* !USE_PAM */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif /* !USE_PAM */
|
||||
|
||||
@@ -11,5 +11,3 @@
|
||||
|
||||
extern inline long addsl2(long a, long b);
|
||||
extern inline long addslN(size_t n, long addend[n]);
|
||||
|
||||
extern inline int cmpl(const void *p1, const void *p2);
|
||||
|
||||
22
lib/adds.h
22
lib/adds.h
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2023, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "search/sort/qsort.h"
|
||||
#include "sizeof.h"
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
inline long addsl2(long a, long b);
|
||||
inline long addslN(size_t n, long addend[n]);
|
||||
|
||||
inline int cmpl(const void *p1, const void *p2);
|
||||
|
||||
|
||||
inline long
|
||||
addsl2(long a, long b)
|
||||
@@ -57,7 +55,7 @@ addslN(size_t n, long addend[n])
|
||||
|
||||
e = errno;
|
||||
while (n > 1) {
|
||||
qsort(addend, n, sizeof(addend[0]), cmpl);
|
||||
QSORT(addend, n);
|
||||
|
||||
errno = 0;
|
||||
addend[0] = addsl2(addend[0], addend[--n]);
|
||||
@@ -69,18 +67,4 @@ addslN(size_t n, long addend[n])
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
cmpl(const void *p1, const void *p2)
|
||||
{
|
||||
const long *l1 = p1;
|
||||
const long *l2 = p2;
|
||||
|
||||
if (*l1 < *l2)
|
||||
return -1;
|
||||
if (*l1 > *l2)
|
||||
return +1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -106,7 +106,7 @@ int expire (const struct passwd *pw, /*@null@*/const struct spwd *sp)
|
||||
* passwd to work just like it would had they executed
|
||||
* it from the command line while logged in.
|
||||
*/
|
||||
#if defined(HAVE_INITGROUPS) && ! defined(USE_PAM)
|
||||
#if !defined(USE_PAM)
|
||||
if (setup_uid_gid (pw, false) != 0)
|
||||
#else
|
||||
if (setup_uid_gid (pw) != 0)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
|
||||
#if WITH_LIBBSD == 0
|
||||
#include "freezero.h"
|
||||
|
||||
73
lib/alloc.c
73
lib/alloc.c
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
||||
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
|
||||
* SPDX-FileCopyrightText: 2003 - 2006, Tomasz Kłoczko
|
||||
* SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
* SPDX-FileCopyrightText: 2023 , Alejandro Colomar <alx@kernel.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* Replacements for malloc and strdup with error checking. Too trivial
|
||||
to be worth copyrighting :-). I did that because a lot of code used
|
||||
malloc and strdup without checking for NULL pointer, and I like some
|
||||
message better than a core dump... --marekm
|
||||
|
||||
Yeh, but. Remember that bailing out might leave the system in some
|
||||
bizarre state. You really want to put in error checking, then add
|
||||
some back-out failure recovery code. -- jfh */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
#include "alloc.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
|
||||
extern inline void *xmalloc(size_t size);
|
||||
extern inline void *xmallocarray(size_t nmemb, size_t size);
|
||||
extern inline void *mallocarray(size_t nmemb, size_t size);
|
||||
extern inline void *reallocarrayf(void *p, size_t nmemb, size_t size);
|
||||
extern inline char *xstrdup(const char *str);
|
||||
|
||||
|
||||
void *
|
||||
xcalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
p = calloc(nmemb, size);
|
||||
if (p == NULL)
|
||||
goto x;
|
||||
|
||||
return p;
|
||||
|
||||
x:
|
||||
fprintf(log_get_logfd(), _("%s: %s\n"),
|
||||
log_get_progname(), strerror(errno));
|
||||
exit(13);
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
xreallocarray(void *p, size_t nmemb, size_t size)
|
||||
{
|
||||
p = reallocarrayf(p, nmemb, size);
|
||||
if (p == NULL)
|
||||
goto x;
|
||||
|
||||
return p;
|
||||
|
||||
x:
|
||||
fprintf(log_get_logfd(), _("%s: %s\n"),
|
||||
log_get_progname(), strerror(errno));
|
||||
exit(13);
|
||||
}
|
||||
101
lib/alloc.h
101
lib/alloc.h
@@ -1,101 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_MALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_MALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
|
||||
|
||||
#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))
|
||||
#define XCALLOC(n, type) ((type *) xcalloc(n, sizeof(type)))
|
||||
#define MALLOC(n, type) ((type *) mallocarray(n, sizeof(type)))
|
||||
#define XMALLOC(n, type) ((type *) xmallocarray(n, sizeof(type)))
|
||||
|
||||
#define REALLOC(ptr, n, type) \
|
||||
( \
|
||||
_Generic(ptr, type *: (type *) reallocarray(ptr, n, sizeof(type))) \
|
||||
)
|
||||
|
||||
#define REALLOCF(ptr, n, type) \
|
||||
( \
|
||||
_Generic(ptr, type *: (type *) reallocarrayf(ptr, n, sizeof(type))) \
|
||||
)
|
||||
|
||||
#define XREALLOC(ptr, n, type) \
|
||||
( \
|
||||
_Generic(ptr, type *: (type *) xreallocarray(ptr, n, sizeof(type))) \
|
||||
)
|
||||
|
||||
|
||||
ATTR_MALLOC(free)
|
||||
inline void *xmalloc(size_t size);
|
||||
ATTR_MALLOC(free)
|
||||
inline void *xmallocarray(size_t nmemb, size_t size);
|
||||
ATTR_MALLOC(free)
|
||||
inline void *mallocarray(size_t nmemb, size_t size);
|
||||
ATTR_MALLOC(free)
|
||||
inline void *reallocarrayf(void *p, size_t nmemb, size_t size);
|
||||
ATTR_MALLOC(free)
|
||||
inline char *xstrdup(const char *str);
|
||||
|
||||
ATTR_MALLOC(free)
|
||||
void *xcalloc(size_t nmemb, size_t size);
|
||||
ATTR_MALLOC(free)
|
||||
void *xreallocarray(void *p, size_t nmemb, size_t size);
|
||||
|
||||
|
||||
inline void *
|
||||
xmalloc(size_t size)
|
||||
{
|
||||
return xmallocarray(1, size);
|
||||
}
|
||||
|
||||
|
||||
inline void *
|
||||
xmallocarray(size_t nmemb, size_t size)
|
||||
{
|
||||
return xreallocarray(NULL, nmemb, size);
|
||||
}
|
||||
|
||||
|
||||
inline void *
|
||||
mallocarray(size_t nmemb, size_t size)
|
||||
{
|
||||
return reallocarray(NULL, nmemb, size);
|
||||
}
|
||||
|
||||
|
||||
inline void *
|
||||
reallocarrayf(void *p, size_t nmemb, size_t size)
|
||||
{
|
||||
void *q;
|
||||
|
||||
q = reallocarray(p, nmemb, size);
|
||||
|
||||
/* realloc(p, 0) is equivalent to free(p); avoid double free. */
|
||||
if (q == NULL && nmemb != 0 && size != 0)
|
||||
free(p);
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
inline char *
|
||||
xstrdup(const char *str)
|
||||
{
|
||||
return strcpy(XMALLOC(strlen(str) + 1, char), str);
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
11
lib/alloc/calloc.c
Normal file
11
lib/alloc/calloc.c
Normal file
@@ -0,0 +1,11 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/calloc.h"
|
||||
20
lib/alloc/calloc.h
Normal file
20
lib/alloc/calloc.h
Normal file
@@ -0,0 +1,20 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ALLOC_CALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_ALLOC_CALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#define CALLOC(n, type) \
|
||||
( \
|
||||
(type *) calloc(n, sizeof(type)) \
|
||||
)
|
||||
|
||||
|
||||
#endif // include guard
|
||||
16
lib/alloc/malloc.c
Normal file
16
lib/alloc/malloc.c
Normal file
@@ -0,0 +1,16 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/malloc.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
extern inline void *mallocarray(size_t nmemb, size_t size);
|
||||
34
lib/alloc/malloc.h
Normal file
34
lib/alloc/malloc.h
Normal file
@@ -0,0 +1,34 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ALLOC_MALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_ALLOC_MALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define MALLOC(n, type) \
|
||||
( \
|
||||
(type *) mallocarray(n, sizeof(type)) \
|
||||
)
|
||||
|
||||
|
||||
ATTR_ALLOC_SIZE(1, 2)
|
||||
ATTR_MALLOC(free)
|
||||
inline void *mallocarray(size_t nmemb, size_t size);
|
||||
|
||||
|
||||
inline void *
|
||||
mallocarray(size_t nmemb, size_t size)
|
||||
{
|
||||
return reallocarray(NULL, nmemb, size);
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
11
lib/alloc/realloc.c
Normal file
11
lib/alloc/realloc.c
Normal file
@@ -0,0 +1,11 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/realloc.h"
|
||||
20
lib/alloc/realloc.h
Normal file
20
lib/alloc/realloc.h
Normal file
@@ -0,0 +1,20 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ALLOC_REALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_ALLOC_REALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#define REALLOC(p, n, type) \
|
||||
( \
|
||||
_Generic(p, type *: (type *) reallocarray(p, (n) ?: 1, sizeof(type))) \
|
||||
)
|
||||
|
||||
|
||||
#endif // include guard
|
||||
16
lib/alloc/reallocf.c
Normal file
16
lib/alloc/reallocf.c
Normal file
@@ -0,0 +1,16 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/reallocf.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
extern inline void *reallocarrayf(void *p, size_t nmemb, size_t size);
|
||||
41
lib/alloc/reallocf.h
Normal file
41
lib/alloc/reallocf.h
Normal file
@@ -0,0 +1,41 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ALLOC_REALLOCF_H_
|
||||
#define SHADOW_INCLUDE_LIB_ALLOC_REALLOCF_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define REALLOCF(p, n, type) \
|
||||
( \
|
||||
_Generic(p, type *: (type *) reallocarrayf(p, (n) ?: 1, sizeof(type)))\
|
||||
)
|
||||
|
||||
|
||||
ATTR_ALLOC_SIZE(2, 3)
|
||||
ATTR_MALLOC(free)
|
||||
inline void *reallocarrayf(void *p, size_t nmemb, size_t size);
|
||||
|
||||
|
||||
inline void *
|
||||
reallocarrayf(void *p, size_t nmemb, size_t size)
|
||||
{
|
||||
void *q;
|
||||
|
||||
q = reallocarray(p, nmemb ?: 1, size ?: 1);
|
||||
|
||||
if (q == NULL)
|
||||
free(p);
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
36
lib/alloc/x/xcalloc.c
Normal file
36
lib/alloc/x/xcalloc.c
Normal file
@@ -0,0 +1,36 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/x/xcalloc.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
|
||||
void *
|
||||
xcalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
p = calloc(nmemb, size);
|
||||
if (p == NULL)
|
||||
goto x;
|
||||
|
||||
return p;
|
||||
|
||||
x:
|
||||
fprintf(log_get_logfd(), _("%s: %s\n"),
|
||||
log_get_progname(), strerror(errno));
|
||||
exit(13);
|
||||
}
|
||||
28
lib/alloc/x/xcalloc.h
Normal file
28
lib/alloc/x/xcalloc.h
Normal file
@@ -0,0 +1,28 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ALLOC_X_XCALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_ALLOC_X_XCALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define XCALLOC(n, type) \
|
||||
( \
|
||||
(type *) xcalloc(n, sizeof(type)) \
|
||||
)
|
||||
|
||||
|
||||
ATTR_ALLOC_SIZE(1, 2)
|
||||
ATTR_MALLOC(free)
|
||||
void *xcalloc(size_t nmemb, size_t size);
|
||||
|
||||
|
||||
#endif // include guard
|
||||
16
lib/alloc/x/xmalloc.c
Normal file
16
lib/alloc/x/xmalloc.c
Normal file
@@ -0,0 +1,16 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/x/xmalloc.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
extern inline void *xmallocarray(size_t nmemb, size_t size);
|
||||
35
lib/alloc/x/xmalloc.h
Normal file
35
lib/alloc/x/xmalloc.h
Normal file
@@ -0,0 +1,35 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ALLOC_X_XMALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_ALLOC_X_XMALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "alloc/x/xrealloc.h"
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define XMALLOC(n, type) \
|
||||
( \
|
||||
(type *) xmallocarray(n, sizeof(type)) \
|
||||
)
|
||||
|
||||
|
||||
ATTR_ALLOC_SIZE(1, 2)
|
||||
ATTR_MALLOC(free)
|
||||
inline void *xmallocarray(size_t nmemb, size_t size);
|
||||
|
||||
|
||||
inline void *
|
||||
xmallocarray(size_t nmemb, size_t size)
|
||||
{
|
||||
return xreallocarray(NULL, nmemb, size);
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
35
lib/alloc/x/xrealloc.c
Normal file
35
lib/alloc/x/xrealloc.c
Normal file
@@ -0,0 +1,35 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/x/xrealloc.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "alloc/reallocf.h"
|
||||
#include "defines.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
|
||||
void *
|
||||
xreallocarray(void *p, size_t nmemb, size_t size)
|
||||
{
|
||||
p = reallocarrayf(p, nmemb, size);
|
||||
if (p == NULL)
|
||||
goto x;
|
||||
|
||||
return p;
|
||||
|
||||
x:
|
||||
fprintf(log_get_logfd(), _("%s: %s\n"),
|
||||
log_get_progname(), strerror(errno));
|
||||
exit(13);
|
||||
}
|
||||
31
lib/alloc/x/xrealloc.h
Normal file
31
lib/alloc/x/xrealloc.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_MALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_MALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define XREALLOC(ptr, n, type) \
|
||||
( \
|
||||
_Generic(ptr, type *: (type *) xreallocarray(ptr, n, sizeof(type))) \
|
||||
)
|
||||
|
||||
|
||||
ATTR_ALLOC_SIZE(2, 3)
|
||||
ATTR_MALLOC(free)
|
||||
void *xreallocarray(void *p, size_t nmemb, size_t size);
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -1,46 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "atoi/a2i.h"
|
||||
|
||||
|
||||
extern inline int a2sh_c(short *restrict n, const char *s,
|
||||
const char **restrict endp, int base, short min, short max);
|
||||
extern inline int a2si_c(int *restrict n, const char *s,
|
||||
const char **restrict endp, int base, int min, int max);
|
||||
extern inline int a2sl_c(long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long min, long max);
|
||||
extern inline int a2sll_c(long long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long long min, long long max);
|
||||
extern inline int a2uh_c(unsigned short *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned short min,
|
||||
unsigned short max);
|
||||
extern inline int a2ui_c(unsigned int *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned int min, unsigned int max);
|
||||
extern inline int a2ul_c(unsigned long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned long min, unsigned long max);
|
||||
extern inline int a2ull_c(unsigned long long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned long long min,
|
||||
unsigned long long max);
|
||||
|
||||
|
||||
extern inline int a2sh_nc(short *restrict n, char *s,
|
||||
char **restrict endp, int base, short min, short max);
|
||||
extern inline int a2si_nc(int *restrict n, char *s,
|
||||
char **restrict endp, int base, int min, int max);
|
||||
extern inline int a2sl_nc(long *restrict n, char *s,
|
||||
char **restrict endp, int base, long min, long max);
|
||||
extern inline int a2sll_nc(long long *restrict n, char *s,
|
||||
char **restrict endp, int base, long long min, long long max);
|
||||
extern inline int a2uh_nc(unsigned short *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned short min, unsigned short max);
|
||||
extern inline int a2ui_nc(unsigned int *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned int min, unsigned int max);
|
||||
extern inline int a2ul_nc(unsigned long *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned long min, unsigned long max);
|
||||
extern inline int a2ull_nc(unsigned long long *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned long long min,
|
||||
unsigned long long max);
|
||||
386
lib/atoi/a2i.h
386
lib/atoi/a2i.h
@@ -1,386 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ATOI_A2I_H_
|
||||
#define SHADOW_INCLUDE_LIB_ATOI_A2I_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "atoi/strtoi.h"
|
||||
#include "atoi/strtou_noneg.h"
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
/*
|
||||
* See the manual of these macros in liba2i's documentation:
|
||||
* <http://www.alejandro-colomar.es/share/dist/liba2i/git/HEAD/liba2i-HEAD.pdf>
|
||||
*/
|
||||
|
||||
|
||||
#define a2i(TYPE, n, s, ...) \
|
||||
( \
|
||||
_Generic((void (*)(TYPE, typeof(s))) 0, \
|
||||
void (*)(short, const char *): a2sh_c, \
|
||||
void (*)(short, const void *): a2sh_c, \
|
||||
void (*)(short, char *): a2sh_nc, \
|
||||
void (*)(short, void *): a2sh_nc, \
|
||||
void (*)(int, const char *): a2si_c, \
|
||||
void (*)(int, const void *): a2si_c, \
|
||||
void (*)(int, char *): a2si_nc, \
|
||||
void (*)(int, void *): a2si_nc, \
|
||||
void (*)(long, const char *): a2sl_c, \
|
||||
void (*)(long, const void *): a2sl_c, \
|
||||
void (*)(long, char *): a2sl_nc, \
|
||||
void (*)(long, void *): a2sl_nc, \
|
||||
void (*)(long long, const char *): a2sll_c, \
|
||||
void (*)(long long, const void *): a2sll_c, \
|
||||
void (*)(long long, char *): a2sll_nc, \
|
||||
void (*)(long long, void *): a2sll_nc, \
|
||||
void (*)(unsigned short, const char *): a2uh_c, \
|
||||
void (*)(unsigned short, const void *): a2uh_c, \
|
||||
void (*)(unsigned short, char *): a2uh_nc, \
|
||||
void (*)(unsigned short, void *): a2uh_nc, \
|
||||
void (*)(unsigned int, const char *): a2ui_c, \
|
||||
void (*)(unsigned int, const void *): a2ui_c, \
|
||||
void (*)(unsigned int, char *): a2ui_nc, \
|
||||
void (*)(unsigned int, void *): a2ui_nc, \
|
||||
void (*)(unsigned long, const char *): a2ul_c, \
|
||||
void (*)(unsigned long, const void *): a2ul_c, \
|
||||
void (*)(unsigned long, char *): a2ul_nc, \
|
||||
void (*)(unsigned long, void *): a2ul_nc, \
|
||||
void (*)(unsigned long long, const char *): a2ull_c, \
|
||||
void (*)(unsigned long long, const void *): a2ull_c, \
|
||||
void (*)(unsigned long long, char *): a2ull_nc, \
|
||||
void (*)(unsigned long long, void *): a2ull_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
|
||||
#define a2sh(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2sh_c, \
|
||||
const void *: a2sh_c, \
|
||||
char *: a2sh_nc, \
|
||||
void *: a2sh_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
#define a2si(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2si_c, \
|
||||
const void *: a2si_c, \
|
||||
char *: a2si_nc, \
|
||||
void *: a2si_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
#define a2sl(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2sl_c, \
|
||||
const void *: a2sl_c, \
|
||||
char *: a2sl_nc, \
|
||||
void *: a2sl_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
#define a2sll(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2sll_c, \
|
||||
const void *: a2sll_c, \
|
||||
char *: a2sll_nc, \
|
||||
void *: a2sll_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
#define a2uh(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2uh_c, \
|
||||
const void *: a2uh_c, \
|
||||
char *: a2uh_nc, \
|
||||
void *: a2uh_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
#define a2ui(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2ui_c, \
|
||||
const void *: a2ui_c, \
|
||||
char *: a2ui_nc, \
|
||||
void *: a2ui_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
#define a2ul(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2ul_c, \
|
||||
const void *: a2ul_c, \
|
||||
char *: a2ul_nc, \
|
||||
void *: a2ul_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
#define a2ull(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2ull_c, \
|
||||
const void *: a2ull_c, \
|
||||
char *: a2ull_nc, \
|
||||
void *: a2ull_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2sh_c(short *restrict n, const char *s,
|
||||
const char **restrict endp, int base, short min, short max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2si_c(int *restrict n, const char *s,
|
||||
const char **restrict endp, int base, int min, int max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2sl_c(long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long min, long max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2sll_c(long long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long long min, long long max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2uh_c(unsigned short *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned short min,
|
||||
unsigned short max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2ui_c(unsigned int *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned int min, unsigned int max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2ul_c(unsigned long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned long min, unsigned long max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2ull_c(unsigned long long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned long long min,
|
||||
unsigned long long max);
|
||||
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2sh_nc(short *restrict n, char *s,
|
||||
char **restrict endp, int base, short min, short max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2si_nc(int *restrict n, char *s,
|
||||
char **restrict endp, int base, int min, int max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2sl_nc(long *restrict n, char *s,
|
||||
char **restrict endp, int base, long min, long max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2sll_nc(long long *restrict n, char *s,
|
||||
char **restrict endp, int base, long long min, long long max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2uh_nc(unsigned short *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned short min, unsigned short max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2ui_nc(unsigned int *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned int min, unsigned int max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2ul_nc(unsigned long *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned long min, unsigned long max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2ull_nc(unsigned long long *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned long long min,
|
||||
unsigned long long max);
|
||||
|
||||
|
||||
inline int
|
||||
a2sh_c(short *restrict n, const char *s,
|
||||
const char **restrict endp, int base, short min, short max)
|
||||
{
|
||||
return a2sh(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2si_c(int *restrict n, const char *s,
|
||||
const char **restrict endp, int base, int min, int max)
|
||||
{
|
||||
return a2si(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2sl_c(long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long min, long max)
|
||||
{
|
||||
return a2sl(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2sll_c(long long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long long min, long long max)
|
||||
{
|
||||
return a2sll(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2uh_c(unsigned short *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned short min,
|
||||
unsigned short max)
|
||||
{
|
||||
return a2uh(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2ui_c(unsigned int *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned int min, unsigned int max)
|
||||
{
|
||||
return a2ui(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2ul_c(unsigned long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned long min, unsigned long max)
|
||||
{
|
||||
return a2ul(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2ull_c(unsigned long long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, unsigned long long min,
|
||||
unsigned long long max)
|
||||
{
|
||||
return a2ull(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2sh_nc(short *restrict n, char *s,
|
||||
char **restrict endp, int base, short min, short max)
|
||||
{
|
||||
int status;
|
||||
|
||||
*n = strtoi_(s, endp, base, min, max, &status);
|
||||
if (status != 0) {
|
||||
errno = status;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2si_nc(int *restrict n, char *s,
|
||||
char **restrict endp, int base, int min, int max)
|
||||
{
|
||||
int status;
|
||||
|
||||
*n = strtoi_(s, endp, base, min, max, &status);
|
||||
if (status != 0) {
|
||||
errno = status;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2sl_nc(long *restrict n, char *s,
|
||||
char **restrict endp, int base, long min, long max)
|
||||
{
|
||||
int status;
|
||||
|
||||
*n = strtoi_(s, endp, base, min, max, &status);
|
||||
if (status != 0) {
|
||||
errno = status;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2sll_nc(long long *restrict n, char *s,
|
||||
char **restrict endp, int base, long long min, long long max)
|
||||
{
|
||||
int status;
|
||||
|
||||
*n = strtoi_(s, endp, base, min, max, &status);
|
||||
if (status != 0) {
|
||||
errno = status;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2uh_nc(unsigned short *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned short min,
|
||||
unsigned short max)
|
||||
{
|
||||
int status;
|
||||
|
||||
*n = strtou_noneg(s, endp, base, min, max, &status);
|
||||
if (status != 0) {
|
||||
errno = status;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2ui_nc(unsigned int *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned int min, unsigned int max)
|
||||
{
|
||||
int status;
|
||||
|
||||
*n = strtou_noneg(s, endp, base, min, max, &status);
|
||||
if (status != 0) {
|
||||
errno = status;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2ul_nc(unsigned long *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned long min, unsigned long max)
|
||||
{
|
||||
int status;
|
||||
|
||||
*n = strtou_noneg(s, endp, base, min, max, &status);
|
||||
if (status != 0) {
|
||||
errno = status;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2ull_nc(unsigned long long *restrict n, char *s,
|
||||
char **restrict endp, int base, unsigned long long min,
|
||||
unsigned long long max)
|
||||
{
|
||||
int status;
|
||||
|
||||
*n = strtou_noneg(s, endp, base, min, max, &status);
|
||||
if (status != 0) {
|
||||
errno = status;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
7
lib/atoi/a2i/a2i.c
Normal file
7
lib/atoi/a2i/a2i.c
Normal file
@@ -0,0 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "atoi/a2i/a2i.h"
|
||||
62
lib/atoi/a2i/a2i.h
Normal file
62
lib/atoi/a2i/a2i.h
Normal file
@@ -0,0 +1,62 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ATOI_A2I_A2I_H_
|
||||
#define SHADOW_INCLUDE_LIB_ATOI_A2I_A2I_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "atoi/a2i/a2s_c.h"
|
||||
#include "atoi/a2i/a2s_nc.h"
|
||||
#include "atoi/a2i/a2u_c.h"
|
||||
#include "atoi/a2i/a2u_nc.h"
|
||||
|
||||
|
||||
/*
|
||||
* See the manual of these macros in liba2i's documentation:
|
||||
* <http://www.alejandro-colomar.es/share/dist/liba2i/git/HEAD/liba2i-HEAD.pdf>
|
||||
*/
|
||||
|
||||
|
||||
#define a2i(TYPE, n, s, ...) \
|
||||
( \
|
||||
_Generic((void (*)(TYPE, typeof(s))) 0, \
|
||||
void (*)(short, const char *): a2sh_c, \
|
||||
void (*)(short, const void *): a2sh_c, \
|
||||
void (*)(short, char *): a2sh_nc, \
|
||||
void (*)(short, void *): a2sh_nc, \
|
||||
void (*)(int, const char *): a2si_c, \
|
||||
void (*)(int, const void *): a2si_c, \
|
||||
void (*)(int, char *): a2si_nc, \
|
||||
void (*)(int, void *): a2si_nc, \
|
||||
void (*)(long, const char *): a2sl_c, \
|
||||
void (*)(long, const void *): a2sl_c, \
|
||||
void (*)(long, char *): a2sl_nc, \
|
||||
void (*)(long, void *): a2sl_nc, \
|
||||
void (*)(long long, const char *): a2sll_c, \
|
||||
void (*)(long long, const void *): a2sll_c, \
|
||||
void (*)(long long, char *): a2sll_nc, \
|
||||
void (*)(long long, void *): a2sll_nc, \
|
||||
void (*)(unsigned short, const char *): a2uh_c, \
|
||||
void (*)(unsigned short, const void *): a2uh_c, \
|
||||
void (*)(unsigned short, char *): a2uh_nc, \
|
||||
void (*)(unsigned short, void *): a2uh_nc, \
|
||||
void (*)(unsigned int, const char *): a2ui_c, \
|
||||
void (*)(unsigned int, const void *): a2ui_c, \
|
||||
void (*)(unsigned int, char *): a2ui_nc, \
|
||||
void (*)(unsigned int, void *): a2ui_nc, \
|
||||
void (*)(unsigned long, const char *): a2ul_c, \
|
||||
void (*)(unsigned long, const void *): a2ul_c, \
|
||||
void (*)(unsigned long, char *): a2ul_nc, \
|
||||
void (*)(unsigned long, void *): a2ul_nc, \
|
||||
void (*)(unsigned long long, const char *): a2ull_c, \
|
||||
void (*)(unsigned long long, const void *): a2ull_c, \
|
||||
void (*)(unsigned long long, char *): a2ull_nc, \
|
||||
void (*)(unsigned long long, void *): a2ull_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
|
||||
#endif // include guard
|
||||
7
lib/atoi/a2i/a2s.c
Normal file
7
lib/atoi/a2i/a2s.c
Normal file
@@ -0,0 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "atoi/a2i/a2s.h"
|
||||
56
lib/atoi/a2i/a2s.h
Normal file
56
lib/atoi/a2i/a2s.h
Normal file
@@ -0,0 +1,56 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ATOI_A2I_A2S_H_
|
||||
#define SHADOW_INCLUDE_LIB_ATOI_A2I_A2S_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "atoi/a2i/a2s_c.h"
|
||||
#include "atoi/a2i/a2s_nc.h"
|
||||
|
||||
|
||||
#define a2sh(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2sh_c, \
|
||||
const void *: a2sh_c, \
|
||||
char *: a2sh_nc, \
|
||||
void *: a2sh_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
#define a2si(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2si_c, \
|
||||
const void *: a2si_c, \
|
||||
char *: a2si_nc, \
|
||||
void *: a2si_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
#define a2sl(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2sl_c, \
|
||||
const void *: a2sl_c, \
|
||||
char *: a2sl_nc, \
|
||||
void *: a2sl_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
#define a2sll(n, s, ...) \
|
||||
( \
|
||||
_Generic(s, \
|
||||
const char *: a2sll_c, \
|
||||
const void *: a2sll_c, \
|
||||
char *: a2sll_nc, \
|
||||
void *: a2sll_nc \
|
||||
)(n, s, __VA_ARGS__) \
|
||||
)
|
||||
|
||||
|
||||
#endif // include guard
|
||||
17
lib/atoi/a2i/a2s_c.c
Normal file
17
lib/atoi/a2i/a2s_c.c
Normal file
@@ -0,0 +1,17 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "atoi/a2i/a2s_c.h"
|
||||
|
||||
|
||||
extern inline int a2sh_c(short *restrict n, const char *s,
|
||||
const char **restrict endp, int base, short min, short max);
|
||||
extern inline int a2si_c(int *restrict n, const char *s,
|
||||
const char **restrict endp, int base, int min, int max);
|
||||
extern inline int a2sl_c(long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long min, long max);
|
||||
extern inline int a2sll_c(long long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long long min, long long max);
|
||||
64
lib/atoi/a2i/a2s_c.h
Normal file
64
lib/atoi/a2i/a2s_c.h
Normal file
@@ -0,0 +1,64 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ATOI_A2I_A2S_C_H_
|
||||
#define SHADOW_INCLUDE_LIB_ATOI_A2I_A2S_C_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "atoi/a2i/a2s_nc.h"
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2sh_c(short *restrict n, const char *s,
|
||||
const char **restrict endp, int base, short min, short max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2si_c(int *restrict n, const char *s,
|
||||
const char **restrict endp, int base, int min, int max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2sl_c(long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long min, long max);
|
||||
ATTR_STRING(2) ATTR_ACCESS(write_only, 1) ATTR_ACCESS(write_only, 3)
|
||||
inline int a2sll_c(long long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long long min, long long max);
|
||||
|
||||
|
||||
inline int
|
||||
a2sh_c(short *restrict n, const char *s,
|
||||
const char **restrict endp, int base, short min, short max)
|
||||
{
|
||||
return a2sh_nc(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2si_c(int *restrict n, const char *s,
|
||||
const char **restrict endp, int base, int min, int max)
|
||||
{
|
||||
return a2si_nc(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2sl_c(long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long min, long max)
|
||||
{
|
||||
return a2sl_nc(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
inline int
|
||||
a2sll_c(long long *restrict n, const char *s,
|
||||
const char **restrict endp, int base, long long min, long long max)
|
||||
{
|
||||
return a2sll_nc(n, (char *) s, (char **) endp, base, min, max);
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user