Compare commits

..

163 Commits

Author SHA1 Message Date
Chris Hofstaedtler
94385da1c2 Update changelog for 1:4.17.2-4 release 2025-02-17 12:28:59 +01:00
Chris Hofstaedtler
a143aca1c9 Revert upstreams chfn.c strsep change
Closes: #1096187
2025-02-17 12:28:14 +01:00
Chris Hofstaedtler
f476e8b263 Update changelog for 1:4.17.2-3 release 2025-02-16 20:24:37 +01:00
Chris Hofstaedtler
477077497f Revert upstreams strtoday calculation "fix"
Closes: #1095430
2025-02-16 20:24:22 +01:00
Chris Hofstaedtler
8b42aebdfb Update changelog for 1:4.17.2-2 release 2025-02-15 17:21:43 +01:00
Chris Hofstaedtler
d39c5351ae Apply upstream revert of "Use local time for human-readable dates"
Closes: #1095430
2025-02-15 17:20:40 +01:00
Chris Hofstaedtler
b2a5824f7f Update changelog for 1:4.17.2-1 release 2025-02-09 18:14:54 +01:00
Chris Hofstaedtler
7c5c7ebd17 Refresh patches 2025-02-09 18:14:48 +01:00
Chris Hofstaedtler
4d765593fb Update upstream source from tag 'upstream/4.17.2'
Update to upstream version '4.17.2'
with Debian dir 487a01426d
2025-02-09 18:13:39 +01:00
Chris Hofstaedtler
65261e28f4 New upstream version 4.17.2 2025-02-09 18:13:39 +01:00
Chris Hofstaedtler
52fc52e74a Apply upstream match from Marc Haber to document E_BAD_NAME 2025-02-09 18:13:17 +01:00
Chris Hofstaedtler
30f621e2a7 Update changelog for 1:4.17.1-2 release 2025-01-08 12:40:14 +01:00
Chris Hofstaedtler
f6f677a4ca Remove unnecessary Build-Depends: quilt
Closes: #1092461

Thanks: Bastian Germann
2025-01-08 12:39:17 +01:00
Chris Hofstaedtler
ac4bab2baa Rewrite shadowconfig(8) manpage
Contributed by Alejandro Colomar <alx@kernel.org>

Thanks: Alejandro Colomar <alx@kernel.org>
2025-01-04 13:43:40 +01:00
Chris Hofstaedtler
ccffcd6f80 Update changelog for 1:4.17.1-1 release 2025-01-04 12:41:53 +01:00
Chris Hofstaedtler
bd724b34e0 New upstream version 4.17.1 2025-01-04 12:41:43 +01:00
Chris Hofstaedtler
194489de56 Update upstream source from tag 'upstream/4.17.1'
Update to upstream version '4.17.1'
with Debian dir c83467a364
2025-01-04 12:41:43 +01:00
Chris Hofstaedtler
8524eb9ab1 Update changelog for 1:4.17.0-1 release 2024-12-28 13:17:04 +01:00
Chris Hofstaedtler
5c6c085ae5 Refresh patches 2024-12-28 13:16:52 +01:00
Chris Hofstaedtler
c2a3ebed18 New upstream version 4.17.0 2024-12-28 13:12:23 +01:00
Chris Hofstaedtler
d11a43e29c Update upstream source from tag 'upstream/4.17.0'
Update to upstream version '4.17.0'
with Debian dir 361b69fd23
2024-12-28 13:12:23 +01:00
Chris Hofstaedtler
baf57b0835 Update changelog for 1:4.17.0~rc1-2 release 2024-12-22 20:15:41 +01:00
Chris Hofstaedtler
83ef3ff76d Remove Debian patch to relax username checks
Per discussion d-devel, with upstream, and the adduser maintainer.
2024-12-22 20:14:43 +01:00
Chris Hofstaedtler
bea3610b66 Update changelog for 1:4.17.0~rc1-1 release 2024-12-06 19:55:40 +01:00
Chris Hofstaedtler
d14cb1acb3 Forbid purely numeric user/group names, and "." and ".." 2024-12-06 19:55:29 +01:00
Chris Hofstaedtler
931b0f68b7 d/copyright: update 2024-12-06 19:55:29 +01:00
Chris Hofstaedtler
32d53642f0 Refresh patches 2024-12-06 19:37:04 +01:00
Chris Hofstaedtler
24c35ea945 Add upstream patch for new return-code for bad usernames 2024-12-06 19:37:04 +01:00
Chris Hofstaedtler
f78a468368 New upstream version 4.17.0~rc1 2024-12-06 19:17:25 +01:00
Chris Hofstaedtler
0a94a89bcf Update upstream source from tag 'upstream/4.17.0_rc1'
Update to upstream version '4.17.0~rc1'
with Debian dir 49328bccc4
2024-12-06 19:17:25 +01:00
Chris Hofstaedtler
92410b1c76 Update changelog for 1:4.16.0-7 release 2024-12-06 13:51:45 +01:00
Chris Hofstaedtler
c91a226797 Update changelog for 1:4.16.0-6 release 2024-12-06 13:51:02 +01:00
Florent 'Skia' Jacquet
b0619a14cd d/patches: fix 'upstream' test suite
Those two missing spaces made the build of the libsubid/04_nss test
to fail.
2024-12-03 16:15:27 +01:00
Chris Hofstaedtler
6605806a6d Add NEWS entry about faillog
Closes: #1074320
2024-11-16 15:49:18 +01:00
Chris Hofstaedtler
e649b28033 Update changelog for 1:4.16.0-5 release 2024-11-15 20:38:00 +01:00
Chris Hofstaedtler
4f3dfcdadd login.defs: remove info about write(1)
Which is not part of Debian trixie.

Gbp-Dch: full

Closes: #1087519
2024-11-15 20:38:00 +01:00
Chris Hofstaedtler
ccaa7ea01e Merge branch 'non-linux' into 'master'
Include <utmpx.h>, fixing the build on GNU/Hurd

See merge request debian/shadow!26
2024-09-12 23:19:21 +00:00
Pino Toscano
1eaf9012b1 Include <utmpx.h>, fixing the build on GNU/Hurd 2024-09-12 19:15:27 +02:00
Chris Hofstaedtler
a5e0d00442 Customize debian/salsa-ci.yml
Gbp-Dch: ignore
2024-08-23 12:13:24 +02:00
Chris Hofstaedtler
ade65b0204 debputy.manifest: merge path-metadata entries 2024-08-13 09:48:15 +02:00
Chris Hofstaedtler
a23a040247 Always build with btrfs support on linux-any
Closes: #856557
2024-08-06 01:07:16 +02:00
Chris Hofstaedtler
f11f8581f2 Update changelog for 1:4.16.0-4 release 2024-08-06 00:50:53 +02:00
Chris Hofstaedtler
4885f58fde Stop building programs we do not install 2024-08-06 00:50:53 +02:00
Chris Hofstaedtler
68624ca168 Add debian/gbp.conf
Gbp-Dch: ignore
2024-08-06 00:50:53 +02:00
Chris Hofstaedtler
8d8becfddb Remove libsystemd-dev Build-Depends
Only necessary for login(1).

Gbp-Dch: full
2024-08-06 00:50:53 +02:00
Chris Hofstaedtler
d390695b6d Define LOGIN_NAME_MAX on HURD 2024-08-06 00:50:53 +02:00
Chris Hofstaedtler
70bb4db51c Rebase patch
Gbp-Dch: ignore
2024-08-06 00:50:53 +02:00
Chris Hofstaedtler
5a17bd19ad Stop patching login, not installed anymore 2024-08-06 00:50:53 +02:00
Chris Hofstaedtler
b44052751e Drop Debian-only cppw, cpgr tools
Closes: #750752
2024-08-06 00:50:53 +02:00
Chris Hofstaedtler
d7383961f5 Update changelog for 1:4.16.0-3 release 2024-08-05 17:21:41 +02:00
Chris Hofstaedtler
a7e5816642 Fix FTBFS on hurd
DEB_HOST_ARCH_OS was unset.

Gbp-Dch: full
2024-08-05 03:34:01 +02:00
Chris Hofstaedtler
a2f607ed76 Update changelog for 1:4.16.0-2 release 2024-08-05 02:58:02 +02:00
Chris Hofstaedtler
9bbb9e5060 Quiet lintian about debputy 2024-08-05 02:58:02 +02:00
Chris Hofstaedtler
75eb23ace8 Re-add workarounds for tests in tests/tests directory
4.15.3 fixed this, but 4.16.0 happened earlier.

Gbp-Dch: full
2024-08-05 02:58:01 +02:00
Chris Hofstaedtler
588b536eb1 Reset upstream to 4.16.0
Gbp-Dch: ignore
2024-08-05 02:58:01 +02:00
Chris Hofstaedtler
f6e239d940 login.defs: ship manpage 2024-08-05 02:58:00 +02:00
Chris Hofstaedtler
c4ecaf0a01 Drop login package, to allow takeover by util-linux
Move shadow.mo to Package: passwd, have passwd Replaces: older login.

Gbp-Dch: full
2024-08-05 02:58:00 +02:00
Chris Hofstaedtler
2acc8676db Drop unnecessary debian/login.dirs
Gbp-Dch: ignore
2024-08-05 00:34:28 +02:00
Chris Hofstaedtler
9966b2ae50 Merge 4.16.0 from experimental 2024-08-05 00:30:29 +02:00
Chris Hofstaedtler
0d8225bd20 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).

Gbp-Dch: full
2024-08-05 00:27:34 +02:00
Chris Hofstaedtler
5c3cef331a Update changelog for 1:4.16.0-1 release 2024-08-03 00:32:25 +02:00
Chris Hofstaedtler
4d9f62575d Rename libsubid4 to libsubid5 (soname bump) 2024-08-02 17:54:39 +02:00
Chris Hofstaedtler
b7b75e2d61 Split /etc/login.defs into its own binary package
Closes: #1074394
2024-08-02 17:54:39 +02:00
Chris Hofstaedtler
ccae83d30e Update changelog for 1:4.15.3-3 release 2024-07-21 21:05:41 +02:00
Chris Hofstaedtler
08e5e0a148 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.

Gbp-Dch: full
2024-07-21 21:02:52 +02:00
Chris Hofstaedtler
0d4266dc81 Update changelog for 1:4.15.3-2 release 2024-07-07 15:49:03 +02:00
Chris Hofstaedtler
c5d3d4be36 Workaround dh_missing complaint
Gbp-Dch: ignore
2024-07-07 15:49:03 +02:00
Chris Hofstaedtler
6170f973ff Merge branch 'linux-options' into 'master'
d/rules: actually enable Linux-only options on Linux

See merge request debian/shadow!23
2024-07-07 13:30:06 +00:00
Chris Hofstaedtler
1c7262b6e2 Merge branch 'rm-groupmems' into 'master'
Stop installing groupmems(8)

See merge request debian/shadow!24
2024-07-07 13:28:30 +00:00
Chris Hofstaedtler
e9cceb62ce login.defs: remove obscure, defaulted vars 2024-07-07 15:22:58 +02:00
Chris Hofstaedtler
75904cfd05 login.defs: resync comments with upstream 2024-07-07 14:56:37 +02:00
Chris Hofstaedtler
f8e81f7293 login.defs: remove CONSOLE, ignored with PAM 2024-07-07 14:26:10 +02:00
Chris Hofstaedtler
d0c5da8cf1 login.defs: remove CONSOLE_GROUPS, ignored with PAM 2024-07-07 14:24:12 +02:00
Chris Hofstaedtler
5f784b3ef3 login.defs: remove vars ignored by su(1) 2024-07-07 14:21:33 +02:00
Chris Hofstaedtler
fd652cdf40 login.defs: remove incomplete list of unused vars 2024-07-07 14:14:13 +02:00
Chris Hofstaedtler
a5d765523b login.defs: remove obsolete/confusing comments 2024-07-07 14:13:45 +02:00
Chris Hofstaedtler
9b4bfac4ef Turn login.defs file into a patch
Gbp-Dch: ignore
2024-07-07 14:08:10 +02:00
Chris Hofstaedtler
d7b0c262ba Stop installing groupmems(8)
Given this never worked, and other distros seem to do fine without this
tool, let's stop shipping it.

Closes: #1004472
2024-07-07 14:03:54 +02:00
Pino Toscano
82e88c1e9b d/rules: actually enable Linux-only options on Linux
The condition was inverted, applying options meant for Linux to
non-Linux architectures.

Gbp-Dch: Short
2024-07-07 06:59:58 +02:00
Chris Hofstaedtler
688fb93702 Update changelog for 1:4.15.3-1 release 2024-07-06 23:51:09 +02:00
Chris Hofstaedtler
43bf5f3b39 Fix setup of test libsubid-04_nss 2024-07-06 23:37:02 +02:00
Chris Hofstaedtler
7c7e8f5c18 Bump Standards-Version to 4.7.0 2024-07-06 23:30:23 +02:00
Chris Hofstaedtler
81313b4c5d Run wrap-and-sort -a
Gbp-Dch: ignore
2024-07-06 23:30:00 +02:00
Chris Hofstaedtler
632746518a Drop login.postinst, obsoleted by #1074121 2024-07-06 23:28:49 +02:00
Chris Hofstaedtler
a6f8d25673 Rebase patches 2024-07-06 22:48:07 +02:00
Chris Hofstaedtler
9b0bef767c tests: follow upstream subdir fix 2024-07-06 16:56:01 +02:00
Chris Hofstaedtler
61085fbfef Update upstream source from tag 'upstream/4.15.3'
Update to upstream version '4.15.3'
with Debian dir a607bcc1dd
2024-07-06 16:54:27 +02:00
Chris Hofstaedtler
9f68246a01 New upstream version 4.15.3 2024-07-06 16:53:58 +02:00
Chris Hofstaedtler
bc6fea5f73 d/tests/control: correctly set isolation-machine
Gbp-Dch: ignore
2024-06-27 23:24:12 +02:00
Chris Hofstaedtler
972687a07b Merge branch 'upstream-tests' into 'master'
Add upstream tests to run in autopkgtests

See merge request debian/shadow!22
2024-06-26 23:29:03 +00:00
Serge Hallyn
aad21d4486 Add upstream tests to run in autopkgtests
Disable the su tests, since su in debian comes from util-linux.

[zeha@d.o: rebase on top of upstream applied patch, rework
debian/tests/*]
2024-06-27 01:27:24 +02:00
Chris Hofstaedtler
29f0e1dcf4 patches: fix gbp-pq topic annotation
Gbp-Dch: ignore
2024-06-27 01:20:09 +02:00
Chris Hofstaedtler
e0d410ad6a Add upstream patch easing running testsuite 2024-06-27 01:18:32 +02:00
Chris Hofstaedtler
95447b3f56 Update changelog for 1:4.15.2-3 release 2024-06-26 12:45:06 +02:00
Chris Hofstaedtler
999c14c87b Revert "Use upstream's restrictions on user- and group names again"
This reverts commit 019ffd5126.
2024-06-26 12:40:15 +02:00
Chris Hofstaedtler
b214d3fb51 Rebase patches 2024-06-25 20:12:39 +02:00
Chris Hofstaedtler
d08fc0fe8b Update upstream source from tag 'upstream/4.16.0'
Update to upstream version '4.16.0'
with Debian dir 58218d51ac
2024-06-25 20:10:09 +02:00
Chris Hofstaedtler
e8b8d7a84b New upstream version 4.16.0 2024-06-25 20:09:23 +02:00
Chris Hofstaedtler
69a2672d3b d/watch: add versionmangle for -rc 2024-06-25 20:08:38 +02:00
Chris Hofstaedtler
41662e422b Update changelog for 1:4.15.2-2 release 2024-06-25 19:42:56 +02:00
Chris Hofstaedtler
ff20574597 passwd: add Depends: login
Stop-gap until passwd can takeover /etc/login.defs from login.

Gbp-Dch: full
2024-06-25 19:41:56 +02:00
Chris Hofstaedtler
712f360fcd shadowconfig.8: actually install again 2024-06-23 15:57:14 +02:00
Chris Hofstaedtler
551cf36757 Remove our copy of HOME_MODE.xml, identical upstream 2024-06-23 15:38:08 +02:00
Chris Hofstaedtler
e4f60bc5b6 d/not-installed: Remove obsolete entry
Gbp-Dch: ignore
2024-06-23 15:27:48 +02:00
Chris Hofstaedtler
0a96fd2bf0 Drop useradd's backwards-compatibility -O flag
No users appear left in Debian.
2024-06-23 14:57:28 +02:00
Chris Hofstaedtler
019ffd5126 Use upstream's restrictions on user- and group names again
Upstream started supporting mixed-case names some time ago.
Purely numeric names (#79682) are now forbidden again, as there is no
way of distinguishing them from user/group IDs otherwise.

Gbp-Dch: full
2024-06-23 14:50:55 +02:00
Chris Hofstaedtler
45e98ea60a Remove faillog support
Stop installing faillog binary and man pages. Stop creating
/var/log/faillog in login.postinst.
PAM has removed support for /var/log/faillog by dropping pam_tally, and
login itself cannot write to it either.

Gbp-Dch: full
2024-06-23 03:07:36 +02:00
Chris Hofstaedtler
878710fb7a d/rules: explicitly set --with-audit and --enable-subordinate-ids 2024-06-22 18:12:09 +02:00
Chris Hofstaedtler
771535fa07 useradd(8): Fix missing paragraph on username length 2024-06-22 18:05:22 +02:00
Chris Hofstaedtler
ac353a0d49 Update changelog for 1:4.15.2-1 release 2024-06-22 17:55:55 +02:00
Chris Hofstaedtler
527b684a18 Rebase patches 2024-06-22 17:55:55 +02:00
Chris Hofstaedtler
0fda4df4f1 New upstream version 4.15.2 2024-06-22 17:34:25 +02:00
Chris Hofstaedtler
ae2c71761e Update upstream source from tag 'upstream/4.15.2'
Update to upstream version '4.15.2'
with Debian dir 73ed8d5b49
2024-06-22 17:34:25 +02:00
Chris Hofstaedtler
154029254a Update changelog for 1:4.15.1-1 release 2024-06-22 16:41:40 +02:00
Chris Hofstaedtler
a85c288e96 login.defs: remove PAM-unsupported crypt settings
Closes: #1055582
2024-06-22 16:17:10 +02:00
Chris Hofstaedtler
e1f06f07bc Set same umask policy as PAM by default
Closes: #1068704, #1070085
2024-06-22 16:17:10 +02:00
Chris Hofstaedtler
80660f4a94 Enable acl, xattr support
Closes: #745796
2024-06-22 16:17:10 +02:00
Chris Hofstaedtler
f19c0e69e1 login: switch from Essential to Protected: yes
Closes: #960638
2024-06-22 16:17:10 +02:00
Chris Hofstaedtler
b6e44ab213 Update d/copyright 2024-06-22 16:13:15 +02:00
Chris Hofstaedtler
f56f3e81df Use functions from libbsd
Closes: #1032393
2024-06-22 16:13:11 +02:00
Chris Hofstaedtler
5413108b8a login.defs: update default ENCRYPT_METHOD
Closes: #1043236
2024-06-22 16:13:11 +02:00
Chris Hofstaedtler
c154cb50fa Rename remaining patches to end with ".patch"
Gbp-Dch: ignore
2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
3bf1270130 Rebase patch 542_useradd-O_option 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
e3549c3f90 Rebase patch 506_relaxed_usernames 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
ad3a822529 Rebase patch 502_debian_useradd_defaults 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
10c72480c0 Rebase patch 501_commonio_group_shadow 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
6c1c44f0fc Rebase patch 463_login_delay_obeys_to_PAM 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
23d33f4922 Use upstream FAILLOG_ENAB code, incompatible with PAM 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
0c8f801a7a Rename patch 402_cppw_selinux 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
4a109337ab Rebase patch 401_cppw_src.dpatch 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
584b0b6a36 Disable FTMP_FILE by default, drop login failure logging
lastb is gone, so it is pointless to write to the btmp file.
2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
4e48f059e7 Drop upstream applied patches 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
fbd4430a1d Build-Depend: pkgconf 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
4b707105f4 Build-Depend: libltdl-dev for LT_LIB_DLLOAD 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
1526e6cde8 Explicitly enable logind on linux-any 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
8199342364 Turn off --enable-lastlog, drop lastlog from not-installed 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
4f3d0ac9b9 Remove obsolete configure flag --without-libcrack 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
57721a210f contrib/atudel, non-DFSG-compliant was removed upstream 2024-06-22 15:12:39 +02:00
Chris Hofstaedtler
d7536122e8 Merge branch 'upstream' 2024-06-22 15:12:05 +02:00
Chris Hofstaedtler
f7f4fd7c05 New upstream version 4.15.1 2024-06-13 03:08:44 +02:00
Chris Hofstaedtler
558a8f0796 Update upstream signing keys 2024-06-13 03:08:36 +02:00
Chris Hofstaedtler
623fdb60cd Tag build with dh-package-notes 2024-06-07 21:41:54 +02:00
Chris Hofstaedtler
bd08493dab Update changelog for 1:4.13+dfsg1-5 release 2024-06-02 20:02:22 +02:00
Chris Hofstaedtler
d3b392f509 libsubid4: tighten package-internal dependencies 2024-06-02 19:52:22 +02:00
Chris Hofstaedtler
9f16b61fe4 Use debputy to avoid Rules-Requires-Root: binary-targets 2024-06-02 19:52:22 +02:00
Chris Hofstaedtler
97e47ed437 Apply wrap-and-sort -kas style 2024-06-02 19:05:53 +02:00
Chris Hofstaedtler
d300102446 Add myself to Uploaders, per discussion with Serge Hallyn 2024-06-02 19:04:57 +02:00
Serge Hallyn
3d71c62ab1 Drop lastlog (zeha@debian.org)
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-05-30 11:17:38 -05:00
Jonathan Carter
2ff04fd9b5 Merge branch '2024-02-12/1' into 'master'
(Helmut Grohne) move login and shadowconfig to /usr

See merge request debian/shadow!19
2024-02-18 12:43:59 +00:00
Serge Hallyn
97a3bc0c43 (Helmut Grohne) move login and shadowconfig to /usr
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-02-12 19:23:31 -06:00
Balint Reczey
485b374d09 Update changelog 2023-10-15 19:11:29 +02:00
Balint Reczey
25f0b936c0 Remove myself from uploaders 2023-09-27 10:22:26 +02:00
Balint Reczey
776d4d23ac Update changelog 2023-09-26 22:02:45 +02:00
Balint Reczey
9f285306f3 Fix valid_field() that regressed in upstream's first CVE fix
cherry-picking upstream's regression fix.

Follow-up for commit 50defcfa5d .

Gbp-Dch: Ignore
2023-09-26 12:19:29 +02:00
Balint Reczey
f569ea06ff Update changelog 2023-09-25 18:18:48 +02:00
Balint Reczey
50defcfa5d Cherry-pick upstream patch to fix chfn vulnerability
(CVE-2023-29383)

Closes: #1034482
2023-09-25 18:13:40 +02:00
Balint Reczey
56c7502686 Cherry-pick upstream patch to fix gpasswd passwd leak
(CVE-2023-4641)

Closes: #1051062
2023-09-25 17:55:00 +02:00
Balint Reczey
7c66acdd2e Update changelog 2023-09-25 17:41:27 +02:00
Balint Reczey
4806645316 debian/NEWS: Fix false claim about PREVENT_NO_AUTH affecting authentication
Also drop setting PREVENT_NO_AUTH in shipped login.defs.

Closes: #1041547
2023-09-25 17:15:46 +02:00
Balint Reczey
05a41bc4d5 Merge branch 'bprofile-nodoc' into 'master'
Support <nodoc> build profile (Closes: #1051827)

See merge request debian/shadow!18
2023-09-13 07:55:26 +00:00
Gioele Barabucci
75eb241552 Support <nodoc> build profile
`xsltproc`, `docbook` and all other XML-related packages are not needed
when the `<nodoc>` build profile is active, as long as `./configure` is
called with `--disable-man`.

Closes: #1051827
2023-09-13 08:52:53 +02:00
Balint Reczey
d7ce68863e debian/login.pam: Drop reference to Debian Etch
Closes: #1040064
2023-07-02 20:59:28 +02:00
Balint Reczey
095f9d48ef debian/gitlab-ci.yml: Use sudo to fix reprotest test 2022-11-11 21:18:06 +01:00
10923 changed files with 454155 additions and 50355 deletions

View File

@@ -3,11 +3,20 @@ reports and various comments. This list may be incomplete, I received
a lot of mail...
# Maintainers
* Marek Michałkiewicz <marekm72@gmail.com> (1995-2000)
* Tomasz Kłoczko <kloczek@pld.org.pl> (2000-2007)
* Nicolas François <nicolas.francois@centraliens.net> (2007-2014)
* Serge E. Hallyn <serge@hallyn.com> (2014-now)
* Christian Brauner <christian@brauner.io> (2019-now)
* Iker Pedrosa <ipedrosa@redhat.com> (2022-now)
* Alejandro Colomar <alx@kernel.org> (2023-now) (4.14 stable)
To verify signatures on releases, use the following keys under keys/ :
* Serge Hallyn: keys/66D0387DB85D320F8408166DB175CFA98F192AF2.asc
* Christian Brauner: keys/4880B8C9BD0E5106FC070F4F7B3C391EFEA93624.asc
* Iker Pedrosa: keys/4E80EF49C7987B6DE2F81F5005079C6C3A653E57.asc
* Alejandro Colomar: keys/A9348594CE31283A826FBDD8D57633D441E25BB5.asc
# Authors and contributors
* Adam Rudnicki <adam@v-lo.krakow.pl>

View File

@@ -9558,7 +9558,7 @@
* NEWS: release date corrected.
* NEWS, src/su.c:
fixed set enviroment too early when using PAM, so move it to !USE_PAM
fixed set environment too early when using PAM, so move it to !USE_PAM
(patch submitted by Mike Frysinger <vapier@gentoo.org>).
2006-07-30 Tomasz Kłoczko <kloczek@pld.org.pl>
@@ -10245,7 +10245,7 @@
* NEWS: cleanups.
* autogen.sh:
by default in development enviroment use CFLAGS="-O2 -Wall".
by default in development environment use CFLAGS="-O2 -Wall".
* src/chgpasswd.c (main): remove two unused variables (newgr and now).
@@ -11654,7 +11654,7 @@
in OPTIONS section). Describe -a and -k options.
* NEWS, src/su.c:
fixed twice copy enviroment which causes auth problems (bug was introduced in 4.0.12;
fixed twice copy environment which causes auth problems (bug was introduced in 4.0.12;
fix by Nicolas François <nicolas.francois@centraliens.net>).
* src/passwd.c, po/ja.po, po/ko.po, po/nb.po, po/nl.po, po/nn.po, po/pl.po, po/pt.po, po/pt_BR.po, po/ro.po, po/ru.po, po/sk.po, po/sq.po, po/sv.po, po/tl.po, po/tr.po, po/uk.po, po/vi.po, po/zh_CN.po, po/zh_TW.po, po/bs.po, po/ca.po, po/cs.po, po/da.po, po/de.po, po/el.po, po/es.po, po/eu.po, po/fi.po, po/fr.po, po/he.po, po/id.po, po/it.po:
@@ -12584,7 +12584,7 @@
http://bugs.debian.org/48002
* src/login.c, NEWS:
fixed loggin of username on succesful login (was using the normal username,
fixed loggin of username on successful login (was using the normal username,
when it should have used pam_user) http://bugs.debian.org/47819
2005-06-02 Tomasz Kłoczko <kloczek@pld.org.pl>
@@ -13029,7 +13029,7 @@
* man/pl/usermod.8: finish sync with english version.
* man/hu/login.1, man/pl/login.1, NEWS, man/Attic/login.1, man/de/login.1:
removed fragment about abilities pass enviroment variables in login prompt.
removed fragment about abilities pass environment variables in login prompt.
* man/Attic/gpasswd.1, man/Attic/newgrp.1:
fixes by Nicolas Nicolas François <nicolas.francois@centraliens.net> (not all
@@ -13508,7 +13508,7 @@
removed not used translations.
* NEWS, src/su.c:
fix adding of pam_env env variables to enviroment (Martin Schlemmer <azarah@nosferatu.za.org>).
fix adding of pam_env env variables to environment (Martin Schlemmer <azarah@nosferatu.za.org>).
* NEWS, configure.in:
fixed filling MAIL_SPOOL_DIR and MAIL_SPOOL_FILE variables which was allways
@@ -13605,7 +13605,7 @@
* NEWS, src/su.c:
add pam_open_session() support. If builded without PAM support
propagate $DISPLAY and $XAUTHORITY enviroment variables.
propagate $DISPLAY and $XAUTHORITY environment variables.
Based on http://www.gentoo.org/cgi-bin/viewcvs.cgi/sys-apps/shadow/files/shadow-4.0.4.1-su-pam_open_session.patch?rev=1.1
2004-10-23 Tomasz Kłoczko <kloczek@pld.org.pl>

View File

@@ -1,15 +1,27 @@
## Process this file with automake to produce Makefile.in
EXTRA_DIST = NEWS README TODO shadow.spec.in
SUBDIRS = libmisc lib
SUBDIRS = lib
if ENABLE_SUBIDS
SUBDIRS += libsubid
endif
SUBDIRS += src po contrib doc etc
SUBDIRS += src po contrib doc etc tests/unit
if ENABLE_REGENERATE_MAN
SUBDIRS += man
endif
CLEANFILES = man/8.out man/po/remove-potcdate.* man/*/login.defs.d man/*/*.mo
EXTRA_DIST = NEWS README tests/
dist-hook:
chmod -R u+w $(distdir)/tests
chmod u+w $(distdir)
mv $(distdir)/tests/unit $(distdir)/realunittest
mv $(distdir)/tests/tests $(distdir)/realtests
rm -rf $(distdir)/tests
mv $(distdir)/realtests $(distdir)/tests
rm -rf $(distdir)/tests/unit $(distdir)/tests/Makefile*
mv $(distdir)/realunittest $(distdir)/tests/unit

View File

@@ -108,7 +108,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = man/po/Makefile shadow.spec
CONFIG_CLEAN_FILES = man/po/Makefile
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -163,12 +163,11 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
DIST_SUBDIRS = libmisc lib libsubid src po contrib doc etc man
DIST_SUBDIRS = lib libsubid src po contrib doc etc tests/unit man
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/shadow.spec.in $(top_srcdir)/man/po/Makefile.in \
ABOUT-NLS AUTHORS.md COPYING ChangeLog NEWS README TODO \
compile config.guess config.rpath config.sub install-sh \
ltmain.sh missing
$(top_srcdir)/man/po/Makefile.in ABOUT-NLS AUTHORS.md COPYING \
ChangeLog NEWS README compile config.guess config.rpath \
config.sub install-sh ltmain.sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -224,6 +223,8 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
@@ -257,9 +258,15 @@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBACL = @LIBACL@
LIBADD_DL = @LIBADD_DL@
LIBADD_DLD_LINK = @LIBADD_DLD_LINK@
LIBADD_DLOPEN = @LIBADD_DLOPEN@
LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
LIBATTR = @LIBATTR@
LIBAUDIT = @LIBAUDIT@
LIBCRACK = @LIBCRACK@
LIBBSD = @LIBBSD@
LIBBSD_CFLAGS = @LIBBSD_CFLAGS@
LIBBSD_LIBS = @LIBBSD_LIBS@
LIBCRYPT = @LIBCRYPT@
LIBECONF = @LIBECONF@
LIBICONV = @LIBICONV@
@@ -275,6 +282,7 @@ LIBSUBID_ABI = @LIBSUBID_ABI@
LIBSUBID_ABI_MAJOR = @LIBSUBID_ABI_MAJOR@
LIBSUBID_ABI_MICRO = @LIBSUBID_ABI_MICRO@
LIBSUBID_ABI_MINOR = @LIBSUBID_ABI_MINOR@
LIBSYSTEMD = @LIBSYSTEMD@
LIBTCB = @LIBTCB@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
@@ -283,6 +291,8 @@ LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_DLLOADERS = @LT_DLLOADERS@
LT_DLPREOPEN = @LT_DLPREOPEN@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
@@ -305,6 +315,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
RANLIB = @RANLIB@
SED = @SED@
@@ -376,9 +389,10 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = NEWS README TODO shadow.spec.in
SUBDIRS = libmisc lib $(am__append_1) src po contrib doc etc \
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
@@ -433,8 +447,6 @@ distclean-hdr:
-rm -f config.h stamp-h1
man/po/Makefile: $(top_builddir)/config.status $(top_srcdir)/man/po/Makefile.in
cd $(top_builddir) && $(SHELL) ./config.status $@
shadow.spec: $(top_builddir)/config.status $(srcdir)/shadow.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
mostlyclean-libtool:
-rm -f *.lo
@@ -610,6 +622,9 @@ distdir-am: $(DISTFILES)
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
@@ -773,6 +788,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -856,8 +872,8 @@ uninstall-am:
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
dist-xz dist-zip dist-zstd distcheck distclean \
dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
@@ -873,6 +889,16 @@ uninstall-am:
.PRECIOUS: Makefile
dist-hook:
chmod -R u+w $(distdir)/tests
chmod u+w $(distdir)
mv $(distdir)/tests/unit $(distdir)/realunittest
mv $(distdir)/tests/tests $(distdir)/realtests
rm -rf $(distdir)/tests
mv $(distdir)/realtests $(distdir)/tests
rm -rf $(distdir)/tests/unit $(distdir)/tests/Makefile*
mv $(distdir)/realunittest $(distdir)/tests/unit
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

14
NEWS
View File

@@ -696,7 +696,7 @@ shadow-4.0.18 -> shadow-4.0.18.1 03-08-2006
shadow-4.0.17 -> shadow-4.0.18 01-08-2006
*** general:
- su: fixed set enviroment too early when using PAM, so move it to !USE_PAM
- su: fixed set environment too early when using PAM, so move it to !USE_PAM
(patch submitted by Mike Frysinger <vapier@gentoo.org>),
- groupadd, groupmod, useradd, usermod: fixed UID/GID overflow (fixed
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=198920)
@@ -855,7 +855,7 @@ shadow-4.0.14 -> shadow-4.0.15 13-03-2006
- su: move exit() outside libmisc/shell.c::shell() for handle shell() errors
on higher level (now is better visable where some programs exit with 126
and 127 exit codes); added new shell() parameter (char *const envp[])
which allow fix preserving enviroment in su on using -p, (patch by
which allow fix preserving environment in su on using -p, (patch by
Alexander Gattin <xrgtn@yandex.ru>),
- su: added handle -c,--command option for GNU su compliance (merge
437_su_-c_option Debian patch),
@@ -966,7 +966,7 @@ shadow-4.0.12 -> shadow-4.0.13 10-10-2005
to example described in ident(1) man page (modern compilers like latest GCC
removes not used functions by global optimization).
So "ident /usr/bin/passwd" will show again some useable informations
- su: fixed twice copy enviroment which causes auth problems
- su: fixed twice copy environment which causes auth problems
(bug was introduced in 4.0.12; fix by Nicolas François <nicolas.francois@centraliens.net>),
- chage: differentiate the different failure causes by the exit value
This will permit to adduser Debian script to detect if chage failed because the
@@ -1133,7 +1133,7 @@ shadow-4.0.9 -> shadow-4.0.10 28-06-2005
http://bugs.debian.org/53702
- login: check for hushed login and pass PAM_SILENT if true,
http://bugs.debian.org/48002
- login: fixed username on succesful login (was using the normal username,
- login: fixed username on successful login (was using the normal username,
when it should have used pam_user) http://bugs.debian.org/47819
- remove using SHADOWPWD #define so now shadow is always built with shadow
password support,
@@ -1212,7 +1212,7 @@ shadow-4.0.7 -> shadow-4.0.8 26-04-2005
(without gshadow) doesn't permit to use newgrp,
- newgrp(1): newgrp uses /bin/sh (not bash),
- faillog(8): updated after rewritten faillog command for use getopt_long(),
- login(1): removed fragment about abilities pass enviroment variables in login prompt,
- login(1): removed fragment about abilities pass environment variables in login prompt,
- gshadow(5): new file (by Nicolas Nicolas François <nicolas.francois@centraliens.net>),
- usermod(8): fixed #302388 Debian bug: added separated -o option description,
@@ -1242,7 +1242,7 @@ shadow-4.0.6 -> shadow-4.0.7 26-01-2005
shadow-4.0.5 -> shadow-4.0.6 08-11-2004
- su: fixed adding of pam_env env variables to enviroment
- su: fixed adding of pam_env env variables to environment
(Martin Schlemmer <azarah@nosferatu.za.org>),
- autoconf: fixed filling MAIL_SPOOL_DIR and MAIL_SPOOL_FILE variables
which was always empty (Gregorio Guidi <g.guidi@sns.it>),
@@ -1275,7 +1275,7 @@ shadow-4.0.4.1 -> shadow-4.0.5 27-10-2004
including symlinks placed into /etc/skel/public_html for example.
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=66819
- su: add pam_open_session() support. If built without PAM support
propagate $DISPLAY and $XAUTHORITY enviroment variables.
propagate $DISPLAY and $XAUTHORITY environment variables.
Based on http://www.gentoo.org/cgi-bin/viewcvs.cgi/sys-apps/shadow/files/shadow-4.0.4.1-su-pam_open_session.patch?rev=1.1
- applied 036_pam_access_with_preauth.patch Debian patch submited by Bjorn
Torkelsson <Bjorn.Torkelsson@hpc2n.umu.se>: add support for PAM account

11
README
View File

@@ -17,6 +17,12 @@ are used for managing group accounts.
* [Issue tracker](https://github.com/shadow-maint/shadow/issues)
* [Releases](https://github.com/shadow-maint/shadow/releases)
## Code
The main development branch is at [https://github.com/shadow-maint/shadow.git](https://github.com/shadow-maint/shadow)
See [STABLE.md](https://github.com/shadow-maint/shadow/blob/master/STABLE.md) for a list of supported stable branches.
## Contacts
There are several ways to contact us:
* [the general discussion mailing list](
@@ -31,6 +37,11 @@ There are several ways to contact us:
https://alioth-lists-archive.debian.net/pipermail/pkg-shadow-commits/),
only used for historical purposes
## Contributions
Contributions are welcome. Follow the
[guidelines](doc/contributions/introduction.md) before posting any patches.
## Authors and maintainers
Authors and maintainers are listed in [AUTHORS.md](
https://github.com/shadow-maint/shadow/blob/master/AUTHORS.md).

127
TODO
View File

@@ -1,127 +0,0 @@
* Create a common usage function that'd take the array of
long options and an array of descriptions and output that so things would
be standardized across the utils.
Usage strings should be normalized and split first.
Investigate optparse.
/etc/default/useradd
* GROUP=1000 should accept a group name.
Check when RLOGIN is enabled if ruserok() exists
Move selinux_file_context out of libmisc/copydir.c
Review hardcoded root account?
review all call to strto
libmisc/cleanup_user.c
cleanup needed (cleanup_report_add_user* not used)
libxcrypt support
* http://wiki.linuxfromscratch.org/patches/browser/trunk/shadow/shadow-4.0.18.1-owl_blowfish-1.patch
implement getlong, getulong.
avoid atoi, atol, atoul, strtol, strtoul, ...
manpages: comment the RLOGIN parts
Replace build_list (in lib/gshadow.c) and list (in lib/sgetgrent.c) by
comma_to_list()
Revert the modified files if all files could not be changed.
* or warn and indicate which files were modified and which were not.
* check the order the files are modified.
report nscd_flush_cache failures?
call nscd from the programs or from lib (commonio?)
PAM: check if a non-interactive conversation function could be used to set
the password in chpasswd and newusers
WITH_SELINUX
- review all tools to check that the strategies are consistent
chage, chfn, chsh: same change needed as in passwd.
- probably need moving check_selinux_access to a separate file.
testsuite
- newgrp
- test with unknown user's GID
newusers
- add logging to SYSLOG & AUDIT
- use CREATE_HOME
- Add a -Z option (see useradd / usermod)
Document when/where option appeared, document whether an option is standard
or not.
Check all the expiry semantics
ALL:
- move base passwd/shadow/group/gshadow operation to module for allow write
different backend modules for db, NIS, LDAP and others. Default backend it
will be goot if will be chosen depending on /etc/nsswitch.conf and allow
override this by -r <repository> options (where the <repository> can be
file, db, nis nisplus, ldap .. like on /etc/nsswitch.conf in service column).
passwd have old piece of code with handling -r option and it will be good
finish this and propagate on other shadow tools for allow operate on other
user databases by well known tools.
- Protect against signals. Register do_cleanups in a signal handler.
- login.defs
- generate depending on configuration
- useradd:
- add handle create user mail spool in maildir format.
- Add support for -k in -D mode
- Add support for -K in -D mode
- Add option to create or not the mail spool (and set the default in -D
mode)
- Change -l to reset the entry if an entry was already there
- set the mask in mkdir?
- userdel:
- add backup option for the removal of user resources,
- user_busy: check that the user is not running any processes.
- missing "deleting group" FAILED
- home dir removed, but userdel may fail and may leave the user
=> warning needed
- usermod
- add an option equivalent to useradd's -l (only when uid is changed)
- the mode of new home directories should be set according to the
original mode. Does copy_tree does this?
- user renamed, order is not kept in /etc/group (see
47_usermod-l_no_shadow_file). This is a problem when the first user is
considered as the admin.
- see mail "user ID change" on April, 15
+ fix call to chown (combination of -m and -u/-g)
+ add tests
- passwd:
- check combination of options (e.g. -u/-l)
- when -u refuse to unlock because it would create an empty password, it
should not display "Password changed."
exit instead?
- newgrp: check the USE_PAM section.
- pwck
- Add check to move passwd passwords to shadow if there is a shadow
entry (with a password).
- Add check to move passwd passwords to shadow if there is a shadow
file.
- Support an alternative /etc/tcb directory as second parameter.
- add options -g / -G to specify alternative group / gshadow files
- su
- add a login.defs configuration parameter to add variables to keep in
the environment with "su -l" (TERM/TERMCOLOR/...)
- vipw
- set ACLs and XATTRs on the temporary file (and backups?)
- vipw + selinux -> use lib/selinux.c

1254
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,12 @@
authenticate the callers */
#undef ACCT_TOOLS_SETUID
/* Define to support lastlog. */
#undef ENABLE_LASTLOG
/* Define to manage session support with logind. */
#undef ENABLE_LOGIND
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
@@ -54,6 +60,10 @@
*/
#undef HAVE_DCGETTEXT
/* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if
you don't. */
#undef HAVE_DECL_CYGWIN_CONV_PATH
/* Define to 1 if you have the declaration of `PAM_DATA_SILENT', and to 0 if
you don't. */
#undef HAVE_DECL_PAM_DATA_SILENT
@@ -70,26 +80,23 @@
if you don't. */
#undef HAVE_DECL_PAM_NEW_AUTHTOK_REQD
/* Define if you have the GNU dld library. */
#undef HAVE_DLD
/* Define to 1 if you have the `dlerror' function. */
#undef HAVE_DLERROR
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* Define if you have the _dyld_func_lookup function. */
#undef HAVE_DYLD
/* Define to 1 if you have the `explicit_bzero' function. */
#undef HAVE_EXPLICIT_BZERO
/* Define to 1 if you have the `fchmod' function. */
#undef HAVE_FCHMOD
/* Define to 1 if you have the `fchown' function. */
#undef HAVE_FCHOWN
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `fsync' function. */
#undef HAVE_FSYNC
/* Defined to 1 if you have the declaration of 'fgetpwent_r' */
#undef HAVE_FGETPWENT_R
/* Define to 1 if you have the `futimes' function. */
#undef HAVE_FUTIMES
@@ -97,18 +104,6 @@
/* Define to 1 if you have the `getentropy' function. */
#undef HAVE_GETENTROPY
/* Define to 1 if you have the `getgrgid_r' function. */
#undef HAVE_GETGRGID_R
/* Define to 1 if you have the `getgrnam_r' function. */
#undef HAVE_GETGRNAM_R
/* Define to 1 if you have the `getpwnam_r' function. */
#undef HAVE_GETPWNAM_R
/* Define to 1 if you have the `getpwuid_r' function. */
#undef HAVE_GETPWUID_R
/* Define to 1 if you have the `getrandom' function. */
#undef HAVE_GETRANDOM
@@ -124,9 +119,6 @@
/* Define to 1 if you have the `getusershell' function. */
#undef HAVE_GETUSERSHELL
/* Define to 1 if you have the `getutent' function. */
#undef HAVE_GETUTENT
/* Define to 1 if you have the <gshadow.h> header file. */
#undef HAVE_GSHADOW_H
@@ -142,26 +134,17 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `l64a' function. */
#undef HAVE_L64A
/* 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
/* Defined if you have libcrack. */
#undef HAVE_LIBCRACK
/* Define if you have the libdl library or equivalent. */
#undef HAVE_LIBDL
/* Defined if you have the ts&szs cracklib. */
#undef HAVE_LIBCRACK_HIST
/* Defined if it includes *Pw functions. */
#undef HAVE_LIBCRACK_PW
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if libdlloader will be built on this platform */
#undef HAVE_LIBDLLOADER
/* Define to 1 if you have the <linux/btrfs_tree.h> header file. */
#undef HAVE_LINUX_BTRFS_TREE_H
@@ -172,24 +155,15 @@
/* Define if struct lastlog has ll_host */
#undef HAVE_LL_HOST
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define to 1 if you have the `lutimes' function. */
#undef HAVE_LUTIMES
/* Define to 1 if you have the `memset_s' function. */
#undef HAVE_MEMSET_S
/* Define to 1 if you have the `memset_explicit' function. */
#undef HAVE_MEMSET_EXPLICIT
/* Define to 1 if you have the <minix/config.h> header file. */
#undef HAVE_MINIX_CONFIG_H
/* Define to 1 if you have the `mkdir' function. */
#undef HAVE_MKDIR
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <paths.h> header file. */
#undef HAVE_PATHS_H
@@ -202,15 +176,15 @@
/* Define to 1 if you have the `putspent' function. */
#undef HAVE_PUTSPENT
/* Define to 1 if you have the `rename' function. */
#undef HAVE_RENAME
/* Define to 1 if you have the `rmdir' function. */
#undef HAVE_RMDIR
/* 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
/* Define to 1 if you have the <security/openpam.h> header file. */
#undef HAVE_SECURITY_OPENPAM_H
@@ -241,11 +215,8 @@
/* Have working shadow group support in libc */
#undef HAVE_SHADOWGRP
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if stdbool.h conforms to C99. */
#undef HAVE_STDBOOL_H
/* Define if you have the shl_load function. */
#undef HAVE_SHL_LOAD
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -256,14 +227,11 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `stpecpy' function. */
#undef HAVE_STPECPY
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the `stpeprintf' function. */
#undef HAVE_STPEPRINTF
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
@@ -271,21 +239,6 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define to 1 if `st_atim' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_ATIM
/* Define to 1 if `st_atimensec' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_ATIMENSEC
/* Define to 1 if `st_mtim' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_MTIM
/* Define to 1 if `st_mtimensec' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_MTIMENSEC
/* Define to 1 if `ut_addr' is a member of `struct utmpx'. */
#undef HAVE_STRUCT_UTMPX_UT_ADDR
@@ -307,42 +260,6 @@
/* Define to 1 if `ut_xtime' is a member of `struct utmpx'. */
#undef HAVE_STRUCT_UTMPX_UT_XTIME
/* Define to 1 if `ut_addr' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_ADDR
/* Define to 1 if `ut_addr_v6' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_ADDR_V6
/* Define to 1 if `ut_host' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_HOST
/* Define to 1 if `ut_id' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_ID
/* Define to 1 if `ut_name' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_NAME
/* Define to 1 if `ut_syslen' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_SYSLEN
/* Define to 1 if `ut_time' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_TIME
/* Define to 1 if `ut_tv' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_TV
/* Define to 1 if `ut_type' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_TYPE
/* Define to 1 if `ut_user' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_USER
/* Define to 1 if `ut_xtime' is a member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_XTIME
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define to 1 if you have the <sys/capability.h> header file. */
#undef HAVE_SYS_CAPABILITY_H
@@ -352,39 +269,24 @@
/* 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/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
/* Define to 1 if you have the <sys/statfs.h> header file. */
#undef HAVE_SYS_STATFS_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <tcb.h> header file. */
#undef HAVE_TCB_H
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define to 1 if you have the <termio.h> header file. */
#undef HAVE_TERMIO_H
/* Define to 1 if you have the <ulimit.h> header file. */
#undef HAVE_ULIMIT_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `updwtmp' function. */
#undef HAVE_UPDWTMP
/* Define to 1 if you have the `updwtmpx' function. */
#undef HAVE_UPDWTMPX
@@ -394,18 +296,15 @@
/* 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 <utmpx.h> header file. */
#undef HAVE_UTMPX_H
/* Define to 1 if you have the <utmp.h> header file. */
#undef HAVE_UTMP_H
/* Define to support vendor settings. */
#undef HAVE_VENDORDIR
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
/* Path for lastlog file. */
#undef LASTLOG_FILE
@@ -442,12 +341,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
@@ -477,9 +370,6 @@
/* Define to support /etc/suauth su access control. */
#undef SU_ACCESS
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Define to allow the bcrypt password encryption algorithm */
#undef USE_BCRYPT
@@ -495,9 +385,6 @@
/* Define to support flushing of sssd caches */
#undef USE_SSSD
/* Define to use syslog(). */
#undef USE_SYSLOG
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
@@ -586,12 +473,12 @@
#endif
/* Define if utmpx should be used */
#undef USE_UTMPX
/* Define to allow the yescrypt password encryption algorithm */
#undef USE_YESCRYPT
/* Directory for distribution provided configuration files */
#undef VENDORDIR
/* Version number of package */
#undef VERSION
@@ -607,6 +494,9 @@
/* Build shadow with BtrFS support */
#undef WITH_BTRFS
/* Build shadow without libbsd support */
#undef WITH_LIBBSD
/* Build shadow with SELinux support */
#undef WITH_SELINUX

2222
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,12 @@
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.13], [pkg-shadow-devel@lists.alioth.debian.org], [],
AC_INIT([shadow], [4.17.2], [pkg-shadow-devel@lists.alioth.debian.org], [],
[https://github.com/shadow-maint/shadow])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz subdir-objects tar-pax])
AC_CONFIG_MACRO_DIRS([m4])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h])
@@ -32,47 +32,30 @@ AC_PROG_CC
AC_PROG_LN_S
AC_PROG_YACC
LT_INIT
LT_LIB_DLLOAD
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDBOOL
AC_CHECK_HEADERS(crypt.h errno.h fcntl.h limits.h unistd.h sys/time.h utmp.h \
utmpx.h termios.h termio.h sgtty.h sys/ioctl.h syslog.h paths.h \
utime.h ulimit.h sys/capability.h sys/random.h sys/resource.h \
gshadow.h lastlog.h locale.h rpc/key_prot.h netdb.h acl/libacl.h \
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 l64a fchmod fchown fsync futimes \
AC_CHECK_FUNCS(arc4random_buf futimes \
getentropy getrandom getspnam getusershell \
getutent initgroups lckpwdf lutimes \
setgroups updwtmp updwtmpx innetgr getpwnam_r \
getpwuid_r getgrnam_r getgrgid_r getspnam_r \
memset_s explicit_bzero)
initgroups lckpwdf lutimes \
setgroups updwtmpx innetgr \
getspnam_r \
rpmatch \
memset_explicit explicit_bzero stpecpy stpeprintf)
AC_SYS_LARGEFILE
dnl Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_MEMBERS([struct stat.st_atim])
AC_CHECK_MEMBERS([struct stat.st_atimensec])
AC_CHECK_MEMBERS([struct stat.st_mtim])
AC_CHECK_MEMBERS([struct stat.st_mtimensec])
AC_STRUCT_TM
AC_CHECK_MEMBERS([struct utmp.ut_type,
struct utmp.ut_id,
struct utmp.ut_name,
struct utmp.ut_user,
struct utmp.ut_host,
struct utmp.ut_syslen,
struct utmp.ut_addr,
struct utmp.ut_addr_v6,
struct utmp.ut_time,
struct utmp.ut_xtime,
struct utmp.ut_tv],,,[[#include <utmp.h>]])
AC_CHECK_MEMBERS([struct utmpx.ut_name,
struct utmpx.ut_host,
@@ -82,29 +65,11 @@ AC_CHECK_MEMBERS([struct utmpx.ut_name,
struct utmpx.ut_time,
struct utmpx.ut_xtime],,,[[#include <utmpx.h>]])
if test "$ac_cv_header_lastlog_h" = "yes"; then
AC_CACHE_CHECK(for ll_host in struct lastlog,
ac_cv_struct_lastlog_ll_host,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <lastlog.h>],
[struct lastlog ll; char *cp = ll.ll_host;]
)],
[ac_cv_struct_lastlog_ll_host=yes],
[ac_cv_struct_lastlog_ll_host=no]
)
)
if test "$ac_cv_struct_lastlog_ll_host" = "yes"; then
AC_DEFINE(HAVE_LL_HOST, 1,
[Define if struct lastlog has ll_host])
fi
fi
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_FUNC_UTIME_NULL
AC_REPLACE_FUNCS(mkdir putgrent putpwent putspent rename rmdir)
AC_REPLACE_FUNCS(putgrent putpwent putspent)
AC_REPLACE_FUNCS(sgetgrent sgetpwent sgetspent)
AC_REPLACE_FUNCS(snprintf strcasecmp strdup strerror strstr)
AC_CHECK_FUNC(setpgrp)
AC_CHECK_FUNC(secure_getenv, [AC_DEFINE(HAS_SECURE_GETENV,
@@ -116,6 +81,10 @@ if test "$ac_cv_header_shadow_h" = "yes"; then
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::");
@@ -190,13 +159,6 @@ fi])
AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$shadow_cv_passwd_dir/passwd",
[Path to passwd program.])
dnl XXX - quick hack, should disappear before anyone notices :).
AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog().])
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
@@ -226,17 +188,6 @@ AC_ARG_ENABLE(account-tools-setuid,
[enable_acct_tools_setuid="no"]
)
AC_ARG_ENABLE(utmpx,
[AS_HELP_STRING([--enable-utmpx],
[enable loggin in utmpx / wtmpx @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_utmpx="yes" ;;
no) enable_utmpx="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-utmpx) ;;
esac],
[enable_utmpx="no"]
)
AC_ARG_ENABLE(subordinate-ids,
[AS_HELP_STRING([--enable-subordinate-ids],
[support subordinate ids @<:@default=yes@:>@])],
@@ -244,6 +195,20 @@ AC_ARG_ENABLE(subordinate-ids,
[enable_subids="maybe"]
)
AC_ARG_ENABLE(lastlog,
[AS_HELP_STRING([--enable-lastlog],
[enable lastlog @<:@default=no@:>@])],
[enable_lastlog="${enableval}"],
[enable_lastlog="no"]
)
AC_ARG_ENABLE(logind,
[AS_HELP_STRING([--enable-logind],
[enable logind @<:@default=yes@:>@])],
[enable_logind="${enableval}"],
[enable_logind="yes"]
)
AC_ARG_WITH(audit,
[AS_HELP_STRING([--with-audit], [use auditing support @<:@default=yes if found@:>@])],
[with_audit=$withval], [with_audit=maybe])
@@ -268,9 +233,6 @@ AC_ARG_WITH(skey,
AC_ARG_WITH(tcb,
[AS_HELP_STRING([--with-tcb], [use tcb support (incomplete) @<:@default=yes if found@:>@])],
[with_tcb=$withval], [with_tcb=maybe])
AC_ARG_WITH(libcrack,
[AS_HELP_STRING([--with-libcrack], [use libcrack @<:@default=no@:>@])],
[with_libcrack=$withval], [with_libcrack=no])
AC_ARG_WITH(sha-crypt,
[AS_HELP_STRING([--with-sha-crypt], [allow the SHA256 and SHA512 password encryption algorithms @<:@default=yes@:>@])],
[with_sha_crypt=$withval], [with_sha_crypt=yes])
@@ -292,6 +254,9 @@ AC_ARG_WITH(group-name-max-length,
AC_ARG_WITH(su,
[AS_HELP_STRING([--with-su], [build and install su program and man page @<:@default=yes@:>@])],
[with_su=$withval], [with_su=yes])
AC_ARG_WITH(libbsd,
[AS_HELP_STRING([--with-libbsd], [use libbsd support @<:@default=yes if found@:>@])],
[with_libbsd=$withval], [with_libbsd=yes])
if test "$with_group_name_max_length" = "no" ; then
with_group_name_max_length=0
@@ -302,6 +267,7 @@ AC_DEFINE_UNQUOTED(GROUP_NAME_MAX_LENGTH, $with_group_name_max_length, [max grou
AC_SUBST(GROUP_NAME_MAX_LENGTH)
GROUP_NAME_MAX_LENGTH="$with_group_name_max_length"
AM_CONDITIONAL(USE_SHA_CRYPT, test "x$with_sha_crypt" = "xyes")
if test "$with_sha_crypt" = "yes"; then
AC_DEFINE(USE_SHA_CRYPT, 1, [Define to allow the SHA256 and SHA512 password encryption algorithms])
@@ -336,12 +302,16 @@ dnl Check for some functions in libc first, only if not found check for
dnl other libraries. This should prevent linking libnsl if not really
dnl needed (Linux glibc, Irix), but still link it if needed (Solaris).
AC_SEARCH_LIBS(inet_ntoa, inet)
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyname, nsl)
PKG_CHECK_MODULES([CMOCKA], [cmocka], [have_cmocka="yes"],
[AC_MSG_WARN([libcmocka not found, cmocka tests will not be built])])
AM_CONDITIONAL([HAVE_CMOCKA], [test x$have_cmocka = xyes])
AC_CHECK_LIB([econf],[econf_readDirs],[LIBECONF="-leconf"],[LIBECONF=""])
if test -n "$LIBECONF"; then
AC_DEFINE_UNQUOTED([VENDORDIR], ["$enable_vendordir"],
[Directory for distribution provided configuration files])
ECONF_CPPFLAGS="-DUSE_ECONF=1"
AC_ARG_ENABLE([vendordir],
AS_HELP_STRING([--enable-vendordir=DIR], [Directory for distribution provided configuration files]),,[])
@@ -349,6 +319,9 @@ fi
AC_SUBST(ECONF_CPPFLAGS)
AC_SUBST(LIBECONF)
AC_SUBST([VENDORDIR], [$enable_vendordir])
if test "x$enable_vendordir" != x; then
AC_DEFINE(HAVE_VENDORDIR, 1, [Define to support vendor settings.])
fi
AM_CONDITIONAL([HAVE_VENDORDIR], [test "x$enable_vendordir" != x])
if test "$enable_shadowgrp" = "yes"; then
@@ -393,6 +366,39 @@ if test "$enable_subids" != "no"; then
fi
AM_CONDITIONAL(ENABLE_SUBIDS, test "x$enable_subids" != "xno")
if test "$enable_lastlog" = "yes" && test "$ac_cv_header_lastlog_h" = "yes"; then
AC_CACHE_CHECK(for ll_host in struct lastlog,
ac_cv_struct_lastlog_ll_host,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <lastlog.h>],
[struct lastlog ll; char *cp = ll.ll_host;]
)],
[ac_cv_struct_lastlog_ll_host=yes],
[ac_cv_struct_lastlog_ll_host=no]
)
)
if test "$ac_cv_struct_lastlog_ll_host" = "yes"; then
AC_DEFINE(HAVE_LL_HOST, 1,
[Define if struct lastlog has ll_host])
AC_DEFINE(ENABLE_LASTLOG, 1, [Define to support lastlog.])
enable_lastlog="yes"
else
AC_MSG_ERROR([Cannot enable support for lastlog on systems where the data structures aren't available])
enable_subids="no"
fi
fi
AM_CONDITIONAL(ENABLE_LASTLOG, test "x$enable_lastlog" != "xno")
AC_SUBST(LIBSYSTEMD)
if test "$enable_logind" = "yes"; then
AC_CHECK_LIB(systemd, sd_session_get_remote_host,
[enable_logind="yes"; [LIBSYSTEMD=-lsystemd];
AC_DEFINE(ENABLE_LOGIND, 1,
[Define to manage session support with logind.])],
[enable_logind="no"])
fi
AM_CONDITIONAL(ENABLE_LOGIND, test "x$enable_logind" != "xno")
AC_SUBST(LIBCRYPT)
AC_CHECK_LIB(crypt, crypt, [LIBCRYPT=-lcrypt],
[AC_MSG_ERROR([crypt() not found])])
@@ -401,6 +407,28 @@ AC_SUBST(LIYESCRYPT)
AC_CHECK_LIB(crypt, crypt, [LIYESCRYPT=-lcrypt],
[AC_MSG_ERROR([crypt() not found])])
AC_SUBST(LIBBSD)
if test "$with_libbsd" != "no"; then
AC_SEARCH_LIBS([readpassphrase], [bsd], [], [
AC_MSG_ERROR([readpassphrase() is missing, either from libc or libbsd])
])
AS_IF([test "$ac_cv_search_readpassphrase" = "-lbsd"], [
PKG_CHECK_MODULES([LIBBSD], [libbsd-overlay])
])
dnl Make sure either the libc or libbsd provide the header.
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $LIBBSD_CFLAGS"
AC_CHECK_HEADERS([readpassphrase.h])
AS_IF([test "$ac_cv_header_readpassphrase_h" != "yes"], [
AC_MSG_ERROR([readpassphrase.h is missing])
])
CFLAGS="$save_CFLAGS"
AC_DEFINE(WITH_LIBBSD, 1, [Build shadow with libbsd support])
else
AC_DEFINE(WITH_LIBBSD, 0, [Build shadow without libbsd support])
fi
AM_CONDITIONAL(WITH_LIBBSD, test x$with_libbsd = xyes)
AC_SUBST(LIBACL)
if test "$with_acl" != "no"; then
AC_CHECK_HEADERS(acl/libacl.h attr/error_context.h, [acl_header="yes"], [acl_header="no"])
@@ -485,17 +513,6 @@ if test "$with_audit" != "no"; then
fi
fi
AC_SUBST(LIBCRACK)
if test "$with_libcrack" = "yes"; then
echo "checking cracklib flavour, don't be surprised by the results"
AC_CHECK_LIB(crack, FascistCheck,
[LIBCRACK=-lcrack AC_DEFINE(HAVE_LIBCRACK, 1, [Defined if you have libcrack.])])
AC_CHECK_LIB(crack, FascistHistory,
AC_DEFINE(HAVE_LIBCRACK_HIST, 1, [Defined if you have the ts&szs cracklib.]))
AC_CHECK_LIB(crack, FascistHistoryPw,
AC_DEFINE(HAVE_LIBCRACK_PW, 1, [Defined if it includes *Pw functions.]))
fi
if test "$with_btrfs" != "no"; then
AC_CHECK_HEADERS([sys/statfs.h linux/magic.h linux/btrfs_tree.h], \
[btrfs_headers="yes"], [btrfs_headers="no"])
@@ -672,7 +689,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>
@@ -682,14 +699,7 @@ if test "$with_skey" = "yes"; then
]])],[AC_DEFINE(SKEY_BSD_STYLE, 1, [Define to support newer BSD S/Key API])],[])
fi
if test "$enable_utmpx" = "yes"; then
if test "$ac_cv_header_utmpx_h" != "yes"; then
AC_MSG_ERROR([The utmpx.h header file is required for utmpx support.])
fi
AC_DEFINE(USE_UTMPX,
1,
[Define if utmpx should be used])
fi
AC_CHECK_FUNC(fgetpwent_r, [AC_DEFINE(HAVE_FGETPWENT_R, 1, [Defined to 1 if you have the declaration of 'fgetpwent_r'])])
AC_DEFINE_UNQUOTED(SHELL, ["$SHELL"], [The default shell.])
@@ -723,7 +733,6 @@ AC_CONFIG_FILES([
man/uk/Makefile
man/zh_CN/Makefile
man/zh_TW/Makefile
libmisc/Makefile
lib/Makefile
libsubid/Makefile
libsubid/subid.h
@@ -731,7 +740,8 @@ AC_CONFIG_FILES([
contrib/Makefile
etc/Makefile
etc/pam.d/Makefile
shadow.spec
etc/shadow-maint/Makefile
tests/unit/Makefile
])
AC_OUTPUT
@@ -739,7 +749,6 @@ echo
echo "shadow will be compiled with the following features:"
echo
echo " auditing support: $with_audit"
echo " CrackLib support: $with_libcrack"
echo " PAM support: $with_libpam"
if test "$with_libpam" = "yes"; then
echo " suid account management tools: $enable_acct_tools_setuid"
@@ -757,6 +766,9 @@ echo " yescrypt passwords encryption: $with_yescrypt"
echo " nscd support: $with_nscd"
echo " sssd support: $with_sssd"
echo " subordinate IDs support: $enable_subids"
echo " enable lastlog: $enable_lastlog"
echo " enable logind: $enable_logind"
echo " use file caps: $with_fcaps"
echo " install su: $with_su"
echo " enabled vendor dir: $enable_vendordir"
echo

View File

@@ -1,6 +1,4 @@
# This is a dummy Makefile.am to get automake work flawlessly,
# and also cooperate to make a distribution for `make dist'
EXTRA_DIST = README adduser.c adduser.sh adduser2.sh \
atudel groupmems.shar pwdauth.c shadow-anonftp.patch \
udbachk.tgz
EXTRA_DIST = README adduser.c adduser.sh adduser2.sh

View File

@@ -141,6 +141,8 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
@@ -174,9 +176,15 @@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBACL = @LIBACL@
LIBADD_DL = @LIBADD_DL@
LIBADD_DLD_LINK = @LIBADD_DLD_LINK@
LIBADD_DLOPEN = @LIBADD_DLOPEN@
LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
LIBATTR = @LIBATTR@
LIBAUDIT = @LIBAUDIT@
LIBCRACK = @LIBCRACK@
LIBBSD = @LIBBSD@
LIBBSD_CFLAGS = @LIBBSD_CFLAGS@
LIBBSD_LIBS = @LIBBSD_LIBS@
LIBCRYPT = @LIBCRYPT@
LIBECONF = @LIBECONF@
LIBICONV = @LIBICONV@
@@ -192,6 +200,7 @@ LIBSUBID_ABI = @LIBSUBID_ABI@
LIBSUBID_ABI_MAJOR = @LIBSUBID_ABI_MAJOR@
LIBSUBID_ABI_MICRO = @LIBSUBID_ABI_MICRO@
LIBSUBID_ABI_MINOR = @LIBSUBID_ABI_MINOR@
LIBSYSTEMD = @LIBSYSTEMD@
LIBTCB = @LIBTCB@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
@@ -200,6 +209,8 @@ LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_DLLOADERS = @LT_DLLOADERS@
LT_DLPREOPEN = @LT_DLPREOPEN@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
@@ -222,6 +233,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
RANLIB = @RANLIB@
SED = @SED@
@@ -293,10 +307,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = README adduser.c adduser.sh adduser2.sh \
atudel groupmems.shar pwdauth.c shadow-anonftp.patch \
udbachk.tgz
EXTRA_DIST = README adduser.c adduser.sh adduser2.sh
all: all-am
.SUFFIXES:

View File

@@ -2,9 +2,6 @@ People keep sending various adduser programs and scripts... They are
all in this directory. I haven't tested them, use at your own risk.
Anyway, the best one I've seen so far is adduser-3.x from Debian.
atudel is a perl script to remove at jobs owned by the specified user
(atrm in at-2.9 for Linux can't do that).
udbachk.tgz is a passwd/group/shadow file integrity checker.
--marekm

View File

@@ -60,7 +60,7 @@
** Added in the password date field, which should always reflect the last
** date the password was changed, for expiry purposes. "passwd" always
** updates this field, so the adduser program should set it up right
** initially (or a user could keep thier initial password forever ;)
** initially (or a user could keep their initial password forever ;)
** The number is in days since Jan 1st, 1970.
**
** Have fun with it, and someone please make
@@ -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);
}
}
}
@@ -489,14 +490,14 @@ safeget (char *buf, int maxlen)
while ((c = getc (stdin)) != EOF && (c != '\n') && (++i < maxlen))
{
bad = (!isalnum (c) && (c != '_') && (c != ' '));
*(buf++) = (char) c;
*(buf++) = c;
}
*buf = '\0';
stpcpy(buf, "");
if (bad)
{
printf ("\nString contained banned character. Please stick to alphanumerics.\n");
*bstart = '\0';
stpcpy(bstart, "");
}
}

View File

@@ -1,465 +0,0 @@
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2000-05-25 14:41 CDT by <gk4@gnu.austin.ibm.com>.
# Source directory was `/home/gk4/src/groupmem'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 1960 -rw-r--r-- Makefile
# 6348 -rw-r--r-- groupmems.c
# 3372 -rw------- groupmems.8
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
if test "$gettext_dir" = FAILED && test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
set `$dir/gettext --version 2>&1`
if test "$3" = GNU
then
gettext_dir=$dir
fi
fi
if test "$locale_dir" = FAILED && test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
echo=echo
else
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
shar_touch='touch -am $3$4$5$6$2 "$8"'
else
shar_touch=:
echo
$echo 'WARNING: not restoring timestamps. Consider getting and'
$echo "installing GNU \`touch', distributed in GNU File Utilities..."
echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh10937; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
exit 1
fi
# ============= Makefile ==============
if test -f 'Makefile' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'Makefile' '(file already exists)'
else
$echo 'x -' extracting 'Makefile' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
/*
# SPDX-FileCopyrightText: 2000, International Business Machines, Inc.
# SPDX-FileCopyrightText: 2000, George Kraft IV, gk4@us.ibm.com
# SPDX-License-Identifier: BSD-3-Clause
#
X
all: groupmems
X
groupmems: groupmems.c
X cc -g -o groupmems groupmems.c -L. -lshadow
X
install: groupmems
X -/usr/sbin/groupadd groups
X install -o root -g groups -m 4770 groupmems /usr/bin
X
install.man: groupmems.8
X install -o root -g root -m 644 groupmems.8 /usr/man/man8
X
SHAR_EOF
(set 20 00 05 25 14 40 28 'Makefile'; eval "$shar_touch") &&
chmod 0644 'Makefile' ||
$echo 'restore of' 'Makefile' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'Makefile:' 'MD5 check failed'
b46cf7ef8d59149093c011ced3f3103c Makefile
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Makefile'`"
test 1960 -eq "$shar_count" ||
$echo 'Makefile:' 'original size' '1960,' 'current size' "$shar_count!"
fi
fi
# ============= groupmems.c ==============
if test -f 'groupmems.c' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'groupmems.c' '(file already exists)'
else
$echo 'x -' extracting 'groupmems.c' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'groupmems.c' &&
/*
X * SPDX-FileCopyrightText: 2000, International Business Machines, Inc.
X * SPDX-FileCopyrightText: 2000, George Kraft IV, gk4@us.ibm.com
X * SPDX-License-Identifier: BSD-3-Clause
X */
/*
**
** Utility "groupmem" adds and deletes members from a user's group.
**
** Setup (as "root"):
**
** groupadd -r groups
** chmod 2770 groupmems
** chown root.groups groupmems
** groupmems -g groups -a gk4
**
** Usage (as "gk4"):
**
** groupmems -a olive
** groupmems -a jordan
** groupmems -a meghan
** groupmems -a morgan
** groupmems -a jake
** groupmems -l
** groupmems -d jake
** groupmems -l
*/
X
#include <stdio.h>
#include <pwd.h>
#include <grp.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "defines.h"
#include "groupio.h"
X
/* Exit Status Values */
X
#define EXIT_SUCCESS 0 /* success */
#define EXIT_USAGE 1 /* invalid command syntax */
#define EXIT_GROUP_FILE 2 /* group file access problems */
#define EXIT_NOT_ROOT 3 /* not superuser */
#define EXIT_NOT_EROOT 4 /* not effective superuser */
#define EXIT_NOT_PRIMARY 5 /* not primary owner of group */
#define EXIT_NOT_MEMBER 6 /* member of group does not exist */
#define EXIT_MEMBER_EXISTS 7 /* member of group already exists */
X
#define TRUE 1
#define FALSE 0
X
/* Globals */
X
extern int optind;
extern char *optarg;
static char *adduser = NULL;
static char *deluser = NULL;
static char *thisgroup = NULL;
static int purge = FALSE;
static int list = FALSE;
static int exclusive = 0;
X
static int isroot(void) {
X return getuid() ? FALSE : TRUE;
}
X
static int isgroup(void) {
X gid_t g = getgid();
X struct group *grp = getgrgid(g);
X
X return TRUE;
}
X
static char *whoami(void) {
X struct group *grp = getgrgid(getgid());
X struct passwd *usr = getpwuid(getuid());
X
X if (0 == strcmp(usr->pw_name, grp->gr_name)) {
X return (char *)strdup(usr->pw_name);
X } else {
X return NULL;
X }
}
X
static void
addtogroup(char *user, char **members) {
X int i;
X char **pmembers;
X
X for (i = 0; NULL != members[i]; i++ ) {
X if (0 == strcmp(user, members[i])) {
X fprintf(stderr, "Member already exists\n");
X exit(EXIT_MEMBER_EXISTS);
X }
X }
X
X if (0 == i) {
X pmembers = (char **)calloc(2, sizeof(char *));
X } else {
X pmembers = (char **)realloc(members, sizeof(char *)*(i+1));
X }
X
X *members = *pmembers;
X members[i] = user;
X members[i+1] = NULL;
}
X
static void
rmfromgroup(char *user, char **members) {
X int i;
X int found = FALSE;
X
X i = 0;
X while (!found && NULL != members[i]) {
X if (0 == strcmp(user, members[i])) {
X found = TRUE;
X } else {
X i++;
X }
X }
X
X while (found && NULL != members[i]) {
X members[i] = members[++i];
X }
X
X if (!found) {
X fprintf(stderr, "Member to remove could not be found\n");
X exit(EXIT_NOT_MEMBER);
X }
}
X
static void
nomembers(char **members) {
X int i;
X
X for (i = 0; NULL != members[i]; i++ ) {
X members[i] = NULL;
X }
}
X
static void
members(char **members) {
X int i;
X
X for (i = 0; NULL != members[i]; i++ ) {
X printf("%s ", members[i]);
X
X if (NULL == members[i+1]) {
X printf("\n");
X } else {
X printf(" ");
X }
X }
}
X
static void usage(void) {
X fprintf(stderr, "usage: groupmems -a username | -d username | -D | -l [-g groupname]\n");
X exit(EXIT_USAGE);
}
X
main(int argc, char **argv) {
X int arg, i;
X char *name;
X struct group *grp;
X
X while ((arg = getopt(argc, argv, "a:d:g:Dl")) != EOF) {
X switch (arg) {
X case 'a':
X adduser = strdup(optarg);
X ++exclusive;
X break;
X case 'd':
X deluser = strdup(optarg);
X ++exclusive;
X break;
X case 'g':
X thisgroup = strdup(optarg);
X break;
X case 'D':
X purge = TRUE;
X ++exclusive;
X break;
X case 'l':
X list = TRUE;
X ++exclusive;
X break;
X default:
X usage();
X }
X }
X
X if (exclusive > 1 || optind < argc) {
X usage();
X }
X
X if (!isroot() && NULL != thisgroup) {
X fprintf(stderr, "Only root can add members to different groups\n");
X exit(EXIT_NOT_ROOT);
X } else if (isroot() && NULL != thisgroup) {
X name = thisgroup;
X } else if (!isgroup()) {
X fprintf(stderr, "Group access is required\n");
X exit(EXIT_NOT_EROOT);
X } else if (NULL == (name = whoami())) {
X fprintf(stderr, "Not primary owner of current group\n");
X exit(EXIT_NOT_PRIMARY);
X }
X
X if (!gr_lock()) {
X fprintf(stderr, "Unable to lock group file\n");
X exit(EXIT_GROUP_FILE);
X }
X
X if (!gr_open(O_RDWR)) {
X fprintf(stderr, "Unable to open group file\n");
X exit(EXIT_GROUP_FILE);
X }
X
X grp = (struct group *)gr_locate(name);
X
X if (NULL != adduser) {
X addtogroup(adduser, grp->gr_mem);
X gr_update(grp);
X } else if (NULL != deluser) {
X rmfromgroup(deluser, grp->gr_mem);
X gr_update(grp);
X } else if (purge) {
X nomembers(grp->gr_mem);
X gr_update(grp);
X } else if (list) {
X members(grp->gr_mem);
X }
X
X if (!gr_close()) {
X fprintf(stderr, "Cannot close group file\n");
X exit(EXIT_GROUP_FILE);
X }
X
X gr_unlock();
X
X exit(EXIT_SUCCESS);
}
X
/* EOF */
SHAR_EOF
(set 20 00 05 25 14 36 38 'groupmems.c'; eval "$shar_touch") &&
chmod 0644 'groupmems.c' ||
$echo 'restore of' 'groupmems.c' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'groupmems.c:' 'MD5 check failed'
f0dd68f8d762d89d24d3ce1f4141f981 groupmems.c
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'groupmems.c'`"
test 6348 -eq "$shar_count" ||
$echo 'groupmems.c:' 'original size' '6348,' 'current size' "$shar_count!"
fi
fi
# ============= groupmems.8 ==============
if test -f 'groupmems.8' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'groupmems.8' '(file already exists)'
else
$echo 'x -' extracting 'groupmems.8' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'groupmems.8' &&
X.\"
X.\" SPDX-FileCopyrightText: 2000, International Business Machines, Inc.
X.\" SPDX-FileCopyrightText: 2000, George Kraft IV, gk4@us.ibm.com
X.\" SPDX-License-Identifier: BSD-3-Clause
X.\"
X.\" $Id$
X.\"
X.TH GROUPMEMS 8
X.SH NAME
groupmems \- Administer members of a user's primary group
X.SH SYNOPSIS
X.B groupmems
\fB-a\fI user_name \fR |
\fB-d\fI user_name \fR |
\fB-l\fR |
\fB-D\fR |
[\fB-g\fI group_name \fR]
X.SH DESCRIPTION
The \fBgroupmems\fR utility allows a user to administer their own
group membership list without the requirement of superuser privileges.
The \fBgroupmems\fR utility is for systems that configure its users to
be in their own name sake primary group (i.e., guest / guest).
X.P
Only the superuser, as administrator, can use \fBgroupmems\fR to alter
the memberships of other groups.
X.IP "\fB-a \fIuser_name\fR"
Add a new user to the group membership list.
X.IP "\fB-d \fIuser_name\fR"
Delete a user from the group membership list.
X.IP "\fB-l\fR"
List the group membership list.
X.IP "\fB-D\fR"
Delete all users from the group membership list.
X.IP "\fB-g \fIgroup_name\fR"
The superuser can specify which group membership list to modify.
X.SH SETUP
The \fBgroupmems\fR executable should be in mode \fB2770\fR as user \fBroot\fR
and in group \fBgroups\fR. The system administrator can add users to
group groups to allow or disallow them using the \fBgroupmems\fR utility
to manager their own group membership list.
X.P
X $ groupadd -r groups
X.br
X $ chmod 2770 groupmems
X.br
X $ chown root.groups groupmems
X.br
X $ groupmems -g groups -a gk4
X.SH FILES
/etc/group
X.br
/etc/gshadow
X.SH SEE ALSO
X.BR chfn (1),
X.BR chsh (1),
X.BR useradd (8),
X.BR userdel (8),
X.BR usermod (8),
X.BR passwd (1),
X.BR groupadd (8),
X.BR groupdel (8)
X.SH AUTHOR
George Kraft IV (gk4@us.ibm.com)
X.\" EOF
SHAR_EOF
(set 20 00 05 25 14 38 23 'groupmems.8'; eval "$shar_touch") &&
chmod 0600 'groupmems.8' ||
$echo 'restore of' 'groupmems.8' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'groupmems.8:' 'MD5 check failed'
181e6cd3a3c9d3df320197fa2cde2b4a groupmems.8
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'groupmems.8'`"
test 3372 -eq "$shar_count" ||
$echo 'groupmems.8:' 'original size' '3372,' 'current size' "$shar_count!"
fi
fi
rm -fr _sh10937
exit 0

View File

@@ -1,308 +0,0 @@
/*
* pwdauth.c - program to verify a given username/password pair.
*
* Run it with username in argv[1] (may be omitted - default is the
* current user), and send it the password over a pipe on stdin.
* Exit status: 0 - correct password, 1 - wrong password, >1 - other
* errors. For use with shadow passwords, this program should be
* installed setuid root.
*
* This can be used, for example, by xlock - you don't have to install
* this large and complex (== possibly insecure) program setuid root,
* just modify it to run this simple program to do the authentication.
*
* Recent versions (xlockmore-3.9) are cleaner, and drop privileges as
* soon as possible after getting the user's encrypted password.
* Using this program probably doesn't make it more secure, and has one
* disadvantage: since we don't get the encrypted user's password at
* startup (but at the time the user is authenticated), it is not clear
* how we should handle errors (like getpwnam() returning NULL).
* - fail the authentication? Problem: no way to unlock (other than kill
* the process from somewhere else) if the NIS server stops responding.
* - succeed and unlock? Problem: it's too easy to unlock by unplugging
* the box from the network and waiting until NIS times out...
*
* This program is Copyright (C) 1996 Marek Michalkiewicz
* <marekm@i17linuxb.ists.pwr.wroc.pl>.
*
* It may be used and distributed freely for any purposes. There is no
* warranty - use at your own risk. I am not liable for any damages etc.
* If you improve it, please send me your changes.
*/
static char rcsid[] = "$Id$";
/*
* Define USE_SYSLOG to use syslog() to log successful and failed
* authentication. This should be safe even if your system has
* the infamous syslog buffer overrun security problem...
*/
#define USE_SYSLOG
/*
* Define HAVE_GETSPNAM to get shadow passwords using getspnam().
* Some systems don't have getspnam(), but getpwnam() returns
* encrypted passwords only if running as root.
*
* According to the xlock source (not tested, except Linux) -
* define: Linux, Solaris 2.x, SVR4, ...
* undef: HP-UX with Secured Passwords, FreeBSD, NetBSD, QNX.
* Known not supported (yet): Ultrix, OSF/1, SCO.
*/
#define HAVE_GETSPNAM
/*
* Define HAVE_PW_ENCRYPT to use pw_encrypt() instead of crypt().
* pw_encrypt() is like the standard crypt(), except that it may
* support better password hashing algorithms.
*
* Define if linking with libshadow.a from the shadow password
* suite (Linux, SunOS 4.x?).
*/
#undef HAVE_PW_ENCRYPT
/*
* Define HAVE_AUTH_METHODS to support the shadow suite specific
* extension: the encrypted password field contains a list of
* administrator defined authentication methods, separated by
* semicolons. This program only supports the standard password
* authentication method (a string that doesn't start with '@').
*/
#undef HAVE_AUTH_METHODS
/*
* FAIL_DELAY - number of seconds to sleep before exiting if the
* password was wrong, to slow down password guessing attempts.
*/
#define FAIL_DELAY 2
/* No user-serviceable parts below :-). */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <pwd.h>
#ifdef USE_SYSLOG
#include <syslog.h>
#ifndef LOG_AUTHPRIV
#define LOG_AUTHPRIV LOG_AUTH
#endif
#endif
#ifdef HAVE_GETSPNAM
#include <shadow.h>
#endif
#ifdef HAVE_PW_ENCRYPT
extern char *pw_encrypt();
#define crypt pw_encrypt
#endif
/*
* Read the password (one line) from fp. We don't turn off echo
* because we expect input from a pipe.
*/
static char *
get_line(fp)
FILE *fp;
{
static char buf[128];
char *cp;
int ch;
cp = buf;
while ((ch = getc(fp)) != EOF && ch != '\0' && ch != '\n') {
if (cp >= buf + sizeof buf - 1)
break;
*cp++ = ch;
}
*cp = '\0';
return buf;
}
/*
* Get the password file entry for the current user. If the name
* returned by getlogin() is correct (matches the current real uid),
* return the entry for that user. Otherwise, return the entry (if
* any) matching the current real uid. Return NULL on failure.
*/
static struct passwd *
get_my_pwent()
{
uid_t uid = getuid();
char *name = getlogin();
if (name && *name) {
struct passwd *pw = getpwnam(name);
if (pw && pw->pw_uid == uid)
return pw;
}
return getpwuid(uid);
}
/*
* Verify the password. The system-dependent shadow support is here.
*/
static int
password_auth_ok(pw, pass)
const struct passwd *pw;
const char *pass;
{
int result;
char *cp;
#ifdef HAVE_AUTH_METHODS
char *buf;
#endif
#ifdef HAVE_GETSPNAM
struct spwd *sp;
#endif
if (pw) {
#ifdef HAVE_GETSPNAM
sp = getspnam(pw->pw_name);
if (sp)
cp = sp->sp_pwdp;
else
#endif
cp = pw->pw_passwd;
} else
cp = "xx";
#ifdef HAVE_AUTH_METHODS
buf = strdup(cp); /* will be modified by strtok() */
if (!buf) {
fprintf(stderr, "Out of memory.\n");
exit(13);
}
cp = strtok(buf, ";");
while (cp && *cp == '@')
cp = strtok(NULL, ";");
/* fail if no password authentication for this user */
if (!cp)
cp = "xx";
#endif
if (*pass || *cp)
result = (strcmp(crypt(pass, cp), cp) == 0);
else
result = 1; /* user with no password */
#ifdef HAVE_AUTH_METHODS
free(buf);
#endif
return result;
}
/*
* Main program.
*/
int
main(argc, argv)
int argc;
char **argv;
{
struct passwd *pw;
char *pass, *name;
char myname[32];
#ifdef USE_SYSLOG
openlog("pwdauth", LOG_PID | LOG_CONS, LOG_AUTHPRIV);
#endif
pw = get_my_pwent();
if (!pw) {
#ifdef USE_SYSLOG
syslog(LOG_ERR, "can't get login name for uid %d.\n",
(int) getuid());
#endif
fprintf(stderr, "Who are you?\n");
exit(2);
}
strncpy(myname, pw->pw_name, sizeof myname - 1);
myname[sizeof myname - 1] = '\0';
name = myname;
if (argc > 1) {
name = argv[1];
pw = getpwnam(name);
}
pass = get_line(stdin);
if (password_auth_ok(pw, pass)) {
#ifdef USE_SYSLOG
syslog(pw->pw_uid ? LOG_INFO : LOG_NOTICE,
"user `%s' entered correct password for `%.32s'.\n",
myname, name);
#endif
exit(0);
}
#ifdef USE_SYSLOG
/* be careful not to overrun the syslog buffer */
syslog((!pw || pw->pw_uid) ? LOG_NOTICE : LOG_WARNING,
"user `%s' entered incorrect password for `%.32s'.\n",
myname, name);
#endif
#ifdef FAIL_DELAY
sleep(FAIL_DELAY);
#endif
fprintf(stderr, "Wrong password.\n");
exit(1);
}
#if 0
/*
* You can use code similar to the following to run this program.
* Return values: >=0 - program exit status (use the <sys/wait.h>
* macros to get the exit code, it is shifted left by 8 bits),
* -1 - check errno.
*/
int
verify_password(const char *username, const char *password)
{
int pipe_fd[2];
int pid, wpid, status;
if (pipe(pipe_fd))
return -1;
if ((pid = fork()) == 0) {
char *arg[3];
char *env[1];
/* child */
close(pipe_fd[1]);
if (pipe_fd[0] != 0) {
if (dup2(pipe_fd[0], 0) != 0)
_exit(127);
close(pipe_fd[0]);
}
arg[0] = "/usr/bin/pwdauth";
arg[1] = username;
arg[2] = NULL;
env[0] = NULL;
execve(arg[0], arg, env);
_exit(127);
} else if (pid == -1) {
/* error */
close(pipe_fd[0]);
close(pipe_fd[1]);
return -1;
}
/* parent */
close(pipe_fd[0]);
write(pipe_fd[1], password, strlen(password));
write(pipe_fd[1], "\n", 1);
close(pipe_fd[1]);
while ((wpid = wait(&status)) != pid) {
if (wpid == -1)
return -1;
}
return status;
}
#endif

View File

@@ -1,147 +0,0 @@
Hello Marek,
I have created a diffile against the 980403 release that adds
functionality to newusers for automatic handling of users with only
anonymous ftp login (using the guestgroup feature in ftpaccess, which
means that the users home directory looks like '/home/user/./'). It also
adds a commandline argument to specify an initial directory structure
for such users, with a tarball normally containing the bin,lib,etc
directories used in the chrooted environment.
I am using it to automatically create chunks of users with only ftp
access for a webserver.
I have tried to follow your coding standards and I believe it is bug
free but.. well, who knows. :) It's not much code however.
I hope you find it useful. Do what you like with it, feel free to ask if
anything is unclear.
Best rgds,
Calle Karlsson
ckn@kash.se
diff -uNr shadow-980403.orig/src/newusers.c shadow-980403/src/newusers.c
--- shadow-980403.orig/src/newusers.c Fri Jan 30 00:22:43 1998
+++ shadow-980403/src/newusers.c Fri Apr 17 16:55:33 1998
@@ -76,11 +76,35 @@
static void
usage(void)
{
- fprintf(stderr, "Usage: %s [ input ]\n", Prog);
+ fprintf (stderr, "Usage: %s [-p prototype tarfile] [ input ]\n", Prog);
+ fprintf (stderr, "The prototype tarfile is only used for users\n");
+ fprintf (stderr, "marked as anonymous ftp users. It must be a full pathname.\n");
exit(1);
}
/*
+ * createuserdir - create a directory and chmod it
+ */
+
+static int
+createuserdir (char * dir, int uid, int gid, int line)
+{
+ if (mkdir (dir, 0777 & ~getdef_num("UMASK", 077))) {
+ fprintf (stderr, "%s: line %d: mkdir %s failed\n",
+ Prog, line, dir);
+ return -1;
+ }
+
+ if (chown (dir, uid, gid)) {
+ fprintf (stderr, "%s: line %d: chown %s failed\n",
+ Prog, line, dir);
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
* add_group - create a new group or add a user to an existing group
*/
@@ -328,6 +352,8 @@
main(int argc, char **argv)
{
char buf[BUFSIZ];
+ char anonproto[BUFSIZ];
+ int flag;
char *fields[8];
int nfields;
char *cp;
@@ -340,12 +366,23 @@
Prog = Basename(argv[0]);
- if (argc > 1 && argv[1][0] == '-')
- usage ();
+ * anonproto = '\0';
+
+ while ((flag = getopt (argc, argv, "p:h")) != EOF) {
+ switch (flag) {
+ case 'p':
+ STRFCPY(anonproto, optarg);
+ break;
+ case 'h':
+ default:
+ usage ();
+ break;
+ }
+ }
- if (argc == 2) {
- if (! freopen (argv[1], "r", stdin)) {
- snprintf(buf, sizeof buf, "%s: %s", Prog, argv[1]);
+ if (optind < argc) {
+ if (! freopen (argv[optind], "r", stdin)) {
+ snprintf(buf, sizeof buf, "%s: %s", Prog, argv[optind]);
perror (buf);
exit (1);
}
@@ -499,15 +536,36 @@
if (fields[6][0])
newpw.pw_shell = fields[6];
- if (newpw.pw_dir[0] && access(newpw.pw_dir, F_OK)) {
- if (mkdir (newpw.pw_dir,
- 0777 & ~getdef_num("UMASK", 077)))
- fprintf (stderr, "%s: line %d: mkdir failed\n",
- Prog, line);
- else if (chown (newpw.pw_dir,
- newpw.pw_uid, newpw.pw_gid))
- fprintf (stderr, "%s: line %d: chown failed\n",
- Prog, line);
+ if (newpw.pw_dir[0]) {
+ char * userdir = strdup (newpw.pw_dir);
+ char * anonpart;
+ int rc;
+
+ if ((anonpart = strstr (userdir, "/./"))) {
+ * anonpart = '\0';
+ anonpart += 2;
+ }
+
+ if (access(userdir, F_OK))
+ rc = createuserdir (userdir, newpw.pw_uid, newpw.pw_gid, line);
+ else
+ rc = 0;
+
+ if (rc == 0 && anonpart) {
+ if (* anonproto) {
+ char cmdbuf [BUFSIZ];
+ snprintf(cmdbuf, sizeof cmdbuf,
+ "cd %s; tar xf %s",
+ userdir, anonproto);
+ system (cmdbuf);
+ }
+ if (strlen (anonpart) > 1) {
+ strcat (userdir, anonpart);
+ if (access (userdir, F_OK))
+ createuserdir (userdir, newpw.pw_uid, newpw.pw_gid, line);
+ }
+ }
+ free (userdir);
}
/*

Binary file not shown.

43
debian/HOME_MODE.xml vendored
View File

@@ -1,43 +0,0 @@
<!--
Copyright (c) 1991 - 1993, Julianne Frances Haugh
Copyright (c) 1991 - 1993, Chip Rosenthal
Copyright (c) 2007 - 2009, Nicolas François
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the copyright holders or contributors may not be used to
endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<varlistentry>
<term><option>HOME_MODE</option> (number)</term>
<listitem>
<para>
The mode for new home directories. If not specified,
the <option>UMASK</option> is used to create the mode.
</para>
<para>
<command>useradd</command> and <command>newusers</command> use this
to set the mode of the home directory they create.
</para>
</listitem>
</varlistentry>

16
debian/Makefile vendored
View File

@@ -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; \
}

24
debian/NEWS vendored
View File

@@ -1,3 +1,27 @@
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
affects authentication. The historical default of letting all users with
empty password field in without authentication is still in effect.
-- Balint Reczey <balint@balintreczey.hu> Mon, 25 Sep 2023 17:04:09 +0200
shadow (1:4.11.1+dfsg1-0exp1) experimental; urgency=medium
Login now prevents an empty password field to be interpreted as

297
debian/changelog vendored
View File

@@ -1,22 +1,295 @@
shadow (1:4.13+dfsg1-1+deb12u2) bookworm; urgency=medium
shadow (1:4.17.2-4) unstable; urgency=medium
* Apply upstream patch to fix groupmod -U "" segfault (Closes: #1122913)
* Revert upstreams chfn.c strsep change (Closes: #1096187)
-- Chris Hofstaedtler <zeha@debian.org> Sun, 14 Dec 2025 15:00:01 +0100
-- Chris Hofstaedtler <zeha@debian.org> Mon, 17 Feb 2025 12:28:56 +0100
shadow (1:4.13+dfsg1-1+deb12u1) bookworm; urgency=medium
shadow (1:4.17.2-3) unstable; urgency=medium
[ Balint Reczey ]
* Cherry-pick upstream patch to fix gpasswd passwd leak (Closes: #1051062)
CVE-2023-4641
* Cherry-pick upstream patch to fix chfn vulnerability (Closes: #1034482)
CVE-2023-29383
* Fix valid_field() that regressed in upstream's chfn fix
* 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 ]
* Update Uploaders: field from unstable
* 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)
-- Chris Hofstaedtler <zeha@debian.org> Mon, 07 Apr 2025 12:38:46 +0200
[ 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
* tests: follow upstream subdir fix
* Fix setup of test libsubid-04_nss
* Drop login.postinst, obsoleted by #1074121
* Bump Standards-Version to 4.7.0
-- Chris Hofstaedtler <zeha@debian.org> Sat, 06 Jul 2024 23:50:36 +0200
shadow (1:4.15.2-3) unstable; urgency=medium
* d/watch: add versionmangle for -rc
* Revert "Use upstream's restrictions on user- and group names again".
Breaks adduser's tests, see #1074306.
-- Chris Hofstaedtler <zeha@debian.org> Wed, 26 Jun 2024 12:40:34 +0200
shadow (1:4.15.2-2) unstable; urgency=medium
* useradd(8): Fix missing paragraph on username length
* d/rules: explicitly set --with-audit and --enable-subordinate-ids
* Remove faillog support.
Stop installing faillog binary and man pages. Stop creating
/var/log/faillog in login.postinst.
PAM has removed support for /var/log/faillog by dropping pam_tally, and
login itself cannot write to it either.
* Use upstream's restrictions on user- and group names again.
Upstream started supporting mixed-case names some time ago.
Purely numeric names (#79682) are now forbidden again, as there is no
way of distinguishing them from user/group IDs otherwise.
* Drop useradd's backwards-compatibility -O flag
* Remove our copy of HOME_MODE.xml, identical upstream
* shadowconfig.8: actually install again
* passwd: add Depends: login.
Stop-gap until passwd can takeover /etc/login.defs from login.
-- Chris Hofstaedtler <zeha@debian.org> Tue, 25 Jun 2024 19:42:24 +0200
shadow (1:4.15.2-1) unstable; urgency=medium
* New upstream version 4.15.2
Includes fix for csrand_uniform().
-- Chris Hofstaedtler <zeha@debian.org> Sat, 22 Jun 2024 17:37:34 +0200
shadow (1:4.15.1-1) unstable; urgency=medium
* New upstream version 4.15.1
Closes: #832047, #812127, #1034312, #856902, #791806
Closes: #1006216, #1006225, #1006208
* contrib/atudel, non-DFSG-compliant was removed upstream
* Remove obsolete configure flag --without-libcrack
* Use functions from libbsd (Closes: #1032393)
* Build-Depend: libltdl-dev for LT_LIB_DLLOAD
(Closes: #1065350)
* Build-Depend: pkgconf
* Drop upstream applied patches
* Disable FTMP_FILE by default, drop login failure logging
* Rebase patch 401_cppw_src.dpatch
* Rename patch 402_cppw_selinux
* Use upstream FAILLOG_ENAB code, incompatible with PAM
(Closes: #776314)
* Rebase patch 463_login_delay_obeys_to_PAM
* Rebase patch 501_commonio_group_shadow
* Rebase patch 502_debian_useradd_defaults
* Rebase patch 506_relaxed_usernames
* Rebase patch 542_useradd-O_option
* Update upstream signing keys
* Tag build with dh-package-notes
* Turn off --enable-lastlog, drop lastlog from not-installed
* Explicitly enable logind on linux-any
* Update default ENCRYPT_METHOD (Closes: #1043236)
* login: switch from Essential to Protected: yes (Closes: #960638)
Moves Pre-Depends to Depends.
* Enable acl, xattr support (Closes: #745796)
* login.defs: remove PAM-unsupported crypt settings (Closes: #1055582)
-- Chris Hofstaedtler <zeha@debian.org> Sat, 22 Jun 2024 16:08:41 +0200
shadow (1:4.13+dfsg1-5) unstable; urgency=medium
* Add myself to Uploaders, per discussion with Serge Hallyn
* Apply wrap-and-sort -kas style
* Use debputy to avoid Rules-Requires-Root: binary-targets
* libsubid4: tighten package-internal dependencies
[ Serge Hallyn ]
* Drop pam_lastlog.so from config. (Closes: #1068229)
* Stop installing lastlog binary.
-- Chris Hofstaedtler <zeha@debian.org> Sun, 02 Jun 2024 20:01:51 +0200
shadow (1:4.13+dfsg1-4) unstable; urgency=medium
[ Helmut Grohne ]
* DEP17: Move login and shadowconfig to /usr. (Closes: #1059915)
-- Serge Hallyn <serge@hallyn.com> Sun, 04 Feb 2024 20:28:27 +0000
shadow (1:4.13+dfsg1-3) unstable; urgency=medium
* Team upload
* Remove myself from uploaders
-- Balint Reczey <balint@balintreczey.hu> Sun, 15 Oct 2023 19:10:52 +0200
shadow (1:4.13+dfsg1-2) unstable; urgency=medium
[ Balint Reczey ]
* debian/gitlab-ci.yml: Use sudo to fix reprotest test
* debian/login.pam: Drop reference to Debian Etch (Closes: #1040064)
* debian/NEWS: Fix false claim about PREVENT_NO_AUTH affecting authentication.
Also drop setting PREVENT_NO_AUTH in shipped login.defs. (Closes: #1041547)
* Cherry-pick upstream patch to fix gpasswd passwd leak
(CVE-2023-4641) (Closes: #1051062)
* Cherry-pick upstream patch to fix chfn vulnerability allowing injection of
control characters into some /etc/passwd fields.
(CVE-2023-29383) (Closes: #1034482)
[ Gioele Barabucci ]
* Support <nodoc> build profile
`xsltproc`, `docbook` and all other XML-related packages are not needed
when the `<nodoc>` build profile is active, as long as `./configure` is
called with `--disable-man`. (Closes: #1051827)
-- Balint Reczey <balint@balintreczey.hu> Tue, 26 Sep 2023 22:01:52 +0200
shadow (1:4.13+dfsg1-1) unstable; urgency=medium

85
debian/control vendored
View File

@@ -5,73 +5,73 @@ Uploaders:
Chris Hofstaedtler <zeha@debian.org>
Section: admin
Priority: required
Build-Depends: debhelper-compat (= 13),
gettext,
libcrypt-dev,
libpam0g-dev,
quilt,
xsltproc,
docbook-xsl,
docbook-xml,
libxml2-utils,
libselinux1-dev [linux-any],
libsemanage-dev [linux-any],
itstool,
bison,
libaudit-dev [linux-any]
Standards-Version: 4.6.1
Build-Depends:
bison,
debhelper-compat (= 13),
dh-package-notes,
dh-sequence-zz-debputy-rrr (>= 0.1.23~),
docbook-xml <!nodoc>,
docbook-xsl <!nodoc>,
gettext,
itstool <!nodoc>,
libacl1-dev,
libattr1-dev,
libaudit-dev [linux-any],
libbsd-dev,
libcrypt-dev,
libltdl-dev,
libpam0g-dev,
libselinux1-dev [linux-any],
libsemanage-dev [linux-any],
libxml2-utils <!nodoc>,
pkgconf,
systemd-dev [linux-any],
xsltproc <!nodoc>
Standards-Version: 4.7.0
Vcs-Git: https://salsa.debian.org/debian/shadow.git -b master
Vcs-Browser: https://salsa.debian.org/debian/shadow
Homepage: https://github.com/shadow-maint/shadow
Rules-Requires-Root: binary-targets
Rules-Requires-Root: no
Package: passwd
Architecture: any
Multi-Arch: foreign
Depends: ${shlibs:Depends},
${misc:Depends},
libpam-modules
Recommends: sensible-utils
Depends:
base-passwd (>= 3.6.4),
libpam-modules,
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
Essential: yes
Pre-Depends: ${shlibs:Depends},
${misc:Depends},
libpam-runtime,
libpam-modules
Breaks: hurd (<< 20140206~) [hurd-any]
Conflicts: python-4suite (<< 0.99cvs20060405-1)
Replaces: hurd (<< 20140206~) [hurd-any]
Description: system login tools
This package provides some required infrastructure for 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;
Replaces:
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
Multi-Arch: foreign
Priority: optional
Depends: ${shlibs:Depends},
${misc:Depends}
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
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: subordinate id handling library -- shared library
The library provides an interface for querying, granding and ungranting
subordinate user and group ids.
@@ -81,10 +81,11 @@ Section: libdevel
Priority: optional
Architecture: any
Multi-Arch: same
Depends: ${misc:Depends}, libsubid4 (= ${binary:Version})
Depends:
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.

48
debian/copyright vendored
View File

@@ -1,12 +1,10 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Shadow
Source: https://github.com/shadow-maint/shadow
Note: atudel is licensed under BSD-4-Clause which is not DFSG compatible
Files-Excluded: contrib/atudel
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
@@ -59,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
@@ -80,15 +77,15 @@ 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
License: GPL-2+
Files: contrib/udbachk.tgz
Copyright: 1999, Sami Kerola and Janne Riihijärvi
License: GPL-2+
Files: man/hu/man5/*
Copyright: 1993, Michael Haardt <u31b3hs@pool.informatik.rwth-aachen.de>
License: GPL-2+
@@ -97,26 +94,14 @@ Files: contrib/adduser2.sh
Copyright: 1996, Petri Mattila, Prihateam Networks <petri@prihateam.fi>
License: GPL-2+
Files: contrib/pwdauth.c
Copyright: 1996, Marek Michalkiewicz
License: BSD-3-clause
Files: lib/subordinateio.h
Copyright: 2012, Eric W. Biederman
License: BSD-3-clause
Files: libmisc/date_to_str.c
Copyright: 2021, Alejandro Colomar <alx.manpages@gmail.com>
License: BSD-3-clause
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
@@ -139,16 +124,6 @@ Copyright: 1997, Guy Maor <maor@ece.utexas.edu>
2007 - 2013, Nicolas François
License: GPL-2+
Files: libmisc/getdate.y
Copyright: Steven M. Bellovin <smb@research.att.com>
License: public-domain
Originally written by Steven M. Bellovin <smb@research.att.com> while
at the University of North Carolina at Chapel Hill. Later tweaked by
a couple of people on Usenet. Completely overhauled by Rich $alz
<rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990;
.
This code is in the public domain and has no copyright.
Files: man/ko/man5/*
Copyright: 2000, ASPLINUX <man@asp-linux.co.kr>
License: GPL-2+
@@ -161,17 +136,6 @@ Copyright: 1999-2001, Ben Collins <bcollins@debian.org>
2017-2022 Balint Reczey <balint@balintreczey.hu>
License: BSD-3-clause
Files: debian/HOME_MODE.xml
Copyright: 1991-1993, Chip Rosenthal
1991-1993, Julianne Frances Haugh
2007-2009, Nicolas François
License: BSD-3-clause
Files: debian/patches/401_cppw_src.dpatch
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
View File

@@ -1 +0,0 @@
.so man8/cppw.8

27
debian/cppw.8 vendored
View File

@@ -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.

24
debian/debputy.manifest vendored Normal file
View File

@@ -0,0 +1,24 @@
manifest-version: '0.1'
packages:
passwd:
transformations:
- path-metadata:
paths:
- usr/bin/chfn
- usr/bin/chsh
- usr/bin/gpasswd
- usr/bin/passwd
mode: "u=rwxs,go=rx"
- path-metadata:
paths:
- usr/bin/chage
- usr/bin/expiry
group: "shadow"
mode: "u=rwx,go=rxs"
uidmap:
transformations:
- path-metadata:
paths:
- usr/bin/newgidmap
- usr/bin/newuidmap
mode: "u=rwxs,go=rx"

78
debian/dependencies vendored
View File

@@ -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

2
debian/gbp.conf vendored Normal file
View File

@@ -0,0 +1,2 @@
[pq]
patch-numbers = False

View File

@@ -1,5 +1,7 @@
variables:
RELEASE: 'unstable'
RELEASE: 'unstable'
# workaround for https://salsa.debian.org/salsa-ci-team/pipeline/-/issues/259
SALSA_CI_REPROTEST_ARGS: --vary=domain_host.use_sudo=1
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml

View File

@@ -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
View 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

402
debian/login.defs vendored
View File

@@ -1,402 +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 logging and display of /var/log/faillog login failure info.
# This option conflicts with the pam_tally PAM module.
#
FAILLOG_ENAB yes
#
# 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, login failures will be logged here in a utmp format
# last, when invoked as lastb, will read /var/log/btmp, so...
#
FTMP_FILE /var/log/btmp
#
# 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).
# UMASK Default "umask" value.
#
# The ERASECHAR and KILLCHAR are used only on System V machines.
#
# UMASK is the default umask value for pam_umask and is used by
# useradd and newusers to set the mode of the new home directories.
# 022 is the "historical" value in Debian for UMASK
# 027, or even 077, could be considered better for privacy
# There is no One True Answer here : each sysadmin must make up his/her
# mind.
#
# If USERGROUPS_ENAB is set to "yes", that will modify this UMASK default value
# for private user groups, i. e. the uid is the same as gid, and username is
# the same as the primary group name: for these, the user permissions will be
# used as group permissions, e. g. 022 will become 002.
#
# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
#
ERASECHAR 0177
KILLCHAR 025
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
#
# 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 "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".
#
# This variable is deprecated. You should use ENCRYPT_METHOD.
#
#MD5_CRYPT_ENAB no
#
# 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 SHA512
#
# 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 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
#
# 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
#
# 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
################# 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
View File

@@ -0,0 +1 @@
etc/login.defs etc

2
debian/login.defs.manpages vendored Normal file
View 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
View 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
View File

@@ -1 +0,0 @@
usr/share/lintian/overrides

View File

@@ -1,7 +0,0 @@
debian/login.defs etc
usr/share/locale/*/LC_MESSAGES/shadow.mo
sbin/nologin usr/sbin
usr/bin/faillog
usr/bin/lastlog
usr/bin/newgrp
bin/login

1
debian/login.links vendored
View File

@@ -1 +0,0 @@
usr/bin/newgrp usr/bin/sg

View File

@@ -1 +0,0 @@
login: elevated-privileges 4755 root/root [usr/bin/newgrp]

View File

@@ -1 +0,0 @@
rm_conffile /etc/securetty 1:4.7-1~

16
debian/login.manpages vendored
View File

@@ -1,16 +0,0 @@
usr/share/man/*/man1/login.1
usr/share/man/*/man1/newgrp.1
usr/share/man/*/man1/sg.1
usr/share/man/*/man5/faillog.5
usr/share/man/*/man5/login.defs.5
usr/share/man/*/man8/faillog.8
usr/share/man/*/man8/lastlog.8
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/faillog.5
usr/share/man/man5/login.defs.5
usr/share/man/man8/faillog.8
usr/share/man/man8/lastlog.8
usr/share/man/man8/nologin.8

100
debian/login.pam vendored
View File

@@ -1,100 +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 are also kept into /etc/default/locale in etch
# 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 last login info upon successful login
# (Replaces the `LASTLOG_ENAB' option from login.defs)
session optional pam_lastlog.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

30
debian/login.postinst vendored
View File

@@ -1,30 +0,0 @@
#!/bin/sh
set -e
if [ "$1" = "configure" ]; then
# Install faillog during initial installs only
if [ "$2" = "" ] && [ ! -f "$DPKG_ROOT/var/log/faillog" ] ; then
touch "$DPKG_ROOT/var/log/faillog"
chown 0:0 "$DPKG_ROOT/var/log/faillog"
chmod 644 "$DPKG_ROOT/var/log/faillog"
fi
# Create subuid/subgid if missing
if [ ! -e "$DPKG_ROOT/etc/subuid" ]; then
touch "$DPKG_ROOT/etc/subuid"
chown 0:0 "$DPKG_ROOT/etc/subuid"
chmod 644 "$DPKG_ROOT/etc/subuid"
fi
if [ ! -e "$DPKG_ROOT/etc/subgid" ]; then
touch "$DPKG_ROOT/etc/subgid"
chown 0:0 "$DPKG_ROOT/etc/subgid"
chmod 644 "$DPKG_ROOT/etc/subgid"
fi
fi
#DEBHELPER#
exit 0

22
debian/not-installed vendored
View File

@@ -1,5 +1,6 @@
bin/groups
etc/default/useradd
bin/login
# Workaround debhelper complaining about login.defs, although we install it.
etc/login.defs
etc/pam.d/chfn
etc/pam.d/chage
@@ -15,22 +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

2
debian/passwd.dirs vendored
View File

@@ -1,2 +1,2 @@
usr/share/lintian/overrides
etc/default
usr/share/lintian/overrides

View File

@@ -1,18 +1,16 @@
debian/default/useradd etc/default
debian/shadowconfig sbin
debian/shadowconfig usr/sbin
usr/bin/chage
usr/bin/chfn
usr/bin/chsh
usr/bin/expiry
usr/bin/gpasswd
usr/bin/passwd
usr/sbin/chpasswd
usr/sbin/chgpasswd
usr/sbin/cppw
usr/sbin/chpasswd
usr/sbin/groupadd
usr/sbin/groupdel
usr/sbin/groupmod
usr/sbin/groupmems
usr/sbin/grpck
usr/sbin/grpconv
usr/sbin/grpunconv
@@ -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
View File

@@ -1,2 +1 @@
usr/sbin/vipw usr/sbin/vigr
usr/sbin/cppw usr/sbin/cpgr

View File

@@ -1,22 +1,19 @@
debian/cpgr.8
debian/cppw.8
usr/share/man/*/man1/chage.1
usr/share/man/*/man1/chfn.1
usr/share/man/*/man1/chsh.1
usr/share/man/*/man1/expiry.1
usr/share/man/*/man1/gpasswd.1
usr/share/man/*/man1/passwd.1
usr/share/man/*/man5/gshadow.5
usr/share/man/*/man5/passwd.5
usr/share/man/*/man5/shadow.5
usr/share/man/*/man5/subgid.5
usr/share/man/*/man5/subuid.5
usr/share/man/*/man5/shadow.5
usr/share/man/*/man5/gshadow.5
usr/share/man/*/man8/chpasswd.8
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/groupmod.8
usr/share/man/*/man8/groupmems.8
usr/share/man/*/man8/grpck.8
usr/share/man/*/man8/grpconv.8
usr/share/man/*/man8/grpunconv.8
@@ -24,6 +21,7 @@ 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
@@ -35,16 +33,15 @@ usr/share/man/man1/chsh.1
usr/share/man/man1/expiry.1
usr/share/man/man1/gpasswd.1
usr/share/man/man1/passwd.1
usr/share/man/man5/gshadow.5
usr/share/man/man5/passwd.5
usr/share/man/man5/shadow.5
usr/share/man/man5/gshadow.5
usr/share/man/man5/subuid.5
usr/share/man/man5/subgid.5
usr/share/man/man5/subuid.5
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
@@ -53,6 +50,7 @@ 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

View File

@@ -1,137 +0,0 @@
From 65c88a43a23c2391dcc90c0abda3e839e9c57904 Mon Sep 17 00:00:00 2001
From: Alejandro Colomar <alx@kernel.org>
Date: Sat, 10 Jun 2023 16:20:05 +0200
Subject: [PATCH] gpasswd(1): Fix password leak
How to trigger this password leak?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When gpasswd(1) asks for the new password, it asks twice (as is usual
for confirming the new password). Each of those 2 password prompts
uses agetpass() to get the password. If the second agetpass() fails,
the first password, which has been copied into the 'static' buffer
'pass' via STRFCPY(), wasn't being zeroed.
agetpass() is defined in <./libmisc/agetpass.c> (around line 91), and
can fail for any of the following reasons:
- malloc(3) or readpassphrase(3) failure.
These are going to be difficult to trigger. Maybe getting the system
to the limits of memory utilization at that exact point, so that the
next malloc(3) gets ENOMEM, and possibly even the OOM is triggered.
About readpassphrase(3), ENFILE and EINTR seem the only plausible
ones, and EINTR probably requires privilege or being the same user;
but I wouldn't discard ENFILE so easily, if a process starts opening
files.
- The password is longer than PASS_MAX.
The is plausible with physical access. However, at that point, a
keylogger will be a much simpler attack.
And, the attacker must be able to know when the second password is being
introduced, which is not going to be easy.
How to read the password after the leak?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provoking the leak yourself at the right point by entering a very long
password is easy, and inspecting the process stack at that point should
be doable. Try to find some consistent patterns.
Then, search for those patterns in free memory, right after the victim
leaks their password.
Once you get the leak, a program should read all the free memory
searching for patterns that gpasswd(1) leaves nearby the leaked
password.
On 6/10/23 03:14, Seth Arnold wrote:
> An attacker process wouldn't be able to use malloc(3) for this task.
> There's a handful of tools available for userspace to allocate memory:
>
> - brk / sbrk
> - mmap MAP_ANONYMOUS
> - mmap /dev/zero
> - mmap some other file
> - shm_open
> - shmget
>
> Most of these return only pages of zeros to a process. Using mmap of an
> existing file, you can get some of the contents of the file demand-loaded
> into the memory space on the first use.
>
> The MAP_UNINITIALIZED flag only works if the kernel was compiled with
> CONFIG_MMAP_ALLOW_UNINITIALIZED. This is rare.
>
> malloc(3) doesn't zero memory, to our collective frustration, but all the
> garbage in the allocations is from previous allocations in the current
> process. It isn't leftover from other processes.
>
> The avenues available for reading the memory:
> - /dev/mem and /dev/kmem (requires root, not available with Secure Boot)
> - /proc/pid/mem (requires ptrace privileges, mediated by YAMA)
> - ptrace (requires ptrace privileges, mediated by YAMA)
> - causing memory to be swapped to disk, and then inspecting the swap
>
> These all require a certain amount of privileges.
How to fix it?
~~~~~~~~~~~~~~
memzero(), which internally calls explicit_bzero(3), or whatever
alternative the system provides with a slightly different name, will
make sure that the buffer is zeroed in memory, and optimizations are not
allowed to impede this zeroing.
This is not really 100% effective, since compilers may place copies of
the string somewhere hidden in the stack. Those copies won't get zeroed
by explicit_bzero(3). However, that's arguably a compiler bug, since
compilers should make everything possible to avoid optimizing strings
that are later passed to explicit_bzero(3). But we all know that
sometimes it's impossible to have perfect knowledge in the compiler, so
this is plausible. Nevertheless, there's nothing we can do against such
issues, except minimizing the time such passwords are stored in plain
text.
Security concerns
~~~~~~~~~~~~~~~~~
We believe this isn't easy to exploit. Nevertheless, and since the fix
is trivial, this fix should probably be applied soon, and backported to
all supported distributions, to prevent someone else having more
imagination than us to find a way.
Affected versions
~~~~~~~~~~~~~~~~~
All. Bug introduced in shadow 19990709. That's the second commit in
the git history.
Fixes: 45c6603cc86c ("[svn-upgrade] Integrating new upstream version, shadow (19990709)")
Reported-by: Alejandro Colomar <alx@kernel.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Seth Arnold <seth.arnold@canonical.com>
Cc: Christian Brauner <christian@brauner.io>
Cc: Balint Reczey <rbalint@debian.org>
Cc: Sam James <sam@gentoo.org>
Cc: David Runge <dvzrv@archlinux.org>
Cc: Andreas Jaeger <aj@suse.de>
Cc: <~hallyn/shadow@lists.sr.ht>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
src/gpasswd.c | 1 +
1 file changed, 1 insertion(+)
--- a/src/gpasswd.c
+++ b/src/gpasswd.c
@@ -896,6 +896,7 @@
strzero (cp);
cp = getpass (_("Re-enter new password: "));
if (NULL == cp) {
+ memzero (pass, sizeof pass);
exit (1);
}

View File

@@ -1,45 +0,0 @@
From e5905c4b84d4fb90aefcd96ee618411ebfac663d Mon Sep 17 00:00:00 2001
From: tomspiderlabs <128755403+tomspiderlabs@users.noreply.github.com>
Date: Thu, 23 Mar 2023 23:39:38 +0000
Subject: [PATCH] Added control character check
Added control character check, returning -1 (to "err") if control characters are present.
---
lib/fields.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/fields.c b/lib/fields.c
index 640be931..fb51b582 100644
--- a/lib/fields.c
+++ b/lib/fields.c
@@ -21,9 +21,9 @@
*
* The supplied field is scanned for non-printable and other illegal
* characters.
- * + -1 is returned if an illegal character is present.
- * + 1 is returned if no illegal characters are present, but the field
- * contains a non-printable character.
+ * + -1 is returned if an illegal or control character is present.
+ * + 1 is returned if no illegal or control characters are present,
+ * but the field contains a non-printable character.
* + 0 is returned otherwise.
*/
int valid_field (const char *field, const char *illegal)
@@ -45,10 +45,13 @@ int valid_field (const char *field, const char *illegal)
}
if (0 == err) {
- /* Search if there are some non-printable characters */
+ /* Search if there are non-printable or control characters */
for (cp = field; '\0' != *cp; cp++) {
if (!isprint (*cp)) {
err = 1;
+ }
+ if (!iscntrl (*cp)) {
+ err = -1;
break;
}
}
--
2.34.1

View File

@@ -1,61 +0,0 @@
From 2eaea70111f65b16d55998386e4ceb4273c19eb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Fri, 31 Mar 2023 14:46:50 +0200
Subject: [PATCH] Overhaul valid_field()
e5905c4b ("Added control character check") introduced checking for
control characters but had the logic inverted, so it rejects all
characters that are not control ones.
Cast the character to `unsigned char` before passing to the character
checking functions to avoid UB.
Use strpbrk(3) for the illegal character test and return early.
---
lib/fields.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/lib/fields.c b/lib/fields.c
index fb51b582..53929248 100644
--- a/lib/fields.c
+++ b/lib/fields.c
@@ -37,26 +37,22 @@ int valid_field (const char *field, const char *illegal)
/* For each character of field, search if it appears in the list
* of illegal characters. */
+ if (illegal && NULL != strpbrk (field, illegal)) {
+ return -1;
+ }
+
+ /* Search if there are non-printable or control characters */
for (cp = field; '\0' != *cp; cp++) {
- if (strchr (illegal, *cp) != NULL) {
+ unsigned char c = *cp;
+ if (!isprint (c)) {
+ err = 1;
+ }
+ if (iscntrl (c)) {
err = -1;
break;
}
}
- if (0 == err) {
- /* Search if there are non-printable or control characters */
- for (cp = field; '\0' != *cp; cp++) {
- if (!isprint (*cp)) {
- err = 1;
- }
- if (!iscntrl (*cp)) {
- err = -1;
- break;
- }
- }
- }
-
return err;
}
--
2.34.1

View File

@@ -1,51 +0,0 @@
Goal: Log login failures to the btmp file
Notes:
* I'm not sure login should add an entry in the FTMP file when PAM is used.
(but nothing in /etc/login.defs indicates that the failure is not logged)
--- a/src/login.c
+++ b/src/login.c
@@ -827,6 +827,24 @@
(void) puts ("");
(void) puts (_("Login incorrect"));
+ if (getdef_str("FTMP_FILE") != NULL) {
+#ifdef USE_UTMPX
+ struct utmpx *failent =
+ prepare_utmpx (failent_user,
+ tty,
+ /* FIXME: or fromhost? */hostname,
+ utent);
+#else /* !USE_UTMPX */
+ struct utmp *failent =
+ prepare_utmp (failent_user,
+ tty,
+ hostname,
+ utent);
+#endif /* !USE_UTMPX */
+ failtmp (failent_user, failent);
+ free (failent);
+ }
+
if (failcount >= retries) {
SYSLOG ((LOG_NOTICE,
"TOO MANY LOGIN TRIES (%u)%s FOR '%s'",
--- a/lib/getdef.c
+++ b/lib/getdef.c
@@ -38,7 +38,6 @@
{"ENVIRON_FILE", NULL}, \
{"ENV_TZ", NULL}, \
{"FAILLOG_ENAB", NULL}, \
- {"FTMP_FILE", NULL}, \
{"HMAC_CRYPTO_ALGO", NULL}, \
{"ISSUE_FILE", NULL}, \
{"LASTLOG_ENAB", NULL}, \
@@ -80,6 +79,7 @@
{"ERASECHAR", NULL},
{"FAIL_DELAY", NULL},
{"FAKE_SHELL", NULL},
+ {"FTMP_FILE", NULL},
{"GID_MAX", NULL},
{"GID_MIN", NULL},
{"HOME_MODE", NULL},

View File

@@ -1,276 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 401_cppw_src.dpatch by Nicolas FRANCOIS <nicolas.francois@centraliens.net>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Add cppw / cpgr
@DPATCH@
--- /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;
+}
+
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,6 +34,7 @@
bin_PROGRAMS += su
endif
usbin_PROGRAMS = \
+ cppw \
chgpasswd \
chpasswd \
groupadd \
@@ -102,6 +103,7 @@
chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) $(LIBECONF)
chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) $(LIBECONF)
chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) $(LIBECONF)
+cppw_LDADD = $(LDADD) $(LIBSELINUX) $(LIBAUDIT)
expiry_LDADD = $(LDADD) $(LIBECONF)
gpasswd_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) $(LIBECONF)
groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBECONF) -ldl
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -91,6 +91,7 @@
src/chgpasswd.c
src/chpasswd.c
src/chsh.c
+src/cppw.c
src/expiry.c
src/faillog.c
src/gpasswd.c

View File

@@ -1,64 +0,0 @@
Goal: Add selinux support to cppw
Fix:
Status wrt upstream: cppw is not available upstream.
The patch was made based on the
302_vim_selinux_support patch. It needs to be
reviewed by an SE-Linux aware person.
Depends on 401_cppw_src.dpatch
Index: git/src/cppw.c
===================================================================
--- git.orig/src/cppw.c
+++ git/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 @@
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 @@
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) ();
}

View File

@@ -1,84 +0,0 @@
Goal: Re-enable logging and displaying failures on login when login is
compiled with PAM and when FAILLOG_ENAB is set to yes. And create the
faillog file if it does not exist on postinst (as on Woody).
Depends: 008_login_more_LOG_UNKFAIL_ENAB
Fixes: #192849
Note: It could be removed if pam_tally could report the number of failures
preceding a successful login.
--- a/src/login.c
+++ b/src/login.c
@@ -114,9 +114,9 @@
#endif
);
-#ifndef USE_PAM
static struct faillog faillog;
+#ifndef USE_PAM
static void bad_time_notify (void);
static void check_nologin (bool login_to_root);
#else
@@ -787,6 +787,9 @@
SYSLOG ((LOG_NOTICE,
"TOO MANY LOGIN TRIES (%u)%s FOR '%s'",
failcount, fromhost, failent_user));
+ if ((NULL != pwd) && getdef_bool("FAILLOG_ENAB")) {
+ failure (pwd->pw_uid, tty, &faillog);
+ }
fprintf (stderr,
_("Maximum number of tries exceeded (%u)\n"),
failcount);
@@ -804,6 +807,14 @@
pam_strerror (pamh, retcode)));
failed = true;
}
+ if ( (NULL != pwd)
+ && getdef_bool("FAILLOG_ENAB")
+ && ! failcheck (pwd->pw_uid, &faillog, failed)) {
+ SYSLOG((LOG_CRIT,
+ "exceeded failure limit for `%s' %s",
+ failent_user, fromhost));
+ failed = 1;
+ }
if (!failed) {
break;
@@ -827,6 +838,10 @@
(void) puts ("");
(void) puts (_("Login incorrect"));
+ if ((NULL != pwd) && getdef_bool("FAILLOG_ENAB")) {
+ failure (pwd->pw_uid, tty, &faillog);
+ }
+
if (getdef_str("FTMP_FILE") != NULL) {
#ifdef USE_UTMPX
struct utmpx *failent =
@@ -1295,6 +1310,7 @@
*/
#ifndef USE_PAM
motd (); /* print the message of the day */
+#endif
if ( getdef_bool ("FAILLOG_ENAB")
&& (0 != faillog.fail_cnt)) {
failprint (&faillog);
@@ -1307,6 +1323,7 @@
username, (int) faillog.fail_cnt));
}
}
+#ifndef USE_PAM
if ( getdef_bool ("LASTLOG_ENAB")
&& pwd->pw_uid <= (uid_t) getdef_ulong ("LASTLOG_UID_MAX", 0xFFFFFFFFUL)
&& (ll.ll_time != 0)) {
--- a/lib/getdef.c
+++ b/lib/getdef.c
@@ -78,6 +78,7 @@
{"ENV_SUPATH", NULL},
{"ERASECHAR", NULL},
{"FAIL_DELAY", NULL},
+ {"FAILLOG_ENAB", NULL},
{"FAKE_SHELL", NULL},
{"FTMP_FILE", NULL},
{"GID_MAX", NULL},

View File

@@ -1,97 +0,0 @@
Goal: Do not hardcode pam_fail_delay and let pam_unix do its
job to set a delay...or not
Fixes: #87648
Status wrt upstream: Forwarded but not applied yet
Note: If removed, FAIL_DELAY must be re-added to /etc/login.defs
--- a/src/login.c
+++ b/src/login.c
@@ -512,7 +512,6 @@
#if !defined(USE_PAM)
char ptime[80];
#endif
- unsigned int delay;
unsigned int retries;
bool subroot = false;
#ifndef USE_PAM
@@ -537,6 +536,7 @@
pid_t child;
char *pam_user = NULL;
#else
+ unsigned int delay;
struct spwd *spwd = NULL;
#endif
/*
@@ -701,7 +701,6 @@
}
environ = newenvp; /* make new environment active */
- delay = getdef_unum ("FAIL_DELAY", 1);
retries = getdef_unum ("LOGIN_RETRIES", RETRIES);
#ifdef USE_PAM
@@ -717,8 +716,7 @@
/*
* 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)
@@ -727,10 +725,6 @@
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) {
unsigned int failcount = 0;
@@ -771,12 +765,6 @@
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);
@@ -1110,14 +1098,17 @@
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"));
--- a/lib/getdef.c
+++ b/lib/getdef.c
@@ -77,7 +77,6 @@
{"ENV_PATH", NULL},
{"ENV_SUPATH", NULL},
{"ERASECHAR", NULL},
- {"FAIL_DELAY", NULL},
{"FAILLOG_ENAB", NULL},
{"FAKE_SHELL", NULL},
{"FTMP_FILE", NULL},

View File

@@ -1,60 +0,0 @@
Goal: save the [g]shadow files with the 'shadow' group and mode 0440
Fixes: #166793
--- a/lib/commonio.c
+++ b/lib/commonio.c
@@ -21,6 +21,7 @@
#include <errno.h>
#include <stdio.h>
#include <signal.h>
+#include <grp.h>
#include "nscd.h"
#include "sssd.h"
#ifdef WITH_TCB
@@ -970,12 +971,23 @@
goto fail;
}
} else {
+ struct group *grp;
/*
* Default permissions for new [g]shadow files.
*/
sb.st_mode = db->st_mode;
sb.st_uid = db->st_uid;
sb.st_gid = db->st_gid;
+
+ /*
+ * Try to retrieve the shadow's GID, and fall back to GID 0.
+ */
+ if (sb.st_gid == 0) {
+ if ((grp = getgrnam("shadow")) != NULL)
+ sb.st_gid = grp->gr_gid;
+ else
+ sb.st_gid = 0;
+ }
}
snprintf (buf, sizeof buf, "%s+", db->filename);
--- a/lib/sgroupio.c
+++ b/lib/sgroupio.c
@@ -206,7 +206,7 @@
#ifdef WITH_SELINUX
NULL, /* scontext */
#endif
- 0400, /* st_mode */
+ 0440, /* st_mode */
0, /* st_uid */
0, /* st_gid */
NULL, /* head */
--- a/lib/shadowio.c
+++ b/lib/shadowio.c
@@ -84,7 +84,7 @@
#ifdef WITH_SELINUX
NULL, /* scontext */
#endif /* WITH_SELINUX */
- 0400, /* st_mode */
+ 0440, /* st_mode */
0, /* st_uid */
0, /* st_gid */
NULL, /* head */

View File

@@ -1,41 +0,0 @@
From: Balint Reczey <balint@balintreczey.hu>
Description: Keep using Debian's adduser defaults
Upstream's bbf4b79bc49fd1826eb41f6629669ef0b647267b commit
in 4.9 merged those values from upstream's default configuration file
which is not shipped in Debian.
This patch keeps the program's compiled in defaults in sync with the
configuration files shipped in Debian (debian/default/useradd).
Bug: https://github.com/shadow-maint/shadow/issues/501
Bug-Debian: https://bugs.debian.org/1004710
Forwarded: not-needed
--- a/src/useradd.c
+++ b/src/useradd.c
@@ -79,12 +79,12 @@
/*
* These defaults are used if there is no defaults file.
*/
-static gid_t def_group = 1000;
+static gid_t def_group = 100;
static const char *def_gname = "other";
static const char *def_home = "/home";
static const char *def_shell = "/bin/bash";
static const char *def_template = SKEL_DIR;
-static const char *def_create_mail_spool = "yes";
+static const char *def_create_mail_spool = "no";
static const char *def_log_init = "yes";
static long def_inactive = -1;
diff --git a/man/useradd.8.xml b/man/useradd.8.xml
index af02a23f..c7f95b47 100644
--- a/man/useradd.8.xml
+++ b/man/useradd.8.xml
@@ -248,7 +248,7 @@
command line), useradd will set the primary group of the new
user to the value specified by the <option>GROUP</option>
variable in <filename>/etc/default/useradd</filename>, or
- 1000 by default.
+ 100 by default.
</para>
</listitem>
</varlistentry>

View File

@@ -1,201 +0,0 @@
Goal: Document the shadowconfig utility
Status wrt upstream: The shadowconfig utility is debian specific.
Its man page also (but it used to be distributed)
Index: git/man/shadowconfig.8
===================================================================
--- /dev/null
+++ git/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\&.
+
Index: git/man/shadowconfig.8.xml
===================================================================
--- /dev/null
+++ git/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>
Index: git/man/fr/shadowconfig.8
===================================================================
--- /dev/null
+++ git/man/fr/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>.
Index: git/man/ja/shadowconfig.8
===================================================================
--- /dev/null
+++ git/man/ja/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 shadowconfig
+は何らかの間違いがあると、エラーメッセージを表示し、
+ゼロではない返り値を返す。
+もしそのようなことが起こった場合、エラーを修正し、再度実行しなければならない。
+shadow パスワードの設定がすでにオンの場合にオンに設定したり、
+すでにオフの場合にオフに設定しても、何の影響もない。
+
+.I /usr/share/doc/passwd/README.debian.gz
+には shadow パスワードとそれに関する特徴の簡単な紹介が書かれている。
Index: git/man/pl/shadowconfig.8
===================================================================
--- /dev/null
+++ git/man/pl/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.

View File

@@ -1,36 +0,0 @@
Goal: Recommend using adduser and deluser.
Fixes: #406046
Status wrt upstream: Debian specific patch.
--- a/man/useradd.8.xml
+++ b/man/useradd.8.xml
@@ -83,6 +83,12 @@
<refsect1 id='description'>
<title>DESCRIPTION</title>
<para>
+ <command>useradd</command> is a low level utility for adding
+ users. On Debian, administrators should usually use
+ <citerefentry><refentrytitle>adduser</refentrytitle>
+ <manvolnum>8</manvolnum></citerefentry> instead.
+ </para>
+ <para>
When invoked without the <option>-D</option> option, the
<command>useradd</command> command creates a new user account using
the values specified on the command line plus the default values from
--- a/man/userdel.8.xml
+++ b/man/userdel.8.xml
@@ -59,6 +59,12 @@
<refsect1 id='description'>
<title>DESCRIPTION</title>
<para>
+ <command>userdel</command> is a low level utility for removing
+ users. On Debian, administrators should usually use
+ <citerefentry><refentrytitle>deluser</refentrytitle>
+ <manvolnum>8</manvolnum></citerefentry> instead.
+ </para>
+ <para>
The <command>userdel</command> command modifies the system account
files, deleting all entries that refer to the user name <emphasis
remap='I'>LOGIN</emphasis>. The named user must exist.

View File

@@ -1,111 +0,0 @@
Goal: Relaxed usernames/groupnames checking patch.
Status wrt upstream: Debian specific. Not to be used upstream
Details:
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
--- a/libmisc/chkname.c
+++ b/libmisc/chkname.c
@@ -32,44 +32,26 @@
}
/*
- * User/group names must match gnu e-regex:
- * [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[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;
}
bool is_valid_user_name (const char *name)
--- a/man/useradd.8.xml
+++ b/man/useradd.8.xml
@@ -708,6 +708,14 @@
the <command>ls</command> output.
</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>
+ <para>
Usernames may only be up to 32 characters long.
</para>
</refsect1>
--- a/man/groupadd.8.xml
+++ b/man/groupadd.8.xml
@@ -72,6 +72,12 @@
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>
</refsect1>

View File

@@ -1,40 +0,0 @@
Goal: accepts the -O flag for backward compatibility. (was used by adduser?)
Note: useradd.8 needs to be regenerated.
Status wrt upstream: not included as this is just specific
backward compatibility for Debian
--- a/man/useradd.8.xml
+++ b/man/useradd.8.xml
@@ -326,6 +326,11 @@
=<replaceable>100</replaceable>&nbsp;<option>-K</option>&nbsp;
<replaceable>UID_MAX</replaceable>=<replaceable>499</replaceable>
</para>
+ <para>
+ For the compatibility with previous Debian's
+ <command>useradd</command>, the <option>-O</option> option is
+ also supported.
+ </para>
<!--para>
Note: <option>-K</option>&nbsp;<replaceable>UID_MIN</replaceable>=<replaceable>10</replaceable>,<replaceable>UID_MAX</replaceable>=<replaceable>499</replaceable>
doesn't work yet.
--- a/src/useradd.c
+++ b/src/useradd.c
@@ -1227,7 +1227,7 @@
{NULL, 0, NULL, '\0'}
};
while ((c = getopt_long (argc, argv,
- "b:c:d:De:f:g:G:hk:K:lmMNop:rR:P:s:u:U"
+ "b:c:d:De:f:g:G:hk:O:K:lmMNop:rR:P:s:u:U"
#ifdef WITH_SELINUX
"Z:"
#endif /* WITH_SELINUX */
@@ -1367,6 +1367,7 @@
kflg = true;
break;
case 'K':
+ case 'O': /* compatibility with previous Debian useradd */
/*
* override login.defs defaults (-K name=value)
* example: -K UID_MIN=100 -K UID_MAX=499

View File

@@ -1,81 +0,0 @@
--- a/debian/passwd.install
+++ b/debian/passwd.install
@@ -9,6 +9,7 @@
usr/sbin/cppw
usr/sbin/groupadd
usr/sbin/groupdel
+usr/sbin/groupmems
usr/sbin/groupmod
usr/sbin/grpck
usr/sbin/grpconv
@@ -33,6 +34,7 @@
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
@@ -59,6 +61,7 @@
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
--- a/debian/passwd.postinst
+++ b/debian/passwd.postinst
@@ -31,6 +31,24 @@
exit 1
)
fi
+ if ! getent group groupmems | grep -q '^groupmems:[^:]*:99'
+ then
+ groupadd -g 99 groupmems || (
+ cat <<EOF
+************************ TESTSUITE *****************************
+Group ID 99 has been allocated for the groupmems group. You have either
+used 99 yourself or created a groupmems group with a different ID.
+Please correct this problem and reconfigure with ``dpkg --configure passwd''.
+
+Note that both user and group IDs in the range 0-99 are globally
+allocated by the Debian project and must be the same on every Debian
+system.
+EOF
+ exit 1
+ )
+# FIXME
+ chgrp groupmems /usr/sbin/groupmems
+ fi
;;
esac
--- a/debian/rules
+++ b/debian/rules
@@ -60,6 +60,7 @@
dh_installpam -p passwd --name=chsh
dh_installpam -p passwd --name=chpasswd
dh_installpam -p passwd --name=newusers
+ dh_installpam -p passwd --name=groupmems
ifeq ($(DEB_HOST_ARCH_OS),hurd)
# login is not built on The Hurd, but some utilities of passwd depends on
# /etc/login.defs.
@@ -87,3 +88,6 @@
chgrp shadow debian/passwd/usr/bin/expiry
chmod g+s debian/passwd/usr/bin/chage
chmod g+s debian/passwd/usr/bin/expiry
+ chgrp groupmems debian/passwd/usr/sbin/groupmems
+ chmod u+s debian/passwd/usr/sbin/groupmems
+ chmod o-x debian/passwd/usr/sbin/groupmems
--- /dev/null
+++ b/debian/passwd.groupmems.pam
@@ -0,0 +1,8 @@
+# The PAM configuration file for the Shadow 'groupmod' service
+#
+
+# This allows root to modify groups without being prompted for a password
+auth sufficient pam_rootok.so
+
+@include common-auth
+@include common-account

View File

@@ -1,76 +0,0 @@
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,6 +1,8 @@
AUTOMAKE_OPTIONS = 1.0 foreign
+CFLAGS += -fprofile-arcs -ftest-coverage
+
DEFS =
noinst_LTLIBRARIES = libshadow.la
--- a/libmisc/Makefile.am
+++ b/libmisc/Makefile.am
@@ -1,6 +1,8 @@
EXTRA_DIST = .indent.pro xgetXXbyYY.c
+CFLAGS += -fprofile-arcs -ftest-coverage
+
INCLUDES = -I$(top_srcdir)/lib
noinst_LIBRARIES = libmisc.a
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,6 +7,8 @@
suidperms = 4755
sgidperms = 2755
+CFLAGS += -fprofile-arcs -ftest-coverage
+
INCLUDES = \
-I${top_srcdir}/lib \
-I$(top_srcdir)/libmisc
--- a/debian/rules
+++ b/debian/rules
@@ -40,6 +40,12 @@
endif
export CFLAGS
+clean:: clean_gcov
+
+clean_gcov:
+ find . -name "*.gcda" -delete
+ find . -name "*.gcno" -delete
+
# Add extras to the install process:
binary-install/login::
dh_installpam -p login
--- a/lib/defines.h
+++ b/lib/defines.h
@@ -174,23 +174,9 @@
trust the formatted time received from the unix domain (or worse,
UDP) socket. -MM */
/* Avoid translated PAM error messages: Set LC_ALL to "C".
+ * This is disabled for coverage testing
* --Nekral */
-#define SYSLOG(x) \
- do { \
- char *old_locale = setlocale (LC_ALL, NULL); \
- char *saved_locale = NULL; \
- if (NULL != old_locale) { \
- saved_locale = strdup (old_locale); \
- } \
- if (NULL != saved_locale) { \
- (void) setlocale (LC_ALL, "C"); \
- } \
- syslog x ; \
- if (NULL != saved_locale) { \
- (void) setlocale (LC_ALL, saved_locale); \
- free (saved_locale); \
- } \
- } while (false)
+#define SYSLOG(x) syslog x
#else /* !ENABLE_NLS */
#define SYSLOG(x) syslog x
#endif /* !ENABLE_NLS */

View File

@@ -0,0 +1,52 @@
From: Chris Hofstaedtler <zeha@debian.org>
Date: Mon, 17 Feb 2025 12:26:07 +0100
Subject: Partially revert "lib/, src/: Use strsep(3) instead of its pattern"
This reverts src/chfn.c from commit 16cb664865541162c504a6f5ef5ca4b38b5e0c9a.
---
src/chfn.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/chfn.c b/src/chfn.c
index 4c96fba..f06cb44 100644
--- a/src/chfn.c
+++ b/src/chfn.c
@@ -216,27 +216,32 @@ static void new_fields (void)
*/
static char *copy_field (char *in, char *out, char *extra)
{
- while (NULL != in) {
- char *f;
+ char *cp = NULL;
- f = strsep(&in, ",");
+ while (NULL != in) {
+ cp = strchr (in, ',');
+ if (NULL != cp) {
+ *cp++ = '\0';
+ }
- if (strchr(f, '=') == NULL)
+ if (strchr (in, '=') == NULL) {
break;
+ }
if (NULL != extra) {
if (!streq(extra, "")) {
strcat (extra, ",");
}
- strcat(extra, f);
+ strcat (extra, in);
}
+ in = cp;
}
if ((NULL != in) && (NULL != out)) {
strcpy (out, in);
}
- return in;
+ return cp;
}
/*

View File

@@ -1,22 +0,0 @@
Small intro to the system for numbering the patches here...
-The 00xx-... patches are forwarded to upstream's git repository
-The 0xx_... series of patches are patches isolated from the latest
version of the shadow Debian package not using quilt in order to
separate upstream from Debian-specific stuff.
NO MORE PATCHES SHOULD BE ADDED IN THESE SERIES
-The 4xx series are patches which have been applied to Debian's shadow
and have NOT been accepted and/or applied upstream. These patches MUST be kept
even after resynced with upstream
-The 5xx series are patches which are applied to Debian's shadow
and will never be proposed upstream because they're too specific
This list SHOULD BE AS SHORT AS POSSIBLE
In short, while we are working towards synchronisation with upstream,
our goal is to make 0xx patches disappear by moving them either to 3xx
series (things already implemented upstream) or to 4xx series
(Debian-specific patches).

View File

@@ -0,0 +1,28 @@
From: Chris Hofstaedtler <zeha@debian.org>
Date: Sun, 16 Feb 2025 20:21:35 +0100
Subject: Revert "lib/strtoday.c: strtoday(): Fix calculation"
This reverts commit 1175932c0c86ee46ee298fd9cfa01653a2ba3a27.
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095430
---
lib/strtoday.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/strtoday.c b/lib/strtoday.c
index 01f2e9b..f947778 100644
--- a/lib/strtoday.c
+++ b/lib/strtoday.c
@@ -67,9 +67,10 @@ long strtoday (const char *str)
return retdate;
}
- t = get_date(str, NULL);
+ t = get_date (str, NULL);
if ((time_t) - 1 == t) {
return -2;
}
- return t / DAY;
+ /* convert seconds to days since 1970-01-01 */
+ return (t + DAY / 2) / DAY;
}

View File

@@ -0,0 +1,517 @@
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 | 375 ++++++++-------------------------------------------------
1 file changed, 47 insertions(+), 328 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$
-#
-#
-# 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)
-#
-FAIL_DELAY 3
-
-#
-# Enable logging and display of /var/log/faillog login(1) failure info.
-#
-FAILLOG_ENAB yes
+# 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(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

View 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 bee2e6b..c3fb552 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/strcmp/streq.h"

View File

@@ -0,0 +1,211 @@
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.
The man page is Debian-specific, but it used to be distributed by
upstream.
---
man/Makefile.am | 1 +
man/fr/Makefile.am | 1 +
man/fr/man8/shadowconfig.8 | 26 ++++++++++++++++++++++++++
man/ja/Makefile.am | 1 +
man/ja/man8/shadowconfig.8 | 25 +++++++++++++++++++++++++
man/man8/shadowconfig.8 | 39 +++++++++++++++++++++++++++++++++++++++
man/pl/Makefile.am | 1 +
man/pl/man8/shadowconfig.8 | 27 +++++++++++++++++++++++++++
8 files changed, 121 insertions(+)
create mode 100644 man/fr/man8/shadowconfig.8
create mode 100644 man/ja/man8/shadowconfig.8
create mode 100644 man/man8/shadowconfig.8
create mode 100644 man/pl/man8/shadowconfig.8
diff --git a/man/Makefile.am b/man/Makefile.am
index 1405509..0e88fea 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -36,6 +36,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/Makefile.am b/man/fr/Makefile.am
index 2365e23..e175a15 100644
--- a/man/fr/Makefile.am
+++ b/man/fr/Makefile.am
@@ -31,6 +31,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
new file mode 100644
index 0000000..784da70
--- /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 b759726..b9f1df0 100644
--- a/man/ja/Makefile.am
+++ b/man/ja/Makefile.am
@@ -26,6 +26,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 shadowconfig
+は何らかの間違いがあると、エラーメッセージを表示し、
+ゼロではない返り値を返す。
+もしそのようなことが起こった場合、エラーを修正し、再度実行しなければならない。
+shadow パスワードの設定がすでにオンの場合にオンに設定したり、
+すでにオフの場合にオフに設定しても、何の影響もない。
+
+.I /usr/share/doc/passwd/README.debian.gz
+には shadow パスワードとそれに関する特徴の簡単な紹介が書かれている。
diff --git a/man/man8/shadowconfig.8 b/man/man8/shadowconfig.8
new file mode 100644
index 0000000..ec11fc6
--- /dev/null
+++ b/man/man8/shadowconfig.8
@@ -0,0 +1,39 @@
+.TH shadowconfig 8 2025-01-01 "Debian shadow-utils"
+.SH Name
+shadowconfig \- toggle shadow passwords on and off
+.
+.
+.SH Synopsis
+.SY shadowconfig
+.BR on | off
+.YS
+.
+.
+.SH Description
+.I shadowconfig\ on
+will turn shadow passwords on.
+.P
+.I shadowconfig\ off
+will turn shadow passwords off.
+.
+.
+.SH Errors
+.B shadowconfig
+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.
+.
+.
+.SH Caveats
+Turning shadow passwords off and on again
+will lose all password aging information.
+.
+.
+.SH See also
+Read
+.I /usr/share/doc/passwd/README.Debian
+for a brief introduction to shadow passwords and related features.
diff --git a/man/pl/Makefile.am b/man/pl/Makefile.am
index 2a015f3..04093ec 100644
--- a/man/pl/Makefile.am
+++ b/man/pl/Makefile.am
@@ -17,6 +17,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.

View File

@@ -0,0 +1,52 @@
From: Balint Reczey <balint@balintreczey.hu>
Date: Sat, 22 Jun 2024 17:39:41 +0200
Subject: Keep using Debian's adduser defaults
Bug: https://github.com/shadow-maint/shadow/issues/501
Bug-Debian: https://bugs.debian.org/1004710
Forwarded: not-needed
Upstream's bbf4b79bc49fd1826eb41f6629669ef0b647267b commit
in 4.9 merged those values from upstream's default configuration file
which is not shipped in Debian.
This patch keeps the program's compiled in defaults in sync with the
configuration files shipped in Debian (debian/default/useradd).
---
man/useradd.8.xml | 2 +-
src/useradd.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/useradd.8.xml b/man/useradd.8.xml
index 001e7d1..4888100 100644
--- a/man/useradd.8.xml
+++ b/man/useradd.8.xml
@@ -248,7 +248,7 @@
command line), useradd will set the primary group of the new
user to the value specified by the <option>GROUP</option>
variable in <filename>/etc/default/useradd</filename>, or
- 1000 by default.
+ 100 by default.
</para>
</listitem>
</varlistentry>
diff --git a/src/useradd.c b/src/useradd.c
index 7623dab..954b329 100644
--- a/src/useradd.c
+++ b/src/useradd.c
@@ -96,14 +96,14 @@ static const char Prog[] = "useradd";
/*
* These defaults are used if there is no defaults file.
*/
-static gid_t def_group = 1000;
+static gid_t def_group = 100;
static const char *def_groups = "";
static const char *def_gname = "other";
static const char *def_home = "/home";
static const char *def_shell = "/bin/bash";
static const char *def_template = SKEL_DIR;
static const char *def_usrtemplate = USRSKELDIR;
-static const char *def_create_mail_spool = "yes";
+static const char *def_create_mail_spool = "no";
static const char *def_log_init = "yes";
static long def_inactive = -1;

View File

@@ -0,0 +1,46 @@
From: Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>
Date: Sat, 22 Jun 2024 17:39:41 +0200
Subject: Recommend using adduser and deluser
Fixes: #406046
Status wrt upstream: Debian specific patch.
---
man/useradd.8.xml | 6 ++++++
man/userdel.8.xml | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/man/useradd.8.xml b/man/useradd.8.xml
index 4888100..17987a6 100644
--- a/man/useradd.8.xml
+++ b/man/useradd.8.xml
@@ -82,6 +82,12 @@
<refsect1 id='description'>
<title>DESCRIPTION</title>
+ <para>
+ <command>useradd</command> is a low level utility for adding
+ users. On Debian, administrators should usually use
+ <citerefentry><refentrytitle>adduser</refentrytitle>
+ <manvolnum>8</manvolnum></citerefentry> instead.
+ </para>
<para>
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 32851f1..4373cd8 100644
--- a/man/userdel.8.xml
+++ b/man/userdel.8.xml
@@ -58,6 +58,12 @@
<refsect1 id='description'>
<title>DESCRIPTION</title>
+ <para>
+ <command>userdel</command> is a low level utility for removing
+ users. On Debian, administrators should usually use
+ <citerefentry><refentrytitle>deluser</refentrytitle>
+ <manvolnum>8</manvolnum></citerefentry> instead.
+ </para>
<para>
The <command>userdel</command> command modifies the system account
files, deleting all entries that refer to the user name <emphasis

View File

@@ -0,0 +1,75 @@
From: Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>
Date: Sat, 22 Jun 2024 17:39:41 +0200
Subject: Set group and mode for [g]shadow files
Set group 'shadow' and mode 0400.
Fixes: #166793
---
lib/commonio.c | 12 ++++++++++++
lib/sgroupio.c | 2 +-
lib/shadowio.c | 2 +-
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/lib/commonio.c b/lib/commonio.c
index 4d83e83..51e6300 100644
--- a/lib/commonio.c
+++ b/lib/commonio.c
@@ -21,6 +21,7 @@
#include <sys/stat.h>
#include <stdlib.h>
#include <utime.h>
+#include <grp.h>
#include "alloc/malloc.h"
#include "alloc/reallocf.h"
@@ -953,12 +954,23 @@ int commonio_close (struct commonio_db *db)
if (errors != 0)
goto fail;
} else {
+ struct group *grp;
/*
* Default permissions for new [g]shadow files.
*/
sb.st_mode = db->st_mode;
sb.st_uid = db->st_uid;
sb.st_gid = db->st_gid;
+
+ /*
+ * Try to retrieve the shadow's GID, and fall back to GID 0.
+ */
+ if (sb.st_gid == 0) {
+ if ((grp = getgrnam("shadow")) != NULL)
+ sb.st_gid = grp->gr_gid;
+ else
+ sb.st_gid = 0;
+ }
}
if (SNPRINTF(buf, "%s+", db->filename) == -1)
diff --git a/lib/sgroupio.c b/lib/sgroupio.c
index acb140d..6ffccd1 100644
--- a/lib/sgroupio.c
+++ b/lib/sgroupio.c
@@ -210,7 +210,7 @@ static struct commonio_db gshadow_db = {
#ifdef WITH_SELINUX
NULL, /* scontext */
#endif
- 0400, /* st_mode */
+ 0440, /* st_mode */
0, /* st_uid */
0, /* st_gid */
NULL, /* head */
diff --git a/lib/shadowio.c b/lib/shadowio.c
index d2c3b47..53dac0b 100644
--- a/lib/shadowio.c
+++ b/lib/shadowio.c
@@ -85,7 +85,7 @@ static struct commonio_db shadow_db = {
#ifdef WITH_SELINUX
NULL, /* scontext */
#endif /* WITH_SELINUX */
- 0400, /* st_mode */
+ 0440, /* st_mode */
0, /* st_uid */
0, /* st_gid */
NULL, /* head */

View File

@@ -0,0 +1,566 @@
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 | 16 ----------------
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(+), 122 deletions(-)
diff --git a/man/Makefile.am b/man/Makefile.am
index 0e88fea..18c012d 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,22 +23,16 @@ 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 \
- man5/suauth.5 \
man8/useradd.8 \
man8/userdel.8 \
man8/usermod.8 \
@@ -82,8 +74,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 +86,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 +96,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 e175a15..d4cb276 100644
--- a/man/fr/Makefile.am
+++ b/man/fr/Makefile.am
@@ -8,35 +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 \
man8/shadowconfig.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 b9f1df0..07fa208 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,10 +14,7 @@ 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 \
@@ -27,10 +22,7 @@ man_MANS = \
man8/pwconv.8 \
man8/pwunconv.8 \
man8/shadowconfig.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 04093ec..ba91f47 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 \
man8/shadowconfig.8 \
man3/shadow.3 \
man8/userdel.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 d4e6f3a..78722ad 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 =

View File

@@ -0,0 +1,89 @@
From: Serge Hallyn <serge@hallyn.com>
Date: Thu, 27 Jun 2024 01:23:05 +0200
Subject: upstream testsuite: disable su tests
Debian uses su from util-linux, pointless/impossible to test shadow's su
here.
---
tests/run_some | 68 ----------------------------------------------------------
1 file changed, 68 deletions(-)
diff --git a/tests/run_some b/tests/run_some
index c58f59b..46317eb 100755
--- a/tests/run_some
+++ b/tests/run_some
@@ -79,74 +79,6 @@ echo "-: test failed"
find "${build_path}" -name "*.gcda" -delete
# ignore the result of the first test. ~magic~
run_test ./su/01/su_user.test ignore_failure
-run_test ./su/01/su_user.test
-run_test ./su/01/su_root.test
-find "${build_path}" -name "*.gcda" -exec chmod a+rw {} \;
-run_test ./su/02/env_FOO-options_--login
-run_test ./su/02/env_FOO-options_--login_bash
-run_test ./su/02/env_FOO-options_--preserve-environment
-run_test ./su/02/env_FOO-options_--preserve-environment_bash
-run_test ./su/02/env_FOO-options_-
-run_test ./su/02/env_FOO-options_-_bash
-run_test ./su/02/env_FOO-options_-l-m
-run_test ./su/02/env_FOO-options_-l-m_bash
-run_test ./su/02/env_FOO-options_-l
-run_test ./su/02/env_FOO-options_-l_bash
-run_test ./su/02/env_FOO-options_-m_bash
-run_test ./su/02/env_FOO-options_-m
-run_test ./su/02/env_FOO-options_-p
-run_test ./su/02/env_FOO-options_-p_bash
-run_test ./su/02/env_FOO-options__bash
-run_test ./su/02/env_FOO-options_
-run_test ./su/02/env_FOO-options_-p-
-run_test ./su/02/env_FOO-options_-p-_bash
-run_test ./su/02/env_special-options_-l-p
-run_test ./su/02/env_special-options_-l
-run_test ./su/02/env_special-options_-l-p_bash
-run_test ./su/02/env_special-options_-l_bash
-run_test ./su/02/env_special-options_-p
-run_test ./su/02/env_special-options_-p_bash
-run_test ./su/02/env_special-options_
-run_test ./su/02/env_special-options__bash
-run_test ./su/02/env_special_root-options_-l-p
-run_test ./su/02/env_special_root-options_-l-p_bash
-run_test ./su/02/env_special_root-options_-l
-run_test ./su/02/env_special_root-options_-l_bash
-run_test ./su/02/env_special_root-options_-p
-run_test ./su/02/env_special_root-options_-p_bash
-run_test ./su/02/env_special_root-options_
-run_test ./su/02/env_special_root-options__bash
-run_test ./su/03/su_run_command01.test
-run_test ./su/03/su_run_command02.test
-run_test ./su/03/su_run_command03.test
-run_test ./su/03/su_run_command04.test
-run_test ./su/03/su_run_command05.test
-run_test ./su/03/su_run_command06.test
-run_test ./su/03/su_run_command07.test
-run_test ./su/03/su_run_command08.test
-run_test ./su/03/su_run_command09.test
-run_test ./su/03/su_run_command10.test
-run_test ./su/03/su_run_command11.test
-run_test ./su/03/su_run_command12.test
-run_test ./su/03/su_run_command13.test
-run_test ./su/03/su_run_command14.test
-run_test ./su/03/su_run_command15.test
-run_test ./su/03/su_run_command16.test
-run_test ./su/03/su_run_command17.test
-run_test ./su/04/su_wrong_user.test
-run_test ./su/04/su_user_wrong_passwd.test
-run_test ./su/04/su_user_wrong_passwd_syslog.test
-run_test ./su/05/su_user_wrong_passwd_syslog.test
-run_test ./su/06/su_user_syslog.test
-run_test ./su/07/su_user_syslog.test
-run_test ./su/08/env_special-options_
-run_test ./su/08/env_special_root-options_
-run_test ./su/09/env_special-options_
-run_test ./su/09/env_special_root-options_
-run_test ./su/10_su_sulog_success/su.test
-run_test ./su/11_su_sulog_failure/su.test
-run_test ./su/12_su_child_failure/su.test
-run_test ./su/13_su_child_success/su.test
run_test ./libsubid/01_list_ranges/list_ranges.test
run_test ./libsubid/02_get_subid_owners/get_subid_owners.test
run_test ./libsubid/03_add_remove/add_remove_subids.test

39
debian/patches/series vendored
View File

@@ -1,26 +1,13 @@
# Debian #1122913
upstream/10429edc14673fbb8c78b25f1872c34e88e5f07f.patch
# CVE-2023-4641
0001-gpasswd-1-Fix-password-leak.patch
# CVE-2023-29383
0002-Added-control-character-check.patch
0003-Overhaul-valid_field.patch
# These patches are only for the testsuite:
#900_testsuite_groupmems
#901_testsuite_gcov
008_login_log_failure_in_FTMP
401_cppw_src.dpatch
# 402 should be merged in 401, but should be reviewed by SE Linux experts first
402_cppw_selinux
429_login_FAILLOG_ENAB
463_login_delay_obeys_to_PAM
501_commonio_group_shadow
502_debian_useradd_defaults
503_shadowconfig.8
505_useradd_recommend_adduser
506_relaxed_usernames
542_useradd-O_option
debian/Set-group-and-mode-for-g-shadow-files.patch
debian/Keep-using-Debian-adduser-defaults.patch
debian/Document-the-shadowconfig-utility.patch
debian/Recommend-using-adduser-and-deluser.patch
debian/tests-disable-su.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
upstream/a015e919834c90b99947829c6c823f7fe93a8097-E_BAD_NAME.patch
upstream/man-useradd.8.xml-Document-new-exit-code-19-E_BAD_NAME.patch
upstream/Revert-lib-src-Use-local-time-for-human-readable-dates.patch
Revert-lib-strtoday.c-strtoday-Fix-calculation.patch
Partially-revert-lib-src-Use-strsep-3-instead-of-its-patt.patch

View File

@@ -1,54 +0,0 @@
From 10429edc14673fbb8c78b25f1872c34e88e5f07f Mon Sep 17 00:00:00 2001
From: lixinyun <li.xinyun@h3c.com>
Date: Wed, 29 May 2024 06:53:02 +0800
Subject: [PATCH] src/groupmod.c: delete gr_free_members(&grp) to avoid double
free
Groupmod -U may cause crashes because of double free. If without -a, the first free of (*ogrp).gr_mem is in gr_free_members(&grp), and then in gr_update without -n or gr_remove with -n.
Considering the minimal impact of modifications on existing code, delete gr_free_members(&grp) to avoid double free.Although this may seem reckless, the second free in two different positions will definitely be triggered, and the following two test cases can be used to illustrate the situation :
[root@localhost src]# ./useradd u1
[root@localhost src]# ./useradd u2
[root@localhost src]# ./useradd u3
[root@localhost src]# ./groupadd -U u1,u2,u3 g1
[root@localhost src]# ./groupmod -n g2 -U u1,u2 g1
Segmentation fault
This case would free (*ogrp).gr_mem in gr_free_members(&grp) due to assignment statements grp = *ogrp, then in if (nflg && (gr_remove (group_name) == 0)), which finally calls gr_free_members(grent) to free (*ogrp).gr_mem again.
[root@localhost src]# ./useradd u1
[root@localhost src]# ./useradd u2
[root@localhost src]# ./useradd u3
[root@localhost src]# ./groupadd -U u1,u2,u3 g1
[root@localhost src]# ./groupmod -U u1,u2 g1
Segmentation fault
The other case would free (*ogrp).gr_mem in gr_free_members(&grp) too, then in if (gr_update (&grp) == 0), which finally calls gr_free_members(grent) too to free (*ogrp).gr_mem again.
So the first free is unnecessary, maybe we can drop it.
Fixes: 342c934a3590 ("add -U option to groupadd and groupmod")
Closes: <https://github.com/shadow-maint/shadow/issues/1013>
Link: <https://github.com/shadow-maint/shadow/pull/1007>
Link: <https://github.com/shadow-maint/shadow/pull/271>
Link: <https://github.com/shadow-maint/shadow/issues/265>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: lixinyun <li.xinyun@h3c.com>
---
src/groupmod.c | 2 --
1 file changed, 2 deletions(-)
diff --git i/src/groupmod.c w/src/groupmod.c
index 006eca1c..7eae4c6f 100644
--- i/src/groupmod.c
+++ w/src/groupmod.c
@@ -244,8 +244,6 @@ static void grp_update (void)
if (!aflg) {
// requested to replace the existing groups
- if (NULL != grp.gr_mem[0])
- gr_free_members(&grp);
grp.gr_mem = (char **)xmalloc(sizeof(char *));
grp.gr_mem[0] = (char *)0;
} else {

View File

@@ -0,0 +1,70 @@
From: Alejandro Colomar <alx@kernel.org>
Date: Fri, 14 Feb 2025 21:25:01 +0100
Subject: Revert "lib/, src/: Use local time for human-readable dates"
This reverts commit 3f5b4b56268269fefed55aa106f382037297d663.
The dates are stored as UTC, and are stored as a number of days since
Epoch. We don't have enough precision to translate it into local time.
Using local time has caused endless issues in users.
This patch is not enough for fixing this issue completely, since
printing a date without time-zone information means that the date is a
local date, but what we're printing is a UTC date. A future patch
should add time-zone information to the date.
For now, let's revert this change that has caused so many issues.
Fixes: 3f5b4b562682 (2024-08-01; "lib/, src/: Use local time for human-readable dates")
Link: <https://github.com/ansible/ansible/blob/devel/test/integration/targets/user/tasks/test_expires.yml#L2-L20>
Link: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095430>
Link: <https://lists.iana.org/hyperkitty/list/tz@iana.org/message/ENE5IFV3GAH6WK22UJ6YU57D6TQINSP5/>
Link: <https://github.com/shadow-maint/shadow/issues/1202>
Link: <https://github.com/shadow-maint/shadow/issues/1057>
Link: <https://github.com/shadow-maint/shadow/issues/939>
Link: <https://github.com/shadow-maint/shadow/pull/1058>
Link: <https://github.com/shadow-maint/shadow/pull/1059#issuecomment-2309888519>
Link: <https://github.com/shadow-maint/shadow/pull/952>
Link: <https://github.com/shadow-maint/shadow/pull/942>
Reported-by: Chris Hofstaedtler <zeha@debian.org>
Reported-by: Gus Kenion <https://github.com/kenion>
Reported-by: Alejandro Colomar <alx@kernel.org>
Reported-by: Michael Vetter <jubalh@iodoru.org>
Reported-by: Lee Garrett <lgarrett@rocketjump.eu>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Cc: Tim Parenti <tim@timtimeonline.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
lib/time/day_to_str.h | 2 +-
src/chage.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/time/day_to_str.h b/lib/time/day_to_str.h
index b70e989..fe3308d 100644
--- a/lib/time/day_to_str.h
+++ b/lib/time/day_to_str.h
@@ -38,7 +38,7 @@ day_to_str(size_t size, char buf[size], long day)
return;
}
- if (localtime_r(&date, &tm) == NULL) {
+ if (gmtime_r(&date, &tm) == NULL) {
strtcpy(buf, "future", size);
return;
}
diff --git a/src/chage.c b/src/chage.c
index a7933e0..67e7e77 100644
--- a/src/chage.c
+++ b/src/chage.c
@@ -243,7 +243,7 @@ print_day_as_date(long day)
return;
}
- if (localtime_r(&date, &tm) == NULL) {
+ if (gmtime_r(&date, &tm) == NULL) {
puts(_("future"));
return;
}

View File

@@ -0,0 +1,38 @@
From: Alejandro Colomar <alx@kernel.org>
Date: Thu, 5 Dec 2024 17:38:54 +0100
Subject: [PATCH] src/useradd.c: E_BAD_NAME: Use a different error code for
bad login names
Wrappers like adduser(8) want to do their own stuff if the login name is
bad. For that, they need to be able to differentiate such an error.
Closes: <https://github.com/shadow-maint/shadow/issues/1103>
Suggested-by: Chris Hofstaedtler <zeha@debian.org>
Cc: Marc 'Zugschlus' Haber <mh+githubvisible@zugschlus.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Bug-Debian: 1074306
---
src/useradd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/useradd.c b/src/useradd.c
index 954b329..92f8054 100644
--- a/src/useradd.c
+++ b/src/useradd.c
@@ -201,6 +201,7 @@ static bool home_added = false;
#define E_SUB_UID_UPDATE 16 /* can't update the subordinate uid file */
#define E_SUB_GID_UPDATE 18 /* can't update the subordinate gid file */
#endif /* ENABLE_SUBIDS */
+#define E_BAD_NAME 19 /* Bad login name */
#define DGROUP "GROUP"
#define DGROUPS "GROUPS"
@@ -1549,7 +1550,7 @@ static void process_flags (int argc, char **argv)
user_name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE);
#endif
- exit (E_BAD_ARG);
+ exit (E_BAD_NAME);
}
if (!dflg) {
char *uh;

View File

@@ -0,0 +1,31 @@
From: Marc Haber <mh+debian-packages@zugschlus.de>
Date: Thu, 5 Dec 2024 18:54:17 +0100
Subject: man/useradd.8.xml: Document new exit code 19 (E_BAD_NAME)
Link: <https://github.com/shadow-maint/shadow/issues/1103>
Link: <https://github.com/shadow-maint/shadow/pull/1141>
Signed-off-by: Marc 'Zugschlus' Haber <mh+githubvisible@zugschlus.de>
Cc: Chris Hofstaedtler <zeha@debian.org>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
man/useradd.8.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/man/useradd.8.xml b/man/useradd.8.xml
index 17987a6..dbdd9b1 100644
--- a/man/useradd.8.xml
+++ b/man/useradd.8.xml
@@ -898,6 +898,12 @@
<para>can't update SELinux user mapping</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><replaceable>19</replaceable></term>
+ <listitem>
+ <para>invalid user or group name</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</para>
</refsect1>

60
debian/rules vendored
View File

@@ -4,22 +4,37 @@
# 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 := --without-libcrack \
DEB_CONFIGURE_EXTRA_FLAGS := \
--mandir=/usr/share/man \
--with-libpam \
--with-yescrypt \
--enable-shadowgrp \
--enable-subordinate-ids \
--enable-lastlog=no \
--enable-man \
--disable-account-tools-setuid \
--with-group-name-max-length=32 \
--without-acl \
--without-attr \
--with-acl \
--with-attr \
--without-su \
--without-tcb \
SHELL=/bin/sh
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)),)
DEB_CONFIGURE_EXTRA_FLAGS += --disable-man
endif
DEB_CONFIGURE_EXTRA_FLAGS += SHELL=/bin/sh
# Set the default editor for vipw/vigr
CFLAGS += -DDEFAULT_EDITOR="\"sensible-editor\""
@@ -28,51 +43,14 @@ CFLAGS += -DDEFAULT_EDITOR="\"sensible-editor\""
dh $@
override_dh_auto_configure:
cp debian/HOME_MODE.xml man/login.defs.d/HOME_MODE.xml
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/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_builddeb-arch:
# uidmap
chmod u+s debian/uidmap/usr/bin/newuidmap
chmod u+s debian/uidmap/usr/bin/newgidmap
# login
# No real need for login to be setuid root
# chmod u+s debian/login/bin/login
chmod u+s debian/login/usr/bin/newgrp
# passwd
chmod u+s debian/passwd/usr/bin/chfn
chmod u+s debian/passwd/usr/bin/chsh
chmod u+s debian/passwd/usr/bin/gpasswd
chmod u+s debian/passwd/usr/bin/passwd
chgrp shadow debian/passwd/usr/bin/chage
chgrp shadow debian/passwd/usr/bin/expiry
chmod g+s debian/passwd/usr/bin/chage
chmod g+s debian/passwd/usr/bin/expiry
dh_builddeb -a
override_dh_auto_clean:
sed -i 's/# Linux only # //' debian/login.pam
dh_auto_clean
override_dh_clean:
dh_clean ./man/login.defs.d/HOME_MODE.xml

40
debian/salsa-ci.yml vendored Normal file
View 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

1
debian/shlibs.local vendored Normal file
View File

@@ -0,0 +1 @@
deb: libsubid 5 libsubid5 (= ${binary:Version})

6
debian/source/lintian-overrides vendored Normal file
View 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

10
debian/tests/control vendored
View File

@@ -1,2 +1,10 @@
Tests: smoke
Restrictions: needs-root superficial
Restrictions: needs-root, superficial
Tests: upstream
Depends:
expect,
procps,
@,
@builddeps@
Restrictions: needs-root, build-needed, breaks-testbed, allow-stderr, isolation-machine

15
debian/tests/upstream vendored Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
useradd ubuntu
export BUILD_BASE_DIR=$(pwd)
cd tests
cleanup() {
cp testsuite.log $AUTOPKGTEST_ARTIFACTS/
cat testsuite.log
}
trap cleanup TERM EXIT
./run_some 2>&1

View File

@@ -1,3 +1,3 @@
bin/getsubids usr/bin
usr/bin/newuidmap
usr/bin/newgidmap
usr/bin/newuidmap

File diff suppressed because it is too large Load Diff

1
debian/watch vendored
View File

@@ -1,6 +1,7 @@
version=4
opts=downloadurlmangle=s/archive\/refs\/tags\/(.*)\.tar\.gz/releases\/download\/$1\/@PACKAGE@-$1\.tar\.xz/,\
pgpsigurlmangle=s/$/.asc/,\
versionmangle=s/-(alpha|beta|rc)/~$1/,\
dversionmangle=s/\+dfsg1//,repacksuffix=+dfsg1 \
https://github.com/shadow-maint/@PACKAGE@/tags \
/shadow-maint/@PACKAGE@/archive/refs/tags/([^v].*)\.tar\.gz

View File

@@ -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:

View File

@@ -1,5 +1,4 @@
# This is a dummy Makefile.am to get automake work flawlessly,
# and also cooperate to make a distribution for `make dist'
EXTRA_DIST = HOWTO README.limits \
README.platforms WISHLIST console.c.spec.txt cracklib26.diff
EXTRA_DIST = HOWTO README.limits

View File

@@ -141,6 +141,8 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
@@ -174,9 +176,15 @@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBACL = @LIBACL@
LIBADD_DL = @LIBADD_DL@
LIBADD_DLD_LINK = @LIBADD_DLD_LINK@
LIBADD_DLOPEN = @LIBADD_DLOPEN@
LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
LIBATTR = @LIBATTR@
LIBAUDIT = @LIBAUDIT@
LIBCRACK = @LIBCRACK@
LIBBSD = @LIBBSD@
LIBBSD_CFLAGS = @LIBBSD_CFLAGS@
LIBBSD_LIBS = @LIBBSD_LIBS@
LIBCRYPT = @LIBCRYPT@
LIBECONF = @LIBECONF@
LIBICONV = @LIBICONV@
@@ -192,6 +200,7 @@ LIBSUBID_ABI = @LIBSUBID_ABI@
LIBSUBID_ABI_MAJOR = @LIBSUBID_ABI_MAJOR@
LIBSUBID_ABI_MICRO = @LIBSUBID_ABI_MICRO@
LIBSUBID_ABI_MINOR = @LIBSUBID_ABI_MINOR@
LIBSYSTEMD = @LIBSYSTEMD@
LIBTCB = @LIBTCB@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
@@ -200,6 +209,8 @@ LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_DLLOADERS = @LT_DLLOADERS@
LT_DLPREOPEN = @LT_DLPREOPEN@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
@@ -222,6 +233,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
RANLIB = @RANLIB@
SED = @SED@
@@ -293,9 +307,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = HOWTO README.limits \
README.platforms WISHLIST console.c.spec.txt cracklib26.diff
EXTRA_DIST = HOWTO README.limits
all: all-am
.SUFFIXES:

View File

@@ -1,33 +0,0 @@
# $Id$
#
# This is the current (still incomplete) list of platforms this
# package has been verified to work on. Additions (preferably
# in the format as described below) are welcome. Thanks!
#
# V: last version reported to work
# H: host type
# L: Linux libc version
# D: Linux distribution, or other OS name and version
# C: changes (if any)
# R: reported by
V: 980529
H: sparc-unknown-linux-gnu
L: glibc-2.0.7
D: Ultrapenguin-1.0.9
C: had to explicitly disable desrpc.
R: Bjorn Christianson <bjorn@cascade.psychology.mcmaster.ca>
V: 980724
H: i486-pc-linux-gnulibc1
L: libc-5.4.33
D: Debian-1.3.1.r6
C: none (use dpkg-buildpackage)
R: Marek Michalkiewicz <marekm@linux.org.pl>
V: current
H: i686-pc-linux-gnu
L: glibc-2.0.7.19981211
D: Debian-2.1
C: none (use dpkg-buildpackage)
R: Marek Michalkiewicz <marekm@linux.org.pl>

View File

@@ -1,39 +0,0 @@
$Id$
This is my wishlist for the shadow suite, in no particular order. Feel
free to do anything from this list and mail me the diffs :-).
Patches in diff -u format, against the latest version (sometimes in the
"beta" directory) are preferred and make my job easier. Please, no
MIME, base64, quoted-printable, or HTML. For very big patches, or if
your mailer can corrupt them, please use gzip and uuencode. Thanks!
New ideas to add to this list are welcome, too. --marekm
- fix all the bugs, of course
- implement "su only" accounts (no logins, only su from other account)
- rewrite getdef.c to be more general? (no hardcoded names)
- patch for rlogind/telnetd to create utmp entry and fill in ut_addr
- option to specify encrypted password in passwd (for yppasswdd, so it
doesn't need to know about shadow/non-shadow); should probably use a pipe
(less insecure than command line arguments)
- add support for changing NIS passwords
- add option to check passwords by piping them to external programs
- add functionality of the contrib/rpasswd.c wrapper to passwd
- option to generate pronounceable passwords (like on SCO), external program?
- poppassd (remote password change for eudora etc.)
- add support for passwd/shadow db files (glibc)
- vipw: check password files for errors after editing
- add "maximum time users allowed to stay logged in" limit option to logoutd
- handle quotes in /etc/environment like the shell does (but sshd doesn't...)
- better utmpx support (logoutd, ...)
- better OPIE support (report number of logins left, etc.)
- new option for /etc/suauth: don't load user's environment (force "su -")
suggested by Ulisses Alonso Camaro
- find out why recent releases won't compile on Solaris
- newusers should be able to copy /etc/skel to the new home directory
(like useradd)
- add directories where other packages can add hooks for package-specific
per-user configuration, to be executed with run-parts. Some hooks should
be executed at package install time for existing users, likewise for
package removal and possibly modification. (Debian Bug#36019)

View File

@@ -1,36 +0,0 @@
$Id$
Specification for console.c source file --
input values --
tty -- character pointer to device name with leading "/dev/"
removed.
return values --
0 -- false
1 -- true
int console (char * tty)
if "CONSOLE" string value is not present in login.defs
return true
if the first character of "CONSOLE" string value is not "/"
treat the string as a ":" delimited list of device
names and search for the value of tty in that
tokenized list.
if a match is found
return true
return false
if the file named by "CONSOLE" cannot be opened
return true
scan the file looking for a match between the input line
and the value of tty
if a match is found
return true
return false

View File

@@ -1,340 +0,0 @@
diff -ur orig/cracklib26_small/cracklib/fascist.c cracklib26_small/cracklib/fascist.c
--- orig/cracklib26_small/cracklib/fascist.c Mon Dec 15 02:56:55 1997
+++ cracklib26_small/cracklib/fascist.c Sat Apr 4 22:14:45 1998
@@ -12,6 +12,7 @@
#include <ctype.h>
#include <sys/types.h>
#include <pwd.h>
+#include <string.h>
#define ISSKIP(x) (isspace(x) || ispunct(x))
@@ -460,28 +461,27 @@
}
char *
-FascistGecos(password, uid)
+FascistGecosPw(password, pwd)
char *password;
- int uid;
+ struct passwd *pwd;
{
int i;
int j;
int wc;
char *ptr;
- struct passwd *pwp;
char gbuffer[STRINGSIZE];
char tbuffer[STRINGSIZE];
char *uwords[STRINGSIZE];
char longbuffer[STRINGSIZE * 2];
- if (!(pwp = getpwuid(uid)))
+ if (!pwd)
{
return ("you are not registered in the password file");
}
/* lets get really paranoid and assume a dangerously long gecos entry */
- strncpy(tbuffer, pwp->pw_name, STRINGSIZE);
+ strncpy(tbuffer, pwd->pw_name, STRINGSIZE);
tbuffer[STRINGSIZE-1] = '\0';
if (GTry(tbuffer, password))
{
@@ -490,12 +490,13 @@
/* it never used to be that you got passwd strings > 1024 chars, but now... */
- strncpy(tbuffer, pwp->pw_gecos, STRINGSIZE);
+ strncpy(tbuffer, pwd->pw_gecos, STRINGSIZE);
tbuffer[STRINGSIZE-1] = '\0';
strcpy(gbuffer, Lowercase(tbuffer));
wc = 0;
ptr = gbuffer;
+ uwords[0] = (char *) 0;
while (*ptr)
{
@@ -530,6 +531,8 @@
*(ptr++) = '\0';
}
}
+ if (!uwords[0])
+ return ((char *) 0); /* empty gecos */
#ifdef DEBUG
for (i = 0; uwords[i]; i++)
{
@@ -586,9 +589,10 @@
}
char *
-FascistLook(pwp, instring)
+FascistLookPw(pwp, instring, pwd)
PWDICT *pwp;
char *instring;
+ struct passwd *pwd;
{
int i;
char *ptr;
@@ -667,7 +671,7 @@
return ("it looks like a National Insurance number.");
}
- if (ptr = FascistGecos(password, getuid()))
+ if (ptr = FascistGecosPw(password, pwd ? pwd : getpwuid(getuid())))
{
return (ptr);
}
@@ -715,9 +719,10 @@
}
char *
-FascistCheck(password, path)
+FascistCheckPw(password, path, pwd)
char *password;
char *path;
+ struct passwd *pwd;
{
static char lastpath[STRINGSIZE];
static PWDICT *pwp;
@@ -750,5 +755,29 @@
strncpy(lastpath, path, STRINGSIZE);
}
- return (FascistLook(pwp, pwtrunced));
+ return (FascistLookPw(pwp, pwtrunced, pwd));
+}
+
+char *
+FascistGecos(password, uid)
+ char *password;
+ int uid;
+{
+ return (FascistGecosPw(password, getpwuid(uid)));
+}
+
+char *
+FascistLook(pwp, instring)
+ PWDICT *pwp;
+ char *instring;
+{
+ return (FascistLookPw(pwp, instring, (char *) 0));
+}
+
+char *
+FascistCheck(password, path)
+ char *password;
+ char *path;
+{
+ return (FascistCheckPw(password, path, (char *) 0));
}
diff -ur orig/cracklib26_small/cracklib/packer.h cracklib26_small/cracklib/packer.h
--- orig/cracklib26_small/cracklib/packer.h Mon Dec 15 00:09:30 1997
+++ cracklib26_small/cracklib/packer.h Sat Jan 10 22:13:46 1998
@@ -34,6 +34,7 @@
FILE *dfp;
FILE *wfp;
+ int canfree;
int32 flags;
#define PFOR_WRITE 0x0001
#define PFOR_FLUSH 0x0002
diff -ur orig/cracklib26_small/cracklib/packlib.c cracklib26_small/cracklib/packlib.c
--- orig/cracklib26_small/cracklib/packlib.c Fri Jul 9 22:22:58 1993
+++ cracklib26_small/cracklib/packlib.c Sat Jan 10 22:28:49 1998
@@ -16,7 +16,7 @@
char *mode;
{
int32 i;
- static PWDICT pdesc;
+ PWDICT *pdesc;
char iname[STRINGSIZE];
char dname[STRINGSIZE];
char wname[STRINGSIZE];
@@ -25,92 +25,94 @@
FILE *ifp;
FILE *wfp;
- if (pdesc.header.pih_magic == PIH_MAGIC)
- {
- fprintf(stderr, "%s: another dictionary already open\n", prefix);
+ if ((pdesc = (PWDICT *) malloc(sizeof(PWDICT))) == 0)
return ((PWDICT *) 0);
- }
- memset(&pdesc, '\0', sizeof(pdesc));
+ memset(pdesc, '\0', sizeof(*pdesc));
sprintf(iname, "%s.pwi", prefix);
sprintf(dname, "%s.pwd", prefix);
sprintf(wname, "%s.hwm", prefix);
- if (!(pdesc.dfp = fopen(dname, mode)))
+ if (!(pdesc->dfp = fopen(dname, mode)))
{
perror(dname);
+ free(pdesc);
return ((PWDICT *) 0);
}
- if (!(pdesc.ifp = fopen(iname, mode)))
+ if (!(pdesc->ifp = fopen(iname, mode)))
{
- fclose(pdesc.dfp);
+ fclose(pdesc->dfp);
perror(iname);
+ free(pdesc);
return ((PWDICT *) 0);
}
- if (pdesc.wfp = fopen(wname, mode))
+ if (pdesc->wfp = fopen(wname, mode))
{
- pdesc.flags |= PFOR_USEHWMS;
+ pdesc->flags |= PFOR_USEHWMS;
}
- ifp = pdesc.ifp;
- dfp = pdesc.dfp;
- wfp = pdesc.wfp;
+ ifp = pdesc->ifp;
+ dfp = pdesc->dfp;
+ wfp = pdesc->wfp;
if (mode[0] == 'w')
{
- pdesc.flags |= PFOR_WRITE;
- pdesc.header.pih_magic = PIH_MAGIC;
- pdesc.header.pih_blocklen = NUMWORDS;
- pdesc.header.pih_numwords = 0;
+ pdesc->flags |= PFOR_WRITE;
+ pdesc->header.pih_magic = PIH_MAGIC;
+ pdesc->header.pih_blocklen = NUMWORDS;
+ pdesc->header.pih_numwords = 0;
- fwrite((char *) &pdesc.header, sizeof(pdesc.header), 1, ifp);
+ fwrite((char *) &pdesc->header, sizeof(pdesc->header), 1, ifp);
} else
{
- pdesc.flags &= ~PFOR_WRITE;
+ pdesc->flags &= ~PFOR_WRITE;
- if (!fread((char *) &pdesc.header, sizeof(pdesc.header), 1, ifp))
+ if (!fread((char *) &pdesc->header, sizeof(pdesc->header), 1, ifp))
{
fprintf(stderr, "%s: error reading header\n", prefix);
- pdesc.header.pih_magic = 0;
+ pdesc->header.pih_magic = 0;
fclose(ifp);
fclose(dfp);
+ free(pdesc);
return ((PWDICT *) 0);
}
- if (pdesc.header.pih_magic != PIH_MAGIC)
+ if (pdesc->header.pih_magic != PIH_MAGIC)
{
fprintf(stderr, "%s: magic mismatch\n", prefix);
- pdesc.header.pih_magic = 0;
+ pdesc->header.pih_magic = 0;
fclose(ifp);
fclose(dfp);
+ free(pdesc);
return ((PWDICT *) 0);
}
- if (pdesc.header.pih_blocklen != NUMWORDS)
+ if (pdesc->header.pih_blocklen != NUMWORDS)
{
fprintf(stderr, "%s: size mismatch\n", prefix);
- pdesc.header.pih_magic = 0;
+ pdesc->header.pih_magic = 0;
fclose(ifp);
fclose(dfp);
+ free(pdesc);
return ((PWDICT *) 0);
}
- if (pdesc.flags & PFOR_USEHWMS)
+ if (pdesc->flags & PFOR_USEHWMS)
{
- if (fread(pdesc.hwms, 1, sizeof(pdesc.hwms), wfp) != sizeof(pdesc.hwms))
+ if (fread(pdesc->hwms, 1, sizeof(pdesc->hwms), wfp) != sizeof(pdesc->hwms))
{
- pdesc.flags &= ~PFOR_USEHWMS;
+ pdesc->flags &= ~PFOR_USEHWMS;
}
}
}
-
- return (&pdesc);
+ pdesc->canfree = 1;
+ return (pdesc);
}
int
@@ -159,8 +161,13 @@
fclose(pwp->ifp);
fclose(pwp->dfp);
+ if (pwp->wfp)
+ fclose(pwp->wfp);
- pwp->header.pih_magic = 0;
+ if (pwp->canfree)
+ free(pwp);
+ else
+ pwp->header.pih_magic = 0;
return (0);
}
@@ -307,6 +314,11 @@
register char *this;
int idx;
+/*
+ * comment in npasswd-2.0beta4 says this:
+ * This does not work under all circumstances, so don't bother
+ */
+#if 0
if (pwp->flags & PFOR_USEHWMS)
{
idx = string[0] & 0xff;
@@ -317,6 +329,10 @@
lwm = 0;
hwm = PW_WORDS(pwp) - 1;
}
+#else
+ lwm = 0;
+ hwm = PW_WORDS(pwp);
+#endif
#ifdef DEBUG
printf("---- %lu, %lu ----\n", lwm, hwm);
diff -ur orig/cracklib26_small/util/mkdict cracklib26_small/util/mkdict
--- orig/cracklib26_small/util/mkdict Fri Jul 9 22:23:03 1993
+++ cracklib26_small/util/mkdict Sat Apr 4 22:31:45 1998
@@ -14,9 +14,16 @@
SORT="sort"
###SORT="sort -T /tmp"
-cat $* |
+### Use zcat to read compressed (as well as uncompressed) dictionaries.
+### Compressed dictionaries can save quite a lot of disk space.
+
+CAT="gzip -cdf"
+###CAT="zcat"
+###CAT="cat"
+
+$CAT $* |
tr '[A-Z]' '[a-z]' |
- tr -cd '[\012a-z0-9]' |
+ tr -cd '\012[a-z][0-9]' |
$SORT |
uniq |
grep -v '^#' |

Some files were not shown because too many files have changed in this diff Show More