Compare commits

...

106 Commits
v4.9 ... 4.10

Author SHA1 Message Date
Serge Hallyn
868d7b34ea configure.ac and changelog: release 4.9
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-19 14:09:08 -06:00
Serge Hallyn
30e62bc3bd Add README as symlink to README.md
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-19 14:09:08 -06:00
Serge Hallyn
a630fba34b Merge pull request #461 from edneville/441_passwd_message
passwd -l should not say that it changes expiry
2021-12-19 11:27:44 -06:00
ed neville
92cb9d7785 passwd -l should not say that it changes expiry
Closes #441
2021-12-17 23:02:02 +00:00
Serge Hallyn
0f31dc5c2c Merge pull request #458 from edneville/434_usermod_home_dir_trailing_slash
Remove tailing slash on home dir
2021-12-17 08:41:26 -06:00
Serge Hallyn
2a6164cc4a Merge pull request #455 from alejandro-colomar/master
usermod: Remove special case for ""
2021-12-17 08:33:47 -06:00
ed neville
53763ae6ee Remove tailing slash on home dir
Closes #434

Signed-off-by: ed neville <ed@s5h.net>
2021-12-17 12:23:52 +00:00
Serge Hallyn
a850520981 Merge pull request #456 from stoeckmann/chld
Verify default SIGCHLD handling.
2021-12-15 09:22:19 -06:00
Tobias Stoeckmann
c0e4ccd032 Verify default SIGCHLD handling.
The SIGCHLD handler could have been ignored by parent process.
Make sure that we have default handling activated.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2021-12-15 11:26:51 +01:00
Serge Hallyn
f2e8294bdb Merge pull request #421 from AZaugg/issue337
Adding new switch -rG to usermod
2021-12-14 08:04:29 -06:00
Alejandro Colomar
e2f1fcca0e usermod: Remove special case for ""
That special case is already handled by the called function: strtoday()
so we can simplify the calling code.

Link: <https://github.com/shadow-maint/shadow/issues/454>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-12-14 12:40:09 +01:00
Andy Zaugg
aaaaf21b6f Adding new option -rG to usermod
Adding a new switch -rG, which provides a similar feature set to
-aG, allowing a person to list exactly what groups to remove a
user from.

https://github.com/shadow-maint/shadow/issues/337
2021-12-13 21:42:48 -08:00
Serge Hallyn
9a9c9231db Merge pull request #452 from 20100074/fix-typo-in-is
Fixed typo in login.defs
2021-12-10 09:43:12 -06:00
Serge Hallyn
292f59f43d Merge pull request #453 from ikerexxe/getsubids_h
man: getsubids define -h
2021-12-10 09:37:02 -06:00
Iker Pedrosa
585b6f00f5 man: getsubids define -h
Define -h option behaviour in getsubids man page.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-12-10 16:14:13 +01:00
Serge Hallyn
abb879fd4f Merge pull request #449 from hallyn/2021-11-27/libsubid-symbols
2021 11 27/libsubid symbols
2021-12-07 08:58:03 -06:00
KOSHIKAWA Kenichi
f7c2a54212 fixed typo in login.defs 2021-12-06 01:41:17 +09:00
Serge Hallyn
c628caf174 Merge pull request #408 from bjorn-fischer/ambient_caps
Add support for ambient capabilities
2021-12-05 08:05:06 -06:00
Björn Fischer
6938bab429 Call pam_end() after fork in child code path
This conforms to PAM documentation and it is needed to support
ambient capabilities with PAM + libcap-2.58+.

Signed-off-by: Björn Fischer <bf@CeBiTec.Uni-Bielefeld.DE>
2021-12-05 08:03:56 -06:00
Serge Hallyn
0c9f641408 Show libsubid api version in subid.h
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-05 08:02:57 -06:00
Serge Hallyn
19f08785f0 Merge pull request #231 from gjzkrug/useradd-maildir-fix
Removed hard-coded default mail spool in useradd
2021-12-04 22:26:51 -06:00
Serge Hallyn
535f54076c Merge pull request #450 from lnussel/master
useradd: assume uid 0 == root as fallback
2021-12-04 22:21:37 -06:00
Serge Hallyn
445e97ba7c Update email address for Julie Haugh 2021-12-04 22:20:23 -06:00
Ludwig Nussel
d12d300c98 useradd: assume uid 0 == root as fallback
In absence of /etc/passwd, eg when bootstrapping a chroot, resolving
uid 0 to a name may not work. Therefore just assume "root".
2021-11-30 17:14:14 +01:00
Serge Hallyn
32f641b207 Change the subid export symbols
Rename libsubid symbols to all be prefixed with subid_.

Don't export anything but the subid_*.

Closes #443

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-11-27 14:56:03 -06:00
Serge Hallyn
9724147344 undo accidental autogen.sh commit: enable-shared
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-11-27 14:56:03 -06:00
Serge Hallyn
dce030ffb8 Merge pull request #447 from ikerexxe/documentation
README: update content and format
2021-11-27 09:37:19 -06:00
Iker Pedrosa
1654f42194 README: update content and format
* Change to markdown format
* Include an introduction
* Remove the commit mailing list from the contacts
* Add the IRC channel to the contacts
* Move 'S/Key' section to doc/README.skey
* Move authors and maintainers to AUTHORS.md

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-11-22 15:31:54 +01:00
Serge Hallyn
3ff3cd9c78 Merge pull request #440 from stoeckmann/vipw
Improve child error handling
2021-11-22 07:33:57 -06:00
Serge Hallyn
3a0160beb0 Merge pull request #446 from ikerexxe/spw_free
lib: check NULL before freeing passwd data
2021-11-22 07:32:32 -06:00
Iker Pedrosa
d594243fbb lib: check NULL before freeing passwd data
Add an additional NULL check condition in spw_free() and pw_free() to
avoid freeing an already empty pointer.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-11-19 12:09:59 +01:00
Serge Hallyn
02916e9cb2 Merge pull request #435 from freedge/groupdelcore
groupdel: fix SIGSEGV when passwd does not exist
2021-11-18 10:30:46 -06:00
Serge Hallyn
1fdaf69376 Merge pull request #436 from ikerexxe/getsubids
getsubids: system binary for user's sub*ids
2021-11-18 07:32:10 -06:00
Iker Pedrosa
2fa4234fc7 README: add myself to the contributors list
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-11-17 16:40:18 +01:00
Iker Pedrosa
3b6ccf642c getsubids: system binary for user's sub*ids
Rename list_subid_ranges to getsubids to provide a system binary to
check the sub*ids of a user. The intention is to provide this binary
with any distribution that includes the subid feature, so that system
administrators can check the subid ranges of a given user.

Finally, add a man page to explain the behaviour of getsubids.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1980780

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-11-17 16:35:50 +01:00
Serge Hallyn
126fbe57bc Merge pull request #437 from ikerexxe/newgrp_segfault
newgrp: fix segmentation fault
2021-11-17 08:18:13 -06:00
Serge Hallyn
6c3d4ebf6e Merge pull request #439 from ikerexxe/useradd_skel_fix
useradd: change SELinux labels for home files
2021-11-17 08:17:34 -06:00
Serge Hallyn
eb366c255c Merge pull request #442 from rbalint/fix-no-passwd-help
Fix typo in passwd --help's Norvegian translation
2021-11-17 08:15:04 -06:00
Serge Hallyn
6c4545544f Merge pull request #445 from ikerexxe/pwck_segfault
pwck: fix segfault when calling fprintf()
2021-11-17 08:14:22 -06:00
Iker Pedrosa
d8e54618fe pwck: fix segfault when calling fprintf()
As shadow_logfd variable is not set at the beginning of the program if
something fails and fprintf() is called a segmentation fault happens.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2021339

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-11-15 12:45:08 +01:00
Balint Reczey
adf7378d73 Fix typo in passwd --help's Norvegian translation
Thanks to Tollef Fog Heen for the bug report at https://bugs.debian.org/949862
2021-11-14 12:52:37 +01:00
Tobias Stoeckmann
624d57c08c Improve child error handling
Always set SIGCHLD handler to default, even if the caller of vipw has
set SIGCHLD to ignore. If SIGCHLD is ignored no zombie processes would
be created, which in turn could mean that kill is called with an already
recycled pid.

Proof of Concept:

1. Compile nochld:
 --
 #include <signal.h>
 #include <unistd.h>
 int main(void) {
 char *argv[] = { "vipw", NULL };
 signal(SIGCHLD, SIG_IGN);
 execvp("vipw", argv);
 return 1;
 }
 --
2. Run nochld
3. Suspend child vi, which suspends vipw too:
`kill -STOP childpid`
4. Kill vi:
`kill -9 childpid`
5. You can see with ps that childpid is no zombie but disappeared
6. Bring vipw back into foreground
`fg`

The kill call sends SIGCONT to "childpid" which in turn could have been
already recycled for another process.

This is definitely not a vulnerability. It would take super user
operations, at which point an attacker would have already elevated
permissions.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2021-11-14 12:01:32 +01:00
Iker Pedrosa
06eb4e4d76 useradd: change SELinux labels for home files
Change SELinux labels for files copied from the skeleton directory to
the home directory.

This could cause gnome's graphical user adding to fail without copying
the full skeleton files.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2022658

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-11-12 15:27:16 +01:00
Iker Pedrosa
497e90751b newgrp: fix segmentation fault
Fix segmentation fault in newgrp when xgetspnam() returns a NULL value
that is immediately freed.

The error was committed in
e65cc6aebc

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2019553

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-11-10 12:02:04 +01:00
François Rigault
a757b458ff groupdel: fix SIGSEGV when passwd does not exist
When using groupdel with a prefix, groupdel will attempt to read a
passwd file to look for any user in the group. When the file does not
exist it cores with segmentation fault.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1986111
2021-11-01 13:54:25 +01:00
Serge Hallyn
387da46d73 Merge pull request #423 from lrh2000/su-fix-sigkill
su: Fix never alarmed SIGKILL when session terminates
2021-10-31 12:36:03 -05:00
Serge Hallyn
b17a17c93d Merge pull request #432 from galaxy4public/tcb-missing-chmod
Add missing chmod() for shadowtcb_move()
2021-10-30 11:02:12 -05:00
Serge Hallyn
1ff0b37134 Merge pull request #433 from stoeckmann/hushed
Handle malformed lines in hushlogins file.
2021-10-30 09:34:55 -05:00
Tobias Stoeckmann
63a96706b1 Handle malformed lines in hushlogins file.
If a line in hushlogins file, e.g. /etc/hushlogins, starts with
'\0', then current code performs an out of boundary write.
If the line lacks a newline at the end, then another character is
overridden.

With strcspn both cases are solved.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2021-10-29 19:50:38 +02:00
(GalaxyMaster)
a97399dd0a Add missing chmod()
During shadowtcb_move() the directory is temporarily changed to be
owned by root:root with permissions 0700.  After the change is done,
the ownership and permissions were supposed to be restored.  The
call for chown() was there, but the chmod() call was missing.  This
resulted in the broken TCB functionality.  The added chmod() fixes
the issue.
2021-10-28 11:16:59 +11:00
Serge Hallyn
f2476d3ce8 Merge pull request #430 from galaxy4public/libsubid-static
Fixes the linking issues when libsubid is static and linked to
2021-10-27 08:31:23 -05:00
(GalaxyMaster)
fc832e4648 Fixes the linking issues when libsubid is static and linked to
binaries that also define the Prog and shadow_logfd variables.
2021-10-27 20:14:42 +11:00
Serge Hallyn
7d02af944f Merge pull request #422 from ikerexxe/home_selinux_user
Create the home and mail directories with SELinux user label
2021-10-26 20:08:21 -05:00
Serge Hallyn
82b5983301 Add Christian Brauner to SECURITY.md
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-10-25 14:26:37 -05:00
Iker Pedrosa
234af5cf67 semanage: close the selabel handle
Close the selabel handle to update the file_context. This means that the
file_context will be remmaped and used by selabel_lookup() to return
the appropriate context to label the home folder.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1993081

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-10-25 09:55:31 +02:00
Iker Pedrosa
09c752f00f useradd: create directories after the SELinux user
Create the home and mail folders after the SELinux user has been set for
the added user. This will allow the folders to be created with the
SELinux user label.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-10-25 09:55:27 +02:00
Ruihan Li
5b4082d007 su: Fix never alarmed SIGKILL when session terminates
The buggy code was introduced nearly 5 years ago at the
commit 08fd4b69e8. The
desired behavior is that SIGKILL will be sent to the
child if it does not exit within 2 seconds after it
receives SIGTERM. However, SIGALRM is masked while
waiting for the child so it cannot wake the program
up after 2 seconds to send SIGKILL.

An example shows the buggy behavior, which exists in
Ubuntu 18.04 LTS (with login 1:4.5-1ubuntu2).
```bash
user1@localhost:~$ su user2 -c '
_term() {
  echo SIGTERM received
}
trap _term TERM

while true; do
  sleep 1
  echo still alive
done'
Password:
still alive

Session terminated, terminating shell...Terminated
SIGTERM received
still alive
still alive
still alive
still alive
```
(SIGTERM is sent in another user1's terminal by
executing `killall su`.)

Here is the desired behavior, which shows what the
commit fixes.
```bash
user1@localhost:~$ su user2 -c '
_term() {
  echo SIGTERM received
}
trap _term TERM

while true; do
  sleep 1
  echo still alive
done'
Password:
still alive

Session terminated, terminating shell...Terminated
SIGTERM received
still alive
still alive
 ...killed.
user1@localhost:~$ echo $?
255
```
2021-10-25 13:39:41 +08:00
Serge Hallyn
cdc8c1e25b Create SECURITY.md
Barebones to unblock current reporters.
2021-10-23 09:34:48 -05:00
Serge Hallyn
4bec156db1 Merge pull request #426 from hallyn/2021-10-15/man 2021-10-20 15:16:06 -05:00
Serge Hallyn
33f85e93a1 manpages: fix 'File Formats and Conversions"
Closes #416

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-10-15 16:28:12 -05:00
Serge Hallyn
6be18d45e1 initial github actions attempt
Closes #415
2021-10-15 16:21:19 -05:00
Andy Zaugg
7e2b522a15 Added a new configurable LOG_INIT to useradd
In some circumstances I want the default behaviour of useradd to
not add user entries to the lastlog and faillog databases. Allowing
this options behaviour to be controlled by the config file
/etc/default/useradd.
2021-10-15 16:20:52 -05:00
Andy Zaugg
d7e2bd6fe1 Added documentation around CREATE_MAIL_SPOOL
Adding documentation aroud the parameter CREATE_MAIL_SPOOL in the
/etc/default/useradd file
2021-10-15 16:20:52 -05:00
Serge Hallyn
4ad2697cc4 Merge pull request #412 from ljmf00/fix-trailing-whitespaces
treewide: remove trailing whitespaces
2021-09-27 10:12:24 -05:00
Serge Hallyn
5bb28a0a7f Merge pull request #417 from jubalh/doublefree
Only free sgent if it was initialized
2021-09-27 10:10:22 -05:00
Serge Hallyn
4b85dc66d4 Merge pull request #420 from AZaugg/issue419
Fix parentheses in configure.ac
2021-09-27 08:48:24 -05:00
Andy Zaugg
049f9a7f6b Fix parentheses in configure.ac
Resolving issue https://github.com/shadow-maint/shadow/issues/419
2021-09-22 09:42:15 -07:00
Michael Vetter
117bc66c6f Only free sgent if it was initialized
`sgent` is only initialized in `get_group()` if `is_shadowgrp` is true.
So we should also only attempt to free it if this is actually the case.

Can otherwise lead to:
```
free() double free detected in tcache 2 (gpasswd)
```
2021-09-20 11:04:50 +02:00
Serge Hallyn
26bbee8c86 Merge pull request #414 from Frans-Spiesschaert/new_dutch_po_branch
updated Dutch translation
2021-09-14 10:01:17 -05:00
Frans Spiesschaert
ab9fad7943 updated Dutch translation 2021-09-13 21:05:45 +02:00
Luís Ferreira
7903557988 treewide: remove trailing whitespaces
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-09-13 17:23:17 +01:00
Serge Hallyn
0e0101043b Merge pull request #405 from a1346054/master
Minor cleanups
2021-09-13 10:57:38 -05:00
Serge Hallyn
fb582ce72f Merge pull request #411 from ljmf00/ignore-check-subid
git: ignore generated check_subid_range
2021-09-13 10:37:59 -05:00
Luís Ferreira
679a29da7e git: ignore generated check_subid_range
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-09-13 16:17:49 +01:00
a1346054
d7c9550b7f fix spelling 2021-09-13 15:11:40 +00:00
Serge Hallyn
e385338ee8 Merge pull request #410 from paulmenzel/use-https-urls-in-readme
Use HTTPS URLs in README, where possible
2021-09-12 10:50:09 -05:00
Paul Menzel
2b6312b337 README: Use HTTPS URLs where possible
The GitHub and Debian permanently moved to HTTPS URLs and redirect
there. The Gentoo URL does not redirect to HTTPS, but still use it to
address certain kinds of attacks. Lastly, the NetBSD URL is only
available using HTTP.
2021-09-12 12:06:02 +02:00
a1346054
ecfcaed0b5 fix some shellcheck-identified issues in scripts 2021-08-18 18:21:06 +00:00
a1346054
f20c688a18 use a geographically close URL 2021-08-18 18:07:50 +00:00
a1346054
7687ae4dbd fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
Serge Hallyn
4624e9fca1 Revert "useradd.c:fix memleaks of grp"
In some cases, the value which was being freed is not actually
safe to free.

Closes #394

This reverts commit c44b71cec2.
2021-08-14 19:37:24 -05:00
Serge Hallyn
009e09fd58 Merge pull request #400 from floppym/sha-rounds
libmisc: fix default value in SHA_get_salt_rounds()
2021-08-14 19:29:54 -05:00
Serge Hallyn
a5bf83d2e7 Merge pull request #401 from hallyn/2021-08-14/dropxml2po
man/po/Makefile.in: switch from xml2po to itstool
2021-08-14 19:28:18 -05:00
Serge Hallyn
4bcbe13689 Merge pull request #403 from hallyn/2021-08-14/fixnosubuidbuild
useradd.c: Fix undeclared subuid_count when not using subids
2021-08-14 19:28:07 -05:00
Serge Hallyn
049b08481a useradd.c: Fix undeclared subuid_count when not using subids
subuid_count won't get used by usr_update(), but since we're passing it
as an argument we have to make sure it's always defined.  So just define
it as pre-set to 0.

Closes #402

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-08-14 19:25:51 -05:00
Serge Hallyn
02b200c9aa man/po/Makefile.in: switch from xml2po to itstool
xml2po is deprecated.  We've previously replaced xml2po with
itstool in man/generate_translations.mak, but there was still
an instance of it that only is exercised for 'make dist'.
Update that one.  Now 'make dist' succeeds on a ubuntu focal
or newer host where xml2po is not available.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-08-14 14:51:08 -05:00
Mike Gilbert
234e8fa7b1 libmisc: fix default value in SHA_get_salt_rounds()
If SHA_CRYPT_MIN_ROUNDS and SHA_CRYPT_MAX_ROUNDS are both unspecified,
use SHA_ROUNDS_DEFAULT.

Previously, the code fell through, calling shadow_random(-1, -1). This
ultimately set rounds = (unsigned long) -1, which ends up being a very
large number! This then got capped to SHA_ROUNDS_MAX later in the
function.

The new behavior matches BCRYPT_get_salt_rounds().

Bug: https://bugs.gentoo.org/808195
Fixes: https://github.com/shadow-maint/shadow/issues/393
2021-08-14 13:43:26 -04:00
Serge Hallyn
c4539fc4f9 Merge pull request #399 from ikerexxe/useradd_empty_subid_range
useradd: avoid generating an empty subid range
2021-08-14 09:23:26 -05:00
Iker Pedrosa
9dd720a285 useradd: avoid generating an empty subid range
useradd generates an empty subid range when adding a new user. This is
caused because there are two variables, one local and the other one
global, that have a very similar name and they are used indistinctly in
the code. The local variable loads the SUB_*ID_COUNT configuration from
the login.defs file, while the global variable, which holds a value of
0, is used to generate the subid range. Causing the empty subid range
problem.

I've merged the two variables in the local one and removed the global
variable. I prefer to do it this way to reduce the scope of it but I'm
open to doing it the other way round.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1990653

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-08-10 10:04:39 +02:00
Serge Hallyn
1c1e0b0c68 Merge pull request #397 from ikerexxe/revert_local_groups_check
usermod: allow all group types with -G option
2021-08-04 10:41:56 -05:00
Serge Hallyn
adb83f7796 Merge pull request #398 from Dzejrou/master
passwd: handle NULL pw_passwd when printing password status
2021-08-04 10:38:30 -05:00
Serge Hallyn
28a02dc83e Merge pull request #396 from floppym/libcrack
libsubid: fix build with libcrack
2021-08-04 10:37:08 -05:00
Serge Hallyn
e318bb9b06 Merge pull request #395 from ikerexxe/downstream_4_9
Makefile: include libeconf dependency in new*idmap
2021-08-04 10:36:44 -05:00
Jaroslav Jindrak
05388f748d passwd: handle NULL pw_passwd when printing password status
When the -S and -a options are used for passwd to list the status
of all passwords, there is a chance the pw_passwd field of struct
passwd will be NULL. This can be due to 'files compat' being set
for passwd in /etc/nsswitch.conf and the usage of some features
not available in the 'files' mode (e.g. a plus sign at the start
of a line).

Example:

germ161:~ # grep passwd /etc/nsswitch.conf
passwd: files compat
germ161:~ # rpm -qa shadow
shadow-4.2.1-34.20.x86_64
germ161:~ # grep passwd /etc/nsswitch.conf
passwd: files compat
germ161:~ # grep + /etc/passwd
+@nisgroup
germ161:~ # passwd -S -a > /dev/null
Segmentation fault (core dumped)

With this commit:

germ161:~ # passwd -S -a > /dev/null
passwd: malformed password data obtained for user +@nisgroup
2021-08-03 20:03:46 +02:00
Iker Pedrosa
e481437ab9 usermod: allow all group types with -G option
The only way of removing a group from the supplementary list is to use
-G option, and list all groups that the user is a member of except for
the one that wants to be removed. The problem lies when there's a user
that contains both local and remote groups, and the group to be removed
is a local one. As we need to include the remote group with -G option
the command will fail.

This reverts commit 140510de9d. This way,
it would be possible to remove the remote groups from the supplementary
list.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967641
Resolves: https://github.com/shadow-maint/shadow/issues/338

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-08-03 11:14:09 +02:00
Mike Gilbert
6becc82e26 libsubid: fix build with libcrack
Fixes a link failure:

  ../libsubid/.libs/libsubid.so: undefined reference to `FascistCheck'

Bug: https://bugs.gentoo.org/806124
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
2021-08-02 12:00:48 -04:00
Iker Pedrosa
c6847011e8 Makefile: include libeconf dependency in new*idmap
new*idmap has a dependency with libeconf since commit
c464ec5570. I'm just adding it to the
Makefile to be able to compile in distributions that include libeconf.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-08-02 15:54:20 +02:00
Christian Brauner
065aae682c Merge pull request #392 from hallyn/2021-07-25/useradd-defaults
useradd: create /etc/default saving defaults.
2021-07-26 10:20:56 +02:00
Serge Hallyn
33c33a32a2 useradd: create /etc/default saving defaults.
Since bbf4b79, we stopped shipping /etc/default/useradd, and therefore
install of shadow does not auto-create /etc/default.  So when useradd
tries to save a new default, it needs to create the directory.

Closes #390.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-07-25 16:19:56 -05:00
Serge Hallyn
cd551ef728 Merge pull request #391 from hallyn/2021-07-25/static
Respect --enable-static=no in libsubid
2021-07-25 14:01:11 -05:00
Serge Hallyn
fa986b1d73 Respect --enable-static=no in libsubid
libsubid's Makefile.am was always setting enable-shared in its LDFLAGS.
Do that only if not building static.

Closes #387

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
2021-07-25 12:21:55 -05:00
Serge Hallyn
4616fe71e7 Merge pull request #388 from hallyn/2021-07-23/outoftreebuild
Fix out of tree builds with respect to libsubid includes
2021-07-23 18:11:51 -05:00
Serge Hallyn
537b8cd90b Fix out of tree builds with respect to libsubid includes
There's a better way to do this, and I hope to clean that up,
but this fixes out of tree builds for me right now.

Closes #386

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-07-23 17:51:13 -05:00
Serge Hallyn
d4b6d1549b Merge pull request #385 from xry111/ftbfs-fix
libsubid: link to PAM libraries
2021-07-23 04:53:34 -05:00
Xi Ruoyao
f4a84efb46 libsubid: link to PAM libraries
libsubid.so links to libmisc.a, which contains several routines referring to
PAM functions.
2021-07-23 14:38:08 +08:00
Geoffrey Krug
2a991a3ce9 Removed hard-coded default mail spool in useradd
The useradd program should be consistent with userdel and usermod and use the
MAIL_SPOOL_DIR variable as the default spool, if it is defined. Otherwise,
don't create a new mailbox, because it won't be cleaned up by userdel when run
with the -r flag.
2020-03-11 20:00:09 +00:00
436 changed files with 1396 additions and 1066 deletions

43
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: debug
run: |
id
which bash
whoami
env
ps -ef
pwd
cat /proc/self/uid_map
cat /proc/self/status
systemd-detect-virt
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install automake autopoint xsltproc gettext expect byacc libtool
- name: configure
run: |
./autogen.sh --without-selinux --disable-man
grep ENABLE_ config.status
- run: make
- run: make install DESTDIR=${HOME}/rootfs
- run: sudo make install
- run: |
cd tests
sudo ./run_some
cat testsuite.log

1
.gitignore vendored
View File

@@ -48,3 +48,4 @@ Makefile.in
/shadow.spec /shadow.spec
/shadow-*.tar.* /shadow-*.tar.*
/libmisc/getdate.c /libmisc/getdate.c
/libsubid/subid.h

89
AUTHORS.md Normal file
View File

@@ -0,0 +1,89 @@
Thanks to at least the following people for sending patches, bug
reports and various comments. This list may be incomplete, I received
a lot of mail...
# Maintainers
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)
# Authors and contributors
Adam Rudnicki <adam@v-lo.krakow.pl>
Alan Curry <pacman@tardis.mars.net>
Aleksa Sarai <cyphar@cyphar.com>
Alexander O. Yuriev <alex@bach.cis.temple.edu>
Algis Rudys <arudys@rice.edu>
Andreas Jaeger <aj@arthur.rhein-neckar.de>
Andy Zaugg <andy.zaugg@gmail.com>
Aniello Del Sorbo <anidel@edu-gw.dia.unisa.it>
Anton Gluck <gluc@midway.uchicago.edu>
Arkadiusz Miskiewicz <misiek@pld.org.pl>
Ben Collins <bcollins@debian.org>
Brian R. Gaeke <brg@dgate.org>
Calle Karlsson <ckn@kash.se>
Chip Rosenthal <chip@unicom.com>
Chris Evans <lady0110@sable.ox.ac.uk>
Chris Lamb <chris@chris-lamb.co.uk>
Cristian Gafton <gafton@sorosis.ro>
Dan Walsh <dwalsh@redhat.com>
Darcy Boese <possum@chardonnay.niagara.com>
Dave Hagewood <admin@arrowweb.com>
David A. Holland <dholland@hcs.harvard.edu>
David Frey <David.Frey@lugs.ch>
Ed Carp <ecarp@netcom.com>
Ed Neville <ed@s5h.net>
Eric W. Biederman" <ebiederm@xmission.com>
Floody <flood@evcom.net>
Frank Denis <j@4u.net>
George Kraft IV <gk4@us.ibm.com>
Greg Mortensen <loki@world.std.com>
Guido van Rooij
Guy Maor <maor@debian.org>
Hrvoje Dogan <hdogan@bjesomar.srce.hr>
Iker Pedrosa <ipedrosa@redhat.com>
Jakub Hrozek <jhrozek@redhat.com>
Janos Farkas <chexum@bankinf.banki.hu>
Jason Franklin <jason.franklin@quoininc.com>
Jay Soffian <jay@lw.net>
Jesse Thilo <Jesse.Thilo@pobox.com>
Joey Hess <joey@kite.ml.org>
John Adelsberger <jja@umr.edu>
Jonathan Hankins <jhankins@mailserv.homewood.k12.al.us>
Jon Lewis <jlewis@lewis.org>
Joshua Cowan <jcowan@hermit.reslife.okstate.edu>
Judd Bourgeois <shagboy@bluesky.net>
Juergen Heinzl <unicorn@noris.net>
Juha Virtanen <jiivee@iki.fi>
Julian Pidancet <julian.pidancet@gmail.com>
Julianne Frances Haugh <julie78787@gmail.com>
Leonard N. Zubkoff <lnz@dandelion.com>
Luca Berra <bluca@www.polimi.it>
Lukáš Kuklínek <lkukline@redhat.com>
Lutz Schwalowsky <schwalow@mineralogie.uni-hamburg.de>
Marc Ewing <marc@redhat.com>
Martin Bene <mb@sime.com>
Martin Mares <mj@gts.cz>
Michael Meskes <meskes@topsystem.de>
Michael Talbot-Wilson <mike@calypso.bns.com.au>
Michael Vetter <jubalh@iodoru.org>
Mike Frysinger <vapier@gentoo.org>
Mike Pakovic <mpakovic@users.southeast.net>
Nicolas François <nicolas.francois@centraliens.net>
Nikos Mavroyanopoulos <nmav@i-net.paiko.gr>
Pavel Machek <pavel@bug.ucw.cz>
Peter Vrabec <pvrabec@redhat.com>
Phillip Street
Rafał Maszkowski <rzm@icm.edu.pl>
Rani Chouha <ranibey@smartec.com>
Sami Kerola <kerolasa@rocketmail.com>
Scott Garman <scott.a.garman@intel.com>
Sebastian Rick Rijkers <srrijkers@gmail.com>
Seraphim Mellos <mellos@ceid.upatras.gr>
Shane Watts <shane@nexus.mlckew.edu.au>
Steve M. Robbins <steve@nyongwa.montreal.qc.ca>
Thorsten Kukuk <kukuk@suse.de>
Tim Hockin <thockin@eagle.ais.net>
Timo Karjalainen <timok@iki.fi>
Ulisses Alonso Camaro <ulisses@pusa.eleinf.uv.es>
Werner Fink <werner@suse.de>

View File

@@ -1,3 +1,46 @@
2021-12-19 Serge Hallyn <serge@hallyn.com>
Note: From this release forward, su from this package should be
considered deprecated. Please replace any users of it with su from
util-linux. Please open an issue if there is a problem with that.
We intend to remove it in an upcoming release.
* libsubid fixes (Xi Ruoyao, Serge Hallyn, Iker Pedrosa, Mike Gilbert,
GalaxyMaster, and Luís Ferreira)
* Rename the test program list_subid_ranges to getsubids, write
a manpage, so distros can ship it. (Iker Pedrosa)
* Add libeconf dep for new*idmap (Iker Pedrosa)
* Allow all group types with usermod -G (Iker Pedrosa)
* Avoid useradd generating empty subid range (Iker Pedrosa)
* Handle NULL pw_passwd (Jaroslav Jindrak)
* Fix default value SHA_get_salt_rounds (Mike Gilbert)
* Use https where possible in README (Paul Menzel)
* Update content and format of README (Iker Pedrosa)
* Translation updates (Balint Reczey, Frans Spiesschaert)
* Switch from xml2po to itstool in 'make dist' (Serge Hallyn)
* Fix double frees (Michael Vetter)
* Add LOG_INIT configurable to useradd (Andy Zaugg)
* Add CREATE_MAIL_SPOOL documentation (Andy Zaugg)
* Create a security.md
* Fix su never being SIGKILLd when trapping TERM (Ruihan li)
* Fix wrong SELinux labels in several possible cases (Iker Pedrosa)
* Fix missing chmod in chadowtb_move (GalaxyMaster)
* Handle malformed hushlogins entries (Tobias Stoeckmann)
* Fix groupdel segv when passwd does not exist (François Rigault)
* Fix covscan-found newgrp segfault (Iker Pedrosa)
* Remove trailing slash on hoedir (Ed Neville)
* Fix passwd -l message - it does not change expirey (Ed Neville)
* Fix SIGCHLD handling bugs in su and vipw (Tobias Stoeckmann)
* Remove special case for "" in usermod (Alejandro Colomar)
* Implement usermod -rG to remove a specific group
(Andy Zaugg)
* call pam_end() after fork in child path for su and login
(Björn Fischer)
* useradd: In absence of /etc/passwd, assume 0 == root
(Ludwig Nussel)
* lib: check NULL before freeing data (Iker Pedrosa)
* Fix pwck segfault (Iker Pedrosa)
2021-07-22 Serge Hallyn <serge@hallyn.com> 2021-07-22 Serge Hallyn <serge@hallyn.com>
* Updated translations (Björn Esser, Juergen Hoetzel) * Updated translations (Björn Esser, Juergen Hoetzel)

124
README
View File

@@ -1,124 +0,0 @@
Shadow SITES
============
Homepage
http://github.com/shadow-maint/shadow
Issue tracker
http://github.com/shadow-maint/shadow/issues
Releases
https://github.com/shadow-maint/shadow/releases
Mailing lists
for general discuss: pkg-shadow-devel@alioth-lists.debian.net
commit list: pkg-shadow-commits@alioth-lists.debian.net
Mailing lists subscription
http://alioth-lists.debian.net/mailman/listinfo/pkg-shadow-devel
http://alioth-lists.debian.net/mailman/listinfo/pkg-shadow-commits
Mailing lists archives:
http://alioth-lists.debian.net/pipermail/pkg-shadow-devel/
http://alioth-lists.debian.net/pipermail/pkg-shadow-commits/
S/Key support:
Shadow can be built with S/Key support using the S/Key package from:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libskey/
or
http://gentoo.osuosl.org/distfiles/skey-1.1.5.tar.bz2
Authors and contributors
========================
Thanks to at least the following people for sending patches, bug
reports and various comments. This list may be incomplete, I received
a lot of mail...
Adam Rudnicki <adam@v-lo.krakow.pl>
Alan Curry <pacman@tardis.mars.net>
Aleksa Sarai <cyphar@cyphar.com>
Alexander O. Yuriev <alex@bach.cis.temple.edu>
Algis Rudys <arudys@rice.edu>
Andreas Jaeger <aj@arthur.rhein-neckar.de>
Aniello Del Sorbo <anidel@edu-gw.dia.unisa.it>
Anton Gluck <gluc@midway.uchicago.edu>
Arkadiusz Miskiewicz <misiek@pld.org.pl>
Ben Collins <bcollins@debian.org>
Brian R. Gaeke <brg@dgate.org>
Calle Karlsson <ckn@kash.se>
Chip Rosenthal <chip@unicom.com>
Chris Evans <lady0110@sable.ox.ac.uk>
Chris Lamb <chris@chris-lamb.co.uk>
Cristian Gafton <gafton@sorosis.ro>
Dan Walsh <dwalsh@redhat.com>
Darcy Boese <possum@chardonnay.niagara.com>
Dave Hagewood <admin@arrowweb.com>
David A. Holland <dholland@hcs.harvard.edu>
David Frey <David.Frey@lugs.ch>
Ed Carp <ecarp@netcom.com>
Ed Neville <ed@s5h.net>
Eric W. Biederman" <ebiederm@xmission.com>
Floody <flood@evcom.net>
Frank Denis <j@4u.net>
George Kraft IV <gk4@us.ibm.com>
Greg Mortensen <loki@world.std.com>
Guido van Rooij
Guy Maor <maor@debian.org>
Hrvoje Dogan <hdogan@bjesomar.srce.hr>
Jakub Hrozek <jhrozek@redhat.com>
Janos Farkas <chexum@bankinf.banki.hu>
Jason Franklin <jason.franklin@quoininc.com>
Jay Soffian <jay@lw.net>
Jesse Thilo <Jesse.Thilo@pobox.com>
Joey Hess <joey@kite.ml.org>
John Adelsberger <jja@umr.edu>
Jonathan Hankins <jhankins@mailserv.homewood.k12.al.us>
Jon Lewis <jlewis@lewis.org>
Joshua Cowan <jcowan@hermit.reslife.okstate.edu>
Judd Bourgeois <shagboy@bluesky.net>
Juergen Heinzl <unicorn@noris.net>
Juha Virtanen <jiivee@iki.fi>
Julian Pidancet <julian.pidancet@gmail.com>
Julianne Frances Haugh <jockgrrl@ix.netcom.com>
Leonard N. Zubkoff <lnz@dandelion.com>
Luca Berra <bluca@www.polimi.it>
Lukáš Kuklínek <lkukline@redhat.com>
Lutz Schwalowsky <schwalow@mineralogie.uni-hamburg.de>
Marc Ewing <marc@redhat.com>
Martin Bene <mb@sime.com>
Martin Mares <mj@gts.cz>
Michael Meskes <meskes@topsystem.de>
Michael Talbot-Wilson <mike@calypso.bns.com.au>
Michael Vetter <jubalh@iodoru.org>
Mike Frysinger <vapier@gentoo.org>
Mike Pakovic <mpakovic@users.southeast.net>
Nicolas François <nicolas.francois@centraliens.net>
Nikos Mavroyanopoulos <nmav@i-net.paiko.gr>
Pavel Machek <pavel@bug.ucw.cz>
Peter Vrabec <pvrabec@redhat.com>
Phillip Street
Rafał Maszkowski <rzm@icm.edu.pl>
Rani Chouha <ranibey@smartec.com>
Sami Kerola <kerolasa@rocketmail.com>
Scott Garman <scott.a.garman@intel.com>
Sebastian Rick Rijkers <srrijkers@gmail.com>
Seraphim Mellos <mellos@ceid.upatras.gr>
Shane Watts <shane@nexus.mlckew.edu.au>
Steve M. Robbins <steve@nyongwa.montreal.qc.ca>
Thorsten Kukuk <kukuk@suse.de>
Tim Hockin <thockin@eagle.ais.net>
Timo Karjalainen <timok@iki.fi>
Ulisses Alonso Camaro <ulisses@pusa.eleinf.uv.es>
Werner Fink <werner@suse.de>
Maintainers
===========
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)

1
README Symbolic link
View File

@@ -0,0 +1 @@
README.md

36
README.md Normal file
View File

@@ -0,0 +1,36 @@
# shadow-utils
## Introduction
The shadow-utils package includes the necessary programs for
converting UNIX password files to the shadow password format, plus
programs for managing user and group accounts. The pwconv command
converts passwords to the shadow password format. The pwunconv command
unconverts shadow passwords and generates a passwd file (a standard
UNIX password file). The pwck command checks the integrity of password
and shadow files. The lastlog command prints out the last login times
for all users. The useradd, userdel, and usermod commands are used for
managing user accounts. The groupadd, groupdel, and groupmod commands
are used for managing group accounts.
## Sites
* [Homepage](https://github.com/shadow-maint/shadow)
* [Issue tracker](https://github.com/shadow-maint/shadow/issues)
* [Releases](https://github.com/shadow-maint/shadow/releases)
## Contacts
There are several ways to contact us:
* [the general discussion mailing list](
https://alioth-lists.debian.net/mailman/listinfo/pkg-shadow-devel)
* the #shadow IRC channel on libera.chat:
* irc://irc.libera.chat/shadow
### Mailing archives
* [the general discussion mailing list archive](
https://alioth-lists.debian.net/pipermail/pkg-shadow-devel/)
* [the commit mailing list archive](
https://alioth-lists-archive.debian.net/pipermail/pkg-shadow-commits/),
only used for historical purposes
## Authors and maintainers
Authors and maintainers are listed in [AUTHORS.md](
https://github.com/shadow-maint/shadow/blob/master/AUTHORS.md).

11
SECURITY.md Normal file
View File

@@ -0,0 +1,11 @@
# Security Policy
## Supported Versions
At the moment only the latest release is supported.
## Reporting a Vulnerability
Security vulnerabilities may be reported to
* Serge Hallyn <serge@hallyn.com> (B175CFA98F192AF2)
* Christian Brauner <christian@brauner.io> (4880B8C9BD0E5106FC070F4F7B3C391EFEA93624)

View File

@@ -1,10 +1,10 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ([2.69])
m4_define([libsubid_abi_major], 3) m4_define([libsubid_abi_major], 4)
m4_define([libsubid_abi_minor], 0) m4_define([libsubid_abi_minor], 0)
m4_define([libsubid_abi_micro], 0) m4_define([libsubid_abi_micro], 0)
m4_define([libsubid_abi], [libsubid_abi_major.libsubid_abi_minor.libsubid_abi_micro]) m4_define([libsubid_abi], [libsubid_abi_major.libsubid_abi_minor.libsubid_abi_micro])
AC_INIT([shadow], [4.9], [pkg-shadow-devel@lists.alioth.debian.org], [], AC_INIT([shadow], [4.10], [pkg-shadow-devel@lists.alioth.debian.org], [],
[https://github.com/shadow-maint/shadow]) [https://github.com/shadow-maint/shadow])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz]) AM_INIT_AUTOMAKE([1.11 foreign dist-xz])
AC_CONFIG_MACRO_DIRS([m4]) AC_CONFIG_MACRO_DIRS([m4])
@@ -321,6 +321,8 @@ if test "$with_sha_crypt" = "yes"; then
AC_DEFINE(USE_SHA_CRYPT, 1, [Define to allow the SHA256 and SHA512 password encryption algorithms]) AC_DEFINE(USE_SHA_CRYPT, 1, [Define to allow the SHA256 and SHA512 password encryption algorithms])
fi fi
AM_CONDITIONAL(ENABLE_SHARED, test "x$enable_shared" = "xyes")
AM_CONDITIONAL(USE_BCRYPT, test "x$with_bcrypt" = "xyes") AM_CONDITIONAL(USE_BCRYPT, test "x$with_bcrypt" = "xyes")
if test "$with_bcrypt" = "yes"; then if test "$with_bcrypt" = "yes"; then
AC_DEFINE(USE_BCRYPT, 1, [Define to allow the bcrypt password encryption algorithm]) AC_DEFINE(USE_BCRYPT, 1, [Define to allow the bcrypt password encryption algorithm])
@@ -343,7 +345,7 @@ if test "$with_sssd" = "yes"; then
[AC_MSG_ERROR([posix_spawn is needed for sssd support])]) [AC_MSG_ERROR([posix_spawn is needed for sssd support])])
fi fi
AS_IF([test "$with_su" != "no"], AC_DEFINE(WITH_SU, 1, [Build with su])]) AS_IF([test "$with_su" != "no"], AC_DEFINE(WITH_SU, 1, [Build with su]))
AM_CONDITIONAL([WITH_SU], [test "x$with_su" != "xno"]) AM_CONDITIONAL([WITH_SU], [test "x$with_su" != "xno"])
dnl Check for some functions in libc first, only if not found check for dnl Check for some functions in libc first, only if not found check for
@@ -739,6 +741,7 @@ AC_CONFIG_FILES([
libmisc/Makefile libmisc/Makefile
lib/Makefile lib/Makefile
libsubid/Makefile libsubid/Makefile
libsubid/subid.h
src/Makefile src/Makefile
contrib/Makefile contrib/Makefile
etc/Makefile etc/Makefile

View File

@@ -1311,7 +1311,7 @@
This means that fred's password is valid, it was last changed on This means that fred's password is valid, it was last changed on
03/04/96, it can be changed at any time, it expires after 60 days, 03/04/96, it can be changed at any time, it expires after 60 days,
fred will not be warned, and and the account won't be disabled when fred will not be warned, and the account won't be disabled when
the password expires. the password expires.
This simply means that if fred logs in after the password expires, he This simply means that if fred logs in after the password expires, he
@@ -1487,7 +1487,7 @@
If a user logs into a line that is listed in /etc/dialups, and his If a user logs into a line that is listed in /etc/dialups, and his
shell is listed in the file /etc/d_passwd he will be allowed access shell is listed in the file /etc/d_passwd he will be allowed access
only by suppling the correct password. only by supplying the correct password.
Another useful purpose for using dial-up passwords might be to setup a Another useful purpose for using dial-up passwords might be to setup a
line that only allows a certain type of connect (perhaps a PPP or UUCP line that only allows a certain type of connect (perhaps a PPP or UUCP

View File

@@ -63,4 +63,3 @@ To completely disable limits for a user, a single dash (-) will do.
Also, please note that all limit settings are set PER LOGIN. They are Also, please note that all limit settings are set PER LOGIN. They are
not global, nor are they permanent. Perhaps global limits will come, but not global, nor are they permanent. Perhaps global limits will come, but
for now this will have to do ;) for now this will have to do ;)

4
doc/README.skey Normal file
View File

@@ -0,0 +1,4 @@
# S/Key support
shadow-utils can be built with S/Key support using the S/Key package from:
* http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libskey/ or
* https://gentoo.osuosl.org/distfiles/skey-1.1.5.tar.bz2

View File

@@ -37,4 +37,3 @@ New ideas to add to this list are welcome, too. --marekm
per-user configuration, to be executed with run-parts. Some hooks should per-user configuration, to be executed with run-parts. Some hooks should
be executed at package install time for existing users, likewise for be executed at package install time for existing users, likewise for
package removal and possibly modification. (Debian Bug#36019) package removal and possibly modification. (Debian Bug#36019)

View File

@@ -1,4 +1,4 @@
<HEAD> <head>
<title>shadow - Welcome</title> <title>shadow - Welcome</title>
</head> </head>
<body> <body>

View File

@@ -465,7 +465,6 @@ USERGROUPS_ENAB yes
# Set to "yes" to prevent for all accounts # Set to "yes" to prevent for all accounts
# Set to "superuser" to prevent for UID 0 / root (default) # Set to "superuser" to prevent for UID 0 / root (default)
# Set to "no" to not prevent for any account (dangerous, historical default) # Set to "no" to not prevent for any account (dangerous, historical default)
PREVENT_NO_AUTH superuser PREVENT_NO_AUTH superuser
# #

View File

@@ -10,6 +10,8 @@ if HAVE_VENDORDIR
libshadow_la_CPPFLAGS += -DVENDORDIR=\"$(VENDORDIR)\" libshadow_la_CPPFLAGS += -DVENDORDIR=\"$(VENDORDIR)\"
endif endif
libshadow_la_CPPFLAGS += -I$(top_srcdir)
libshadow_la_SOURCES = \ libshadow_la_SOURCES = \
commonio.c \ commonio.c \
commonio.h \ commonio.h \

View File

@@ -403,11 +403,11 @@ int commonio_lock_nowait (struct commonio_db *db, bool log)
file_len = strlen(db->filename) + 11;/* %lu max size */ file_len = strlen(db->filename) + 11;/* %lu max size */
lock_file_len = strlen(db->filename) + 6; /* sizeof ".lock" */ lock_file_len = strlen(db->filename) + 6; /* sizeof ".lock" */
file = (char*)malloc(file_len); file = (char*)malloc(file_len);
if(file == NULL) { if (file == NULL) {
goto cleanup_ENOMEM; goto cleanup_ENOMEM;
} }
lock = (char*)malloc(lock_file_len); lock = (char*)malloc(lock_file_len);
if(lock == NULL) { if (lock == NULL) {
goto cleanup_ENOMEM; goto cleanup_ENOMEM;
} }
snprintf (file, file_len, "%s.%lu", snprintf (file, file_len, "%s.%lu",
@@ -419,9 +419,9 @@ int commonio_lock_nowait (struct commonio_db *db, bool log)
err = 1; err = 1;
} }
cleanup_ENOMEM: cleanup_ENOMEM:
if(file) if (file)
free(file); free(file);
if(lock) if (lock)
free(lock); free(lock);
return err; return err;
} }

View File

@@ -45,8 +45,8 @@
struct faillog { struct faillog {
short fail_cnt; /* failures since last success */ short fail_cnt; /* failures since last success */
short fail_max; /* failures before turning account off */ short fail_max; /* failures before turning account off */
char fail_line[12]; /* last failure occured here */ char fail_line[12]; /* last failure occurred here */
time_t fail_time; /* last failure occured then */ time_t fail_time; /* last failure occurred then */
/* /*
* If nonzero, the account will be re-enabled if there are no * If nonzero, the account will be re-enabled if there are no
* failures for fail_locktime seconds since last failure. * failures for fail_locktime seconds since last failure.

View File

@@ -392,6 +392,7 @@ extern /*@observer@*/const char *crypt_make_salt (/*@null@*//*@observer@*/const
/* selinux.c */ /* selinux.c */
#ifdef WITH_SELINUX #ifdef WITH_SELINUX
extern int set_selinux_file_context (const char *dst_name, mode_t mode); extern int set_selinux_file_context (const char *dst_name, mode_t mode);
extern void reset_selinux_handle (void);
extern int reset_selinux_file_context (void); extern int reset_selinux_file_context (void);
extern int check_selinux_permit (const char *perm_name); extern int check_selinux_permit (const char *perm_name);
#endif #endif

View File

@@ -127,7 +127,7 @@ int pw_auth (const char *cipher,
#ifdef SKEY #ifdef SKEY
/* /*
* If the user has an S/KEY entry show them the pertinent info * If the user has an S/KEY entry show them the pertinent info
* and then we can try validating the created cyphertext and the SKEY. * and then we can try validating the created ciphertext and the SKEY.
* If there is no SKEY information we default to not using SKEY. * If there is no SKEY information we default to not using SKEY.
*/ */

View File

@@ -93,14 +93,16 @@
void pw_free (/*@out@*/ /*@only@*/struct passwd *pwent) void pw_free (/*@out@*/ /*@only@*/struct passwd *pwent)
{ {
free (pwent->pw_name); if (pwent != NULL) {
if (pwent->pw_passwd) { free (pwent->pw_name);
memzero (pwent->pw_passwd, strlen (pwent->pw_passwd)); if (pwent->pw_passwd) {
free (pwent->pw_passwd); memzero (pwent->pw_passwd, strlen (pwent->pw_passwd));
free (pwent->pw_passwd);
}
free (pwent->pw_gecos);
free (pwent->pw_dir);
free (pwent->pw_shell);
free (pwent);
} }
free (pwent->pw_gecos);
free (pwent->pw_dir);
free (pwent->pw_shell);
free (pwent);
} }

View File

@@ -17,7 +17,7 @@ int run_part (char *script_path, char *name, char *action)
char *args[] = { script_path, NULL }; char *args[] = { script_path, NULL };
pid=fork(); pid=fork();
if (pid==-1){ if (pid==-1) {
perror ("Could not fork"); perror ("Could not fork");
return 1; return 1;
} }

View File

@@ -50,6 +50,11 @@ static void cleanup(void)
} }
} }
void reset_selinux_handle (void)
{
cleanup();
}
/* /*
* set_selinux_file_context - Set the security context before any file or * set_selinux_file_context - Set the security context before any file or
* directory creation. * directory creation.

View File

@@ -293,6 +293,7 @@ int set_seuser (const char *login_name, const char *seuser_name)
} }
ret = 0; ret = 0;
reset_selinux_handle();
done: done:
semanage_seuser_key_free (key); semanage_seuser_key_free (key);

View File

@@ -91,7 +91,7 @@ struct passwd *sgetpwent (const char *buf)
} }
/* something at the end, columns over shot */ /* something at the end, columns over shot */
if( cp != NULL ) { if ( cp != NULL ) {
return( NULL ); return( NULL );
} }

View File

@@ -79,11 +79,13 @@
void spw_free (/*@out@*/ /*@only@*/struct spwd *spent) void spw_free (/*@out@*/ /*@only@*/struct spwd *spent)
{ {
free (spent->sp_namp); if (spent != NULL) {
if (NULL != spent->sp_pwdp) { free (spent->sp_namp);
memzero (spent->sp_pwdp, strlen (spent->sp_pwdp)); if (NULL != spent->sp_pwdp) {
free (spent->sp_pwdp); memzero (spent->sp_pwdp, strlen (spent->sp_pwdp));
free (spent->sp_pwdp);
}
free (spent);
} }
free (spent);
} }

View File

@@ -224,7 +224,7 @@ static const struct subordinate_range *find_range(struct commonio_db *db,
/* Get UID of the username we are looking for */ /* Get UID of the username we are looking for */
pwd = getpwnam(owner); pwd = getpwnam(owner);
if (NULL == pwd) { if (NULL == pwd) {
/* Username not defined in /etc/passwd, or error occured during lookup */ /* Username not defined in /etc/passwd, or error occurred during lookup */
return NULL; return NULL;
} }
owner_uid = pwd->pw_uid; owner_uid = pwd->pw_uid;
@@ -847,7 +847,7 @@ static int append_uids(uid_t **uids, const char *owner, int n)
} else { } else {
struct passwd *pwd = getpwnam(owner); struct passwd *pwd = getpwnam(owner);
if (NULL == pwd) { if (NULL == pwd) {
/* Username not defined in /etc/passwd, or error occured during lookup */ /* Username not defined in /etc/passwd, or error occurred during lookup */
free(*uids); free(*uids);
*uids = NULL; *uids = NULL;
return -1; return -1;

View File

@@ -523,6 +523,12 @@ shadowtcb_status shadowtcb_move (/*@NULL@*/const char *user_newname, uid_t user_
Prog, tcbdir, strerror (errno)); Prog, tcbdir, strerror (errno));
goto out_free; goto out_free;
} }
if (chmod (tcbdir, dirmode.st_mode & 07777) != 0) {
fprintf (shadow_logfd,
_("%s: Cannot change mode of %s: %s\n"),
Prog, tcbdir, strerror (errno));
goto out_free;
}
ret = SHADOWTCB_SUCCESS; ret = SHADOWTCB_SUCCESS;
out_free: out_free:
free (tcbdir); free (tcbdir);

View File

@@ -1,7 +1,7 @@
EXTRA_DIST = .indent.pro xgetXXbyYY.c EXTRA_DIST = .indent.pro xgetXXbyYY.c
AM_CPPFLAGS = -I$(top_srcdir)/lib $(ECONF_CPPFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir) $(ECONF_CPPFLAGS)
noinst_LTLIBRARIES = libmisc.la noinst_LTLIBRARIES = libmisc.la

View File

@@ -90,7 +90,7 @@ bool hushed (const char *username)
return false; return false;
} }
for (found = false; !found && (fgets (buf, (int) sizeof buf, fp) == buf);) { for (found = false; !found && (fgets (buf, (int) sizeof buf, fp) == buf);) {
buf[strlen (buf) - 1] = '\0'; buf[strcspn (buf, "\n")] = '\0';
found = (strcmp (buf, pw->pw_shell) == 0) || found = (strcmp (buf, pw->pw_shell) == 0) ||
(strcmp (buf, pw->pw_name) == 0); (strcmp (buf, pw->pw_name) == 0);
} }

View File

@@ -209,7 +209,7 @@ void write_mapping(int proc_dir_fd, int ranges, struct map_range *mappings,
} }
#endif #endif
bufsize = ranges * ((ULONG_DIGITS + 1) * 3); bufsize = ranges * ((ULONG_DIGITS + 1) * 3);
pos = buf = xmalloc(bufsize); pos = buf = xmalloc(bufsize);
/* Build the mapping command */ /* Build the mapping command */

View File

@@ -202,7 +202,7 @@ static int check_logins (const char *name, const char *maxlogins)
return 0; return 0;
} }
/* Function setup_user_limits - checks/set limits for the curent login /* Function setup_user_limits - checks/set limits for the current login
* Original idea from Joel Katz's lshell. Ported to shadow-login * Original idea from Joel Katz's lshell. Ported to shadow-login
* by Cristian Gafton - gafton@sorosis.ro * by Cristian Gafton - gafton@sorosis.ro
* *
@@ -404,7 +404,7 @@ static bool user_in_group (const char *uname, const char *gname)
{ {
struct group *groupdata; struct group *groupdata;
if (uname == NULL || gname == NULL){ if (uname == NULL || gname == NULL) {
return false; return false;
} }

View File

@@ -176,10 +176,10 @@ extern struct group *prefix_getgrnam(const char *name)
struct group * grp = NULL; struct group * grp = NULL;
fg = fopen(group_db_file, "rt"); fg = fopen(group_db_file, "rt");
if(!fg) if (!fg)
return NULL; return NULL;
while((grp = fgetgrent(fg)) != NULL) { while ((grp = fgetgrent(fg)) != NULL) {
if(!strcmp(name, grp->gr_name)) if (!strcmp(name, grp->gr_name))
break; break;
} }
fclose(fg); fclose(fg);
@@ -196,10 +196,10 @@ extern struct group *prefix_getgrgid(gid_t gid)
struct group * grp = NULL; struct group * grp = NULL;
fg = fopen(group_db_file, "rt"); fg = fopen(group_db_file, "rt");
if(!fg) if (!fg)
return NULL; return NULL;
while((grp = fgetgrent(fg)) != NULL) { while ((grp = fgetgrent(fg)) != NULL) {
if(gid == grp->gr_gid) if (gid == grp->gr_gid)
break; break;
} }
fclose(fg); fclose(fg);
@@ -216,10 +216,10 @@ extern struct passwd *prefix_getpwuid(uid_t uid)
struct passwd *pwd = NULL; struct passwd *pwd = NULL;
fg = fopen(passwd_db_file, "rt"); fg = fopen(passwd_db_file, "rt");
if(!fg) if (!fg)
return NULL; return NULL;
while((pwd = fgetpwent(fg)) != NULL) { while ((pwd = fgetpwent(fg)) != NULL) {
if(uid == pwd->pw_uid) if (uid == pwd->pw_uid)
break; break;
} }
fclose(fg); fclose(fg);
@@ -236,10 +236,10 @@ extern struct passwd *prefix_getpwnam(const char* name)
struct passwd *pwd = NULL; struct passwd *pwd = NULL;
fg = fopen(passwd_db_file, "rt"); fg = fopen(passwd_db_file, "rt");
if(!fg) if (!fg)
return NULL; return NULL;
while((pwd = fgetpwent(fg)) != NULL) { while ((pwd = fgetpwent(fg)) != NULL) {
if(!strcmp(name, pwd->pw_name)) if (!strcmp(name, pwd->pw_name))
break; break;
} }
fclose(fg); fclose(fg);
@@ -256,10 +256,10 @@ extern struct spwd *prefix_getspnam(const char* name)
struct spwd *sp = NULL; struct spwd *sp = NULL;
fg = fopen(spw_db_file, "rt"); fg = fopen(spw_db_file, "rt");
if(!fg) if (!fg)
return NULL; return NULL;
while((sp = fgetspent(fg)) != NULL) { while ((sp = fgetspent(fg)) != NULL) {
if(!strcmp(name, sp->sp_namp)) if (!strcmp(name, sp->sp_namp))
break; break;
} }
fclose(fg); fclose(fg);
@@ -272,7 +272,7 @@ extern struct spwd *prefix_getspnam(const char* name)
extern void prefix_setpwent() extern void prefix_setpwent()
{ {
if(!passwd_db_file) { if (!passwd_db_file) {
setpwent(); setpwent();
return; return;
} }
@@ -280,19 +280,22 @@ extern void prefix_setpwent()
fclose (fp_pwent); fclose (fp_pwent);
fp_pwent = fopen(passwd_db_file, "rt"); fp_pwent = fopen(passwd_db_file, "rt");
if(!fp_pwent) if (!fp_pwent)
return; return;
} }
extern struct passwd* prefix_getpwent() extern struct passwd* prefix_getpwent()
{ {
if(!passwd_db_file) { if (!passwd_db_file) {
return getpwent(); return getpwent();
} }
if (!fp_pwent) {
return NULL;
}
return fgetpwent(fp_pwent); return fgetpwent(fp_pwent);
} }
extern void prefix_endpwent() extern void prefix_endpwent()
{ {
if(!passwd_db_file) { if (!passwd_db_file) {
endpwent(); endpwent();
return; return;
} }
@@ -303,7 +306,7 @@ extern void prefix_endpwent()
extern void prefix_setgrent() extern void prefix_setgrent()
{ {
if(!group_db_file) { if (!group_db_file) {
setgrent(); setgrent();
return; return;
} }
@@ -311,19 +314,19 @@ extern void prefix_setgrent()
fclose (fp_grent); fclose (fp_grent);
fp_grent = fopen(group_db_file, "rt"); fp_grent = fopen(group_db_file, "rt");
if(!fp_grent) if (!fp_grent)
return; return;
} }
extern struct group* prefix_getgrent() extern struct group* prefix_getgrent()
{ {
if(!group_db_file) { if (!group_db_file) {
return getgrent(); return getgrent();
} }
return fgetgrent(fp_grent); return fgetgrent(fp_grent);
} }
extern void prefix_endgrent() extern void prefix_endgrent()
{ {
if(!group_db_file) { if (!group_db_file) {
endgrent(); endgrent();
return; return;
} }

View File

@@ -223,20 +223,21 @@ static /*@observer@*/const unsigned long SHA_get_salt_rounds (/*@null@*/int *pre
if ((-1 == min_rounds) && (-1 == max_rounds)) { if ((-1 == min_rounds) && (-1 == max_rounds)) {
rounds = SHA_ROUNDS_DEFAULT; rounds = SHA_ROUNDS_DEFAULT;
} }
else {
if (-1 == min_rounds) {
min_rounds = max_rounds;
}
if (-1 == min_rounds) { if (-1 == max_rounds) {
min_rounds = max_rounds; max_rounds = min_rounds;
}
if (min_rounds > max_rounds) {
max_rounds = min_rounds;
}
rounds = (unsigned long) shadow_random (min_rounds, max_rounds);
} }
if (-1 == max_rounds) {
max_rounds = min_rounds;
}
if (min_rounds > max_rounds) {
max_rounds = min_rounds;
}
rounds = (unsigned long) shadow_random (min_rounds, max_rounds);
} else if (0 == *prefered_rounds) { } else if (0 == *prefered_rounds) {
rounds = SHA_ROUNDS_DEFAULT; rounds = SHA_ROUNDS_DEFAULT;
} else { } else {

View File

@@ -1,7 +1,10 @@
lib_LTLIBRARIES = libsubid.la lib_LTLIBRARIES = libsubid.la
if ENABLE_SHARED
libsubid_la_LDFLAGS = -Wl,-soname,libsubid.so.@LIBSUBID_ABI@ \ libsubid_la_LDFLAGS = -Wl,-soname,libsubid.so.@LIBSUBID_ABI@ \
-shared -version-info @LIBSUBID_ABI_MAJOR@ -shared -version-info @LIBSUBID_ABI_MAJOR@
endif
libsubid_la_SOURCES = api.c libsubid_la_SOURCES = api.c
libsubid_la_LDFLAGS = -export-symbols-regex '^subid_'
pkginclude_HEADERS = subid.h pkginclude_HEADERS = subid.h
@@ -9,6 +12,7 @@ MISCLIBS = \
$(LIBAUDIT) \ $(LIBAUDIT) \
$(LIBSELINUX) \ $(LIBSELINUX) \
$(LIBSEMANAGE) \ $(LIBSEMANAGE) \
$(LIBCRACK) \
$(LIBCRYPT_NOPAM) \ $(LIBCRYPT_NOPAM) \
$(LIBSKEY) \ $(LIBSKEY) \
$(LIBMD) \ $(LIBMD) \
@@ -16,11 +20,12 @@ MISCLIBS = \
$(LIBCRYPT) \ $(LIBCRYPT) \
$(LIBACL) \ $(LIBACL) \
$(LIBATTR) \ $(LIBATTR) \
$(LIBTCB) $(LIBTCB) \
$(LIBPAM)
libsubid_la_LIBADD = \ libsubid_la_LIBADD = \
$(top_srcdir)/lib/libshadow.la \ $(top_builddir)/lib/libshadow.la \
$(top_srcdir)/libmisc/libmisc.la \ $(top_builddir)/libmisc/libmisc.la \
$(MISCLIBS) -ldl $(MISCLIBS) -ldl
AM_CPPFLAGS = \ AM_CPPFLAGS = \

View File

@@ -39,10 +39,10 @@
#include "idmapping.h" #include "idmapping.h"
#include "subid.h" #include "subid.h"
const char *Prog = "(libsubid)"; static const char *Prog = "(libsubid)";
FILE *shadow_logfd; static FILE *shadow_logfd;
bool libsubid_init(const char *progname, FILE * logfd) bool subid_init(const char *progname, FILE * logfd)
{ {
if (progname) { if (progname) {
progname = strdup(progname); progname = strdup(progname);
@@ -70,12 +70,12 @@ int get_subid_ranges(const char *owner, enum subid_type id_type, struct subid_ra
return list_owner_ranges(owner, id_type, ranges); return list_owner_ranges(owner, id_type, ranges);
} }
int get_subuid_ranges(const char *owner, struct subid_range **ranges) int subid_get_uid_ranges(const char *owner, struct subid_range **ranges)
{ {
return get_subid_ranges(owner, ID_TYPE_UID, ranges); return get_subid_ranges(owner, ID_TYPE_UID, ranges);
} }
int get_subgid_ranges(const char *owner, struct subid_range **ranges) int subid_get_gid_ranges(const char *owner, struct subid_range **ranges)
{ {
return get_subid_ranges(owner, ID_TYPE_GID, ranges); return get_subid_ranges(owner, ID_TYPE_GID, ranges);
} }
@@ -86,12 +86,12 @@ int get_subid_owner(unsigned long id, enum subid_type id_type, uid_t **owner)
return find_subid_owners(id, id_type, owner); return find_subid_owners(id, id_type, owner);
} }
int get_subuid_owners(uid_t uid, uid_t **owner) int subid_get_uid_owners(uid_t uid, uid_t **owner)
{ {
return get_subid_owner((unsigned long)uid, ID_TYPE_UID, owner); return get_subid_owner((unsigned long)uid, ID_TYPE_UID, owner);
} }
int get_subgid_owners(gid_t gid, uid_t **owner) int subid_get_gid_owners(gid_t gid, uid_t **owner)
{ {
return get_subid_owner((unsigned long)gid, ID_TYPE_GID, owner); return get_subid_owner((unsigned long)gid, ID_TYPE_GID, owner);
} }
@@ -103,12 +103,12 @@ bool grant_subid_range(struct subordinate_range *range, bool reuse,
return new_subid_range(range, id_type, reuse); return new_subid_range(range, id_type, reuse);
} }
bool grant_subuid_range(struct subordinate_range *range, bool reuse) bool subid_grant_uid_range(struct subordinate_range *range, bool reuse)
{ {
return grant_subid_range(range, reuse, ID_TYPE_UID); return grant_subid_range(range, reuse, ID_TYPE_UID);
} }
bool grant_subgid_range(struct subordinate_range *range, bool reuse) bool subid_grant_gid_range(struct subordinate_range *range, bool reuse)
{ {
return grant_subid_range(range, reuse, ID_TYPE_GID); return grant_subid_range(range, reuse, ID_TYPE_GID);
} }
@@ -119,12 +119,12 @@ bool ungrant_subid_range(struct subordinate_range *range, enum subid_type id_typ
return release_subid_range(range, id_type); return release_subid_range(range, id_type);
} }
bool ungrant_subuid_range(struct subordinate_range *range) bool subid_ungrant_uid_range(struct subordinate_range *range)
{ {
return ungrant_subid_range(range, ID_TYPE_UID); return ungrant_subid_range(range, ID_TYPE_UID);
} }
bool ungrant_subgid_range(struct subordinate_range *range) bool subid_ungrant_gid_range(struct subordinate_range *range)
{ {
return ungrant_subid_range(range, ID_TYPE_GID); return ungrant_subid_range(range, ID_TYPE_GID);
} }

View File

@@ -4,6 +4,10 @@
#ifndef SUBID_RANGE_DEFINED #ifndef SUBID_RANGE_DEFINED
#define SUBID_RANGE_DEFINED 1 #define SUBID_RANGE_DEFINED 1
#define SUBID_ABI_VERSION @LIBSUBID_ABI_MAJOR@.@LIBSUBID_ABI_MINOR@.@LIBSUBID_ABI_MICRO@
#define SUBID_ABI_MAJOR @LIBSUBID_ABI_MAJOR@
#define SUBID_ABI_MINOR @LIBSUBID_ABI_MINOR@
#define SUBID_ABI_MICRO @LIBSUBID_ABI_MICRO@
/* subid_range is just a starting point and size of a range */ /* subid_range is just a starting point and size of a range */
struct subid_range { struct subid_range {
@@ -32,7 +36,7 @@ enum subid_status {
}; };
/* /*
* libsubid_init: initialize libsubid * subid_init: initialize libsubid
* *
* @progname: Name to display as program. If NULL, then "(libsubid)" will be * @progname: Name to display as program. If NULL, then "(libsubid)" will be
* shown in error messages. * shown in error messages.
@@ -45,10 +49,10 @@ enum subid_status {
* *
* Returns false if an error occurred. * Returns false if an error occurred.
*/ */
bool libsubid_init(const char *progname, FILE *logfd); bool subid_init(const char *progname, FILE *logfd);
/* /*
* get_subuid_ranges: return a list of UID ranges for a user * subid_get_uid_ranges: return a list of UID ranges for a user
* *
* @owner: username being queried * @owner: username being queried
* @ranges: a pointer to an array of subid_range structs in which the result * @ranges: a pointer to an array of subid_range structs in which the result
@@ -58,10 +62,10 @@ bool libsubid_init(const char *progname, FILE *logfd);
* *
* returns: number of ranges found, ir < 0 on error. * returns: number of ranges found, ir < 0 on error.
*/ */
int get_subuid_ranges(const char *owner, struct subid_range **ranges); int subid_get_uid_ranges(const char *owner, struct subid_range **ranges);
/* /*
* get_subgid_ranges: return a list of GID ranges for a user * subid_get_gid_ranges: return a list of GID ranges for a user
* *
* @owner: username being queried * @owner: username being queried
* @ranges: a pointer to an array of subid_range structs in which the result * @ranges: a pointer to an array of subid_range structs in which the result
@@ -71,10 +75,10 @@ int get_subuid_ranges(const char *owner, struct subid_range **ranges);
* *
* returns: number of ranges found, ir < 0 on error. * returns: number of ranges found, ir < 0 on error.
*/ */
int get_subgid_ranges(const char *owner, struct subid_range **ranges); int subid_get_gid_ranges(const char *owner, struct subid_range **ranges);
/* /*
* get_subuid_owners: return a list of uids to which the given uid has been * subid_get_uid_owners: return a list of uids to which the given uid has been
* delegated. * delegated.
* *
* @uid: The subuid being queried * @uid: The subuid being queried
@@ -83,10 +87,10 @@ int get_subgid_ranges(const char *owner, struct subid_range **ranges);
* *
* Returns the number of uids returned, or < 0 on error. * Returns the number of uids returned, or < 0 on error.
*/ */
int get_subuid_owners(uid_t uid, uid_t **owner); int subid_get_uid_owners(uid_t uid, uid_t **owner);
/* /*
* get_subgid_owners: return a list of uids to which the given gid has been * subid_get_gid_owners: return a list of uids to which the given gid has been
* delegated. * delegated.
* *
* @uid: The subgid being queried * @uid: The subgid being queried
@@ -95,10 +99,10 @@ int get_subuid_owners(uid_t uid, uid_t **owner);
* *
* Returns the number of uids returned, or < 0 on error. * Returns the number of uids returned, or < 0 on error.
*/ */
int get_subgid_owners(gid_t gid, uid_t **owner); int subid_get_gid_owners(gid_t gid, uid_t **owner);
/* /*
* grant_subuid_range: assign a subuid range to a user * subid_grant_uid_range: assign a subuid range to a user
* *
* @range: pointer to a struct subordinate_range detailing the UID range * @range: pointer to a struct subordinate_range detailing the UID range
* to allocate. ->owner must be the username, and ->count must be * to allocate. ->owner must be the username, and ->count must be
@@ -109,10 +113,10 @@ int get_subgid_owners(gid_t gid, uid_t **owner);
* then the range from (range->start, range->start + range->count) will * then the range from (range->start, range->start + range->count) will
* be delegated to range->owner. * be delegated to range->owner.
*/ */
bool grant_subuid_range(struct subordinate_range *range, bool reuse); bool subid_grant_uid_range(struct subordinate_range *range, bool reuse);
/* /*
* grant_subsid_range: assign a subgid range to a user * subid_grant_gid_range: assign a subgid range to a user
* *
* @range: pointer to a struct subordinate_range detailing the GID range * @range: pointer to a struct subordinate_range detailing the GID range
* to allocate. ->owner must be the username, and ->count must be * to allocate. ->owner must be the username, and ->count must be
@@ -123,10 +127,10 @@ bool grant_subuid_range(struct subordinate_range *range, bool reuse);
* then the range from (range->start, range->start + range->count) will * then the range from (range->start, range->start + range->count) will
* be delegated to range->owner. * be delegated to range->owner.
*/ */
bool grant_subgid_range(struct subordinate_range *range, bool reuse); bool subid_grant_gid_range(struct subordinate_range *range, bool reuse);
/* /*
* ungrant_subuid_range: remove a subuid allocation. * subid_ungrant_uid_range: remove a subuid allocation.
* *
* @range: pointer to a struct subordinate_range detailing the UID allocation * @range: pointer to a struct subordinate_range detailing the UID allocation
* to remove. * to remove.
@@ -134,10 +138,10 @@ bool grant_subgid_range(struct subordinate_range *range, bool reuse);
* Returns true if successful, false if it failed, for instance if the * Returns true if successful, false if it failed, for instance if the
* delegation did not exist. * delegation did not exist.
*/ */
bool ungrant_subuid_range(struct subordinate_range *range); bool subid_ungrant_uid_range(struct subordinate_range *range);
/* /*
* ungrant_subuid_range: remove a subgid allocation. * subid_ungrant_gid_range: remove a subgid allocation.
* *
* @range: pointer to a struct subordinate_range detailing the GID allocation * @range: pointer to a struct subordinate_range detailing the GID allocation
* to remove. * to remove.
@@ -145,7 +149,7 @@ bool ungrant_subuid_range(struct subordinate_range *range);
* Returns true if successful, false if it failed, for instance if the * Returns true if successful, false if it failed, for instance if the
* delegation did not exist. * delegation did not exist.
*/ */
bool ungrant_subgid_range(struct subordinate_range *range); bool subid_ungrant_gid_range(struct subordinate_range *range);
#define SUBID_NFIELDS 3 #define SUBID_NFIELDS 3
#endif #endif

View File

@@ -62,6 +62,7 @@ man_MANS += $(man_nopam)
endif endif
man_subids = \ man_subids = \
man1/getsubids.1 \
man1/newgidmap.1 \ man1/newgidmap.1 \
man1/newuidmap.1 \ man1/newuidmap.1 \
man5/subgid.5 \ man5/subgid.5 \
@@ -80,6 +81,7 @@ man_XMANS = \
expiry.1.xml \ expiry.1.xml \
faillog.5.xml \ faillog.5.xml \
faillog.8.xml \ faillog.8.xml \
getsubids.1.xml \
gpasswd.1.xml \ gpasswd.1.xml \
groupadd.8.xml \ groupadd.8.xml \
groupdel.8.xml \ groupdel.8.xml \

View File

@@ -1,4 +1,4 @@
.TH "GSHADOW" "5" "11/05/2005" "File Formats and Conversions" "File Formats and Conversions" .TH "GSHADOW" "5" "11/05/2005" "File Formats and Configuration Files" "File Formats and Configuration Files"
.\" disable hyphenation .\" disable hyphenation
.nh .nh
.\" disable justification (adjust text to left margin only) .\" disable justification (adjust text to left margin only)

View File

@@ -56,7 +56,7 @@
<refmeta> <refmeta>
<refentrytitle>faillog</refentrytitle> <refentrytitle>faillog</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc"> File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc"> File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

151
man/getsubids.1.xml Normal file
View File

@@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2021 Iker Pedrosa
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.
-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!-- SHADOW-CONFIG-HERE -->
]>
<refentry id='getsubids.1'>
<refentryinfo>
<author>
<firstname>Iker</firstname>
<surname>Pedrosa</surname>
<contrib>Creation, 2021</contrib>
</author>
</refentryinfo>
<refmeta>
<refentrytitle>getsubids</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="sectdesc">User Commands</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>getsubids</refname>
<refpurpose>get the subordinate id ranges for a user</refpurpose>
</refnamediv>
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
<command>getsubids</command>
<arg choice='opt'>
<replaceable>options</replaceable>
</arg>
<arg choice='plain'>
<replaceable>USER</replaceable>
</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id='description'>
<title>DESCRIPTION</title>
<para>
The <command>getsubids</command> command lists the subordinate user ID
ranges for a given user. The subordinate group IDs can be listed using
the <option>-g</option> option.
</para>
</refsect1>
<refsect1 id='options'>
<title>OPTIONS</title>
<para>
The options which apply to the <command>getsubids</command> command are:
</para>
<variablelist remap='IP'>
<varlistentry>
<term>
<option>-g</option>
</term>
<listitem>
<para>
List the subordinate group ID ranges.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-h</option>
</term>
<listitem>
<para>
Display help message and exit.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id='example'>
<title>EXAMPLE</title>
<para>
For example, to obtain the subordinate UIDs of the testuser:
</para>
<para>
<programlisting>
$ getsubids testuser
0: testuser 100000 65536
</programlisting>
</para>
<para>
This command output provides (in order from left to right) the list
index, username, UID range start, and number of UIDs in range.
</para>
</refsect1>
<refsect1 id='see_also'>
<title>SEE ALSO</title>
<para>
<citerefentry>
<refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>newgidmap</refentrytitle><manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>newuidmap</refentrytitle><manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>subgid</refentrytitle><manvolnum>5</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>subuid</refentrytitle><manvolnum>5</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>useradd</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>userdel</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>.
<citerefentry>
<refentrytitle>usermod</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
</para>
</refsect1>
</refentry>

View File

@@ -45,7 +45,7 @@
<refmeta> <refmeta>
<refentrytitle>gshadow</refentrytitle> <refentrytitle>gshadow</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc">File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

View File

@@ -117,4 +117,4 @@ chage \- ユーザパスワードの有効期限情報を変更する。
.BR passwd (5), .BR passwd (5),
.BR shadow (5) .BR shadow (5)
.SH 著者 .SH 著者
Julianne Frances Haugh <jockgrrl@ix.netcom.com> Julianne Frances Haugh <julie78787@gmail.com>

View File

@@ -69,4 +69,4 @@ chfn は現在のユーザアカウントに対して動作する。
.SH 関連項目 .SH 関連項目
.BR passwd (5) .BR passwd (5)
.SH 著者 .SH 著者
Julianne Frances Haugh <jockgrrl@ix.netcom.com> Julianne Frances Haugh <julie78787@gmail.com>

View File

@@ -69,4 +69,4 @@ chsh \- ログインシェルを変更する
.BR chfn (1), .BR chfn (1),
.BR passwd (5) .BR passwd (5)
.SH 著者 .SH 著者
Julianne Frances Haugh <jockgrrl@ix.netcom.com> Julianne Frances Haugh <julie78787@gmail.com>

View File

@@ -62,4 +62,4 @@ ID 値に対応する名前が \fI/etc/group\fR に登録されていなけれ
.BR getgid (2), .BR getgid (2),
.BR getgroups (2) .BR getgroups (2)
.SH 著者 .SH 著者
Julianne Frances Haugh <jockgrrl@ix.netcom.com> Julianne Frances Haugh <julie78787@gmail.com>

View File

@@ -54,4 +54,4 @@ id \- 現在のユーザ ID 名とグループ ID 名を表示する
.BR getgroups (2), .BR getgroups (2),
.BR getuid (2) .BR getuid (2)
.SH 著者 .SH 著者
Julianne Frances Haugh <jockgrrl@ix.netcom.com> Julianne Frances Haugh <julie78787@gmail.com>

View File

@@ -138,4 +138,4 @@ root が \fBlogin\fP を起動した場合にのみ用いる。
.BR passwd (5), .BR passwd (5),
.BR getty (8) .BR getty (8)
.SH 著者 .SH 著者
Julianne Frances Haugh <jockgrrl@ix.netcom.com> Julianne Frances Haugh <julie78787@gmail.com>

View File

@@ -89,4 +89,4 @@ sg の実行元となるであろうシェルのほとんどにおいて、
.BR login (1), .BR login (1),
.BR su (1) .BR su (1)
.SH 著者 .SH 著者
Julianne Frances Haugh <jockgrrl@ix.netcom.com> Julianne Frances Haugh <julie78787@gmail.com>

View File

@@ -214,4 +214,4 @@ NIS が動作していて、
.BR passwd (5), .BR passwd (5),
.BR shadow (5) .BR shadow (5)
.SH 著者 .SH 著者
Julianne Frances Haugh <jockgrrl@ix.netcom.com> Julianne Frances Haugh <julie78787@gmail.com>

View File

@@ -85,4 +85,4 @@ su \- ユーザIDを変更する。またはスーパーユーザになる
.BR login.defs (5), .BR login.defs (5),
.BR suauth (5) .BR suauth (5)
.SH 著者 .SH 著者
Julianne Frances Haugh <jockgrrl@ix.netcom.com> Julianne Frances Haugh <julie78787@gmail.com>

View File

@@ -150,4 +150,4 @@ shadowされたパスワードファイルへのアクセスは制限されて
.BR getpwent (3), .BR getpwent (3),
.BR shadow (5) .BR shadow (5)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -61,4 +61,4 @@ faillog \- ログイン失敗を記録するファイル
.SH 関連項目 .SH 関連項目
.BR faillog (8) .BR faillog (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -188,6 +188,6 @@ shadow パスワード機能によって提供されてきた機能の大部分
.BR shadow (5), .BR shadow (5),
.BR pam (8) .BR pam (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)
.br .br
Chip Rosenthal (chip@unicom.com) Chip Rosenthal (chip@unicom.com)

View File

@@ -110,4 +110,4 @@ ulimit= \- ulimit の初期設定値
.BR pwunconv (8), .BR pwunconv (8),
.BR sulogin (8) .BR sulogin (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -90,4 +90,4 @@ porttime \- ポートアクセス時間設定ファイル
.SH 関連項目 .SH 関連項目
.BR login (1) .BR login (1)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -99,4 +99,4 @@ a から z、A から Z のアルファベット、
.BR pwunconv (8), .BR pwunconv (8),
.BR sulogin (8) .BR sulogin (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -67,4 +67,4 @@
.BR newusers (8), .BR newusers (8),
.BR useradd (8) .BR useradd (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -94,4 +94,4 @@ faillog \- faillog を調べ、login 失敗の制限を設定する
.BR login (1), .BR login (1),
.BR faillog (5) .BR faillog (5)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -65,4 +65,4 @@ groupadd \- 新しいグループを作成する
.BR userdel (8), .BR userdel (8),
.BR usermod (8) .BR usermod (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -62,4 +62,4 @@ groupdel \- グループを削除する
.BR userdel (8), .BR userdel (8),
.BR usermod (8) .BR usermod (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -67,4 +67,4 @@ groupmod \- グループを修正する
.BR userdel (8), .BR userdel (8),
.BR usermod (8) .BR usermod (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -113,4 +113,4 @@ grpck \- グループファイルが正しいかどうか検査する
.IP 5 5 .IP 5 5
グループファイルを更新できない グループファイルを更新できない
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -75,6 +75,6 @@ lastlog プログラムは長時間画面に何も出力しないまま
UID が 171\-799 の間プログラムは何も出力しないので、 UID が 171\-799 の間プログラムは何も出力しないので、
ハングしたように見える)。 ハングしたように見える)。
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)
.BR .BR
Phillip Street Phillip Street

View File

@@ -52,4 +52,4 @@ logoutd \- ログイン時間の制限を実施する
.br .br
/etc/utmp \- 現在のログインセッション /etc/utmp \- 現在のログインセッション
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -68,4 +68,4 @@ newusers \- ユーザの新規作成や情報更新をバッチ処理で行う
.BR passwd (1), .BR passwd (1),
.BR useradd (8) .BR useradd (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -118,4 +118,4 @@ pwck \- パスワードファイルが正しいかどうか検査する
.IP 5 5 .IP 5 5
パスワードファイルを更新出来ない パスワードファイルを更新出来ない
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -92,4 +92,4 @@ co:s:respawn:/etc/sulogin /dev/console
.BR sh (1), .BR sh (1),
.BR init (8) .BR init (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -173,4 +173,4 @@ NIS のグループにユーザを加えてはならない。
.BR userdel (8), .BR userdel (8),
.BR usermod (8) .BR usermod (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -74,4 +74,4 @@ NIS のクライアントからは、NIS の属性値は削除できない。
.BR useradd (8), .BR useradd (8),
.BR usermod (8) .BR usermod (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -142,4 +142,4 @@ NIS に関する作業は NIS サーバ上で行なわなければならない
.BR useradd (8), .BR useradd (8),
.BR userdel (8) .BR userdel (8)
.SH 著者 .SH 著者
Julianne Frances Haugh (jockgrrl@ix.netcom.com) Julianne Frances Haugh (julie78787@gmail.com)

View File

@@ -58,7 +58,7 @@
<refmeta> <refmeta>
<refentrytitle>limits</refentrytitle> <refentrytitle>limits</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc">File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

View File

@@ -57,7 +57,7 @@
<refmeta> <refmeta>
<refentrytitle>login.access</refentrytitle> <refentrytitle>login.access</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc">File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

View File

@@ -125,7 +125,7 @@
<refmeta> <refmeta>
<refentrytitle>login.defs</refentrytitle> <refentrytitle>login.defs</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc">File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

View File

@@ -35,6 +35,8 @@
The mail spool directory. This is needed to manipulate the mailbox The mail spool directory. This is needed to manipulate the mailbox
when its corresponding user account is modified or deleted. If not when its corresponding user account is modified or deleted. If not
specified, a compile-time default is used. specified, a compile-time default is used.
The parameter CREATE_MAIL_SPOOL in <filename>/etc/default/useradd</filename>
determines whether the mail spool should be created.
</para> </para>
</listitem> </listitem>
</varlistentry><varlistentry> </varlistentry><varlistentry>

View File

@@ -56,7 +56,7 @@
<refmeta> <refmeta>
<refentrytitle>passwd</refentrytitle> <refentrytitle>passwd</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc">File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

View File

@@ -90,9 +90,17 @@ $(DOMAIN).pot-update: $(XMLFILES) $(srcdir)/XMLFILES remove-potcdate.sed
@set -e; tmpdir=`pwd`; \ @set -e; tmpdir=`pwd`; \
echo "cd $(top_srcdir)/man"; \ echo "cd $(top_srcdir)/man"; \
cd $(top_srcdir)/man; \ cd $(top_srcdir)/man; \
echo "xml2po --expand-all-entities -o $$tmpdir/$(DOMAIN).po $(notdir $(XMLFILES))"; \ files=""; \
xml2po --expand-all-entities -o $$tmpdir/$(DOMAIN).po $(notdir $(XMLFILES)); \ for file in $(notdir $(XMLFILES)); do \
cd $$tmpdir if grep -q SHADOW-CONFIG-HERE $$file ; then \
sed -e 's/^<!-- SHADOW-CONFIG-HERE -->/<!ENTITY % config SYSTEM "config.xml">%config;/' $$file > $$file.out; \
else \
sed -e 's/^\(<!DOCTYPE .*docbookx.dtd"\)>/\1 [<!ENTITY % config SYSTEM "config.xml">%config;]>/' $$file > $$file.out; \
fi; \
files="$$files $$file.out"; \
done; \
itstool -d -o $$tmpdir/$(DOMAIN).po $$files; \
cd $$tmpdir; \
test ! -f $(DOMAIN).po || { \ test ! -f $(DOMAIN).po || { \
if test -f $(srcdir)/$(DOMAIN).pot; then \ if test -f $(srcdir)/$(DOMAIN).pot; then \
sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \

View File

@@ -56,7 +56,7 @@
<refmeta> <refmeta>
<refentrytitle>porttime</refentrytitle> <refentrytitle>porttime</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc">File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

View File

@@ -56,7 +56,7 @@
<refmeta> <refmeta>
<refentrytitle>shadow</refentrytitle> <refentrytitle>shadow</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc">File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

View File

@@ -56,7 +56,7 @@
<refmeta> <refmeta>
<refentrytitle>suauth</refentrytitle> <refentrytitle>suauth</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc">File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

View File

@@ -47,7 +47,7 @@
<refmeta> <refmeta>
<refentrytitle>subgid</refentrytitle> <refentrytitle>subgid</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc">File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

View File

@@ -47,7 +47,7 @@
<refmeta> <refmeta>
<refentrytitle>subuid</refentrytitle> <refentrytitle>subuid</refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
<refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo> <refmiscinfo class="sectdesc">File Formats and Configuration Files</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo> <refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo> <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta> </refmeta>

View File

@@ -343,6 +343,12 @@
databases are reset to avoid reusing the entry from a previously databases are reset to avoid reusing the entry from a previously
deleted user. deleted user.
</para> </para>
<para>
If this option is not specified, <command>useradd</command>
will also consult the variable <option>LOG_INIT</option> in
the <filename>/etc/default/useradd</filename> if set to no
the user will not be added to the lastlog and faillog databases.
</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@@ -326,6 +326,17 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<option>-r</option>, <option>--remove</option>
</term>
<listitem>
<para>
Remove the user from named supplementary group(s). Use only with the
<option>-G</option> option.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<option>-R</option>, <option>--root</option>&nbsp;<replaceable>CHROOT_DIR</replaceable> <option>-R</option>, <option>--root</option>&nbsp;<replaceable>CHROOT_DIR</replaceable>

View File

@@ -1964,7 +1964,7 @@ msgstr ""
msgid "" msgid ""
" -l, --lock lock the password of the named account\n" " -l, --lock lock the password of the named account\n"
msgstr " -L, --lock lås passord for den valgt konto\n" msgstr " -l, --lock lås passord for den valgt konto\n"
msgid "" msgid ""
" -n, --mindays MIN_DAYS set minimum number of days before password\n" " -n, --mindays MIN_DAYS set minimum number of days before password\n"

125
po/nl.po
View File

@@ -1,14 +1,14 @@
# dutch po-file for shadow # dutch po-file for shadow
# Copyright (C) 2004 Free Software Foundation, Inc. # Copyright (C) 2004 Free Software Foundation, Inc.
# Bart Cornelis <cobaco@linux.be>, 2004, 2006. # Bart Cornelis <cobaco@linux.be>, 2004, 2006.
# Frans Spiesschaert <Frans.Spiesschaert@yucom.be>, 2014-2020. # Frans Spiesschaert <Frans.Spiesschaert@yucom.be>, 2014-2021.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: shadow_1_4.8.1-1\n" "Project-Id-Version: shadow 4.9\n"
"Report-Msgid-Bugs-To: pkg-shadow-devel@lists.alioth.debian.org\n" "Report-Msgid-Bugs-To: pkg-shadow-devel@lists.alioth.debian.org\n"
"POT-Creation-Date: 2021-07-04 12:20+0200\n" "POT-Creation-Date: 2021-07-04 12:20+0200\n"
"PO-Revision-Date: 2020-05-24 15:20+0200\n" "PO-Revision-Date: 2021-09-13 21:00+0200\n"
"Last-Translator: Frans Spiesschaert <Frans.Spiesschaert@yucom.be>\n" "Last-Translator: Frans Spiesschaert <Frans.Spiesschaert@yucom.be>\n"
"Language-Team: Debian Dutch l10n Team <debian-l10n-dutch@lists.debian.org>\n" "Language-Team: Debian Dutch l10n Team <debian-l10n-dutch@lists.debian.org>\n"
"Language: nl\n" "Language: nl\n"
@@ -559,7 +559,7 @@ msgstr "%s: chroot naar map %s lukt niet: %s\n"
#, c-format #, c-format
msgid "Unable to obtain random bytes.\n" msgid "Unable to obtain random bytes.\n"
msgstr "" msgstr "Kan geen willekeurige bytes verkrijgen.\n"
#, c-format #, c-format
msgid "" msgid ""
@@ -575,6 +575,9 @@ msgid ""
"ENCRYPT_METHOD and the corresponding configuration for your selected hash " "ENCRYPT_METHOD and the corresponding configuration for your selected hash "
"method.\n" "method.\n"
msgstr "" msgstr ""
"Kan geen salt genereren met instelling \"%s\", controleer uw instellingen in "
"ENCRYPT_METHOD en de bijbehorende configuratie voor uw geselecteerde hash-"
"methode.\n"
#, c-format #, c-format
msgid "Unable to cd to '%s'\n" msgid "Unable to cd to '%s'\n"
@@ -915,16 +918,12 @@ msgstr ""
" -m, --md5 het wachtwoord in klare tekst\n" " -m, --md5 het wachtwoord in klare tekst\n"
" met het MD5-algoritme versleutelen\n" " met het MD5-algoritme versleutelen\n"
#, fuzzy
#| msgid ""
#| " -s, --sha-rounds number of rounds for the SHA or BCRYPT\n"
#| " crypt algorithms\n"
msgid "" msgid ""
" -s, --sha-rounds number of rounds for the SHA, BCRYPT\n" " -s, --sha-rounds number of rounds for the SHA, BCRYPT\n"
" or YESCRYPT crypt algorithms\n" " or YESCRYPT crypt algorithms\n"
msgstr "" msgstr ""
" -s, --sha-rounds aantal rondes voor de SHA of BCRYPT\n" " -s, --sha-rounds aantal rondes voor de SHA, BCRYPT\n"
" encryptie-algoritmes\n" " of YESCRYPT encryptie-algoritmes\n"
#, c-format #, c-format
msgid "%s: %s flag is only allowed with the %s flag\n" msgid "%s: %s flag is only allowed with the %s flag\n"
@@ -1237,20 +1236,17 @@ msgstr ""
msgid " -r, --system create a system account\n" msgid " -r, --system create a system account\n"
msgstr " -r, --system een systeem-account aanmaken\n" msgstr " -r, --system een systeem-account aanmaken\n"
#, fuzzy
#| msgid " -P, --prefix PREFIX_DIR directory prefix\n"
msgid " -P, --prefix PREFIX_DI directory prefix\n" msgid " -P, --prefix PREFIX_DI directory prefix\n"
msgstr " -P, --prefix PREFIX_MAP map-prefix\n" msgstr " -P, --prefix PREFIX_MAP map-prefix\n"
#, fuzzy
#| msgid " -l, --list list the members of the group\n" #| msgid " -l, --list list the members of the group\n"
msgid " -U, --users USERS list of user members of this group\n" msgid " -U, --users USERS list of user members of this group\n"
msgstr " -l, --list de leden van de groep weergeven\n" msgstr ""
" -U, --users GEBRUIKERS lijst van leden-gebruikers van deze groep\n"
#, fuzzy, c-format #, c-format
#| msgid "invalid user name '%s'\n"
msgid "Invalid member username %s\n" msgid "Invalid member username %s\n"
msgstr "ongeldige gebruikersnaam '%s'\n" msgstr "Ongeldige lid-gebruikersnaam %s\n"
#, c-format #, c-format
msgid "%s: '%s' is not a valid group name\n" msgid "%s: '%s' is not a valid group name\n"
@@ -1367,22 +1363,14 @@ msgstr "%s: uw groepsnaam komt niet overeen met uw gebruikersnaam\n"
msgid "%s: only root can use the -g/--group option\n" msgid "%s: only root can use the -g/--group option\n"
msgstr "%s: enkel de systeembeheerder kan de optie -g/--group gebruiken\n" msgstr "%s: enkel de systeembeheerder kan de optie -g/--group gebruiken\n"
#, fuzzy
#| msgid ""
#| " -a, --append append the user to the supplemental "
#| "GROUPS\n"
#| " mentioned by the -G option without "
#| "removing\n"
#| " the user from other groups\n"
msgid "" msgid ""
" -a, --append append the users mentioned by -U option to " " -a, --append append the users mentioned by -U option to "
"the group \n" "the group \n"
" without removing existing user members\n" " without removing existing user members\n"
msgstr "" msgstr ""
" -a, --append gebruiker toevoegen aan de bijkomende " " -a, --append de gebruikers, vermeld met de optie -U, \n"
"GROEPEN,\n" " toevoegen aan de groep, zonder \n"
" vermeld bij de optie -G, zonder hem/haar\n" " bestaande leden-gebruikers te verwijderen\n"
" te verwijderen uit andere groepen\n"
msgid " -g, --gid GID change the group ID to GID\n" msgid " -g, --gid GID change the group ID to GID\n"
msgstr " -g, --gid GID het groeps-ID naar GID veranderen\n" msgstr " -g, --gid GID het groeps-ID naar GID veranderen\n"
@@ -1449,6 +1437,9 @@ msgstr " -s, --sort elementen volgens UID sorteren\n"
msgid "" msgid ""
" -S, --silence-warnings silence controversial/paranoid warnings\n" " -S, --silence-warnings silence controversial/paranoid warnings\n"
msgstr "" msgstr ""
" -S, --silence-warnings geen controversiële/paranoïde\n"
" waarschuwingen weergeven\n"
"\n"
#, c-format #, c-format
msgid "%s: -s and -r are incompatible\n" msgid "%s: -s and -r are incompatible\n"
@@ -1565,10 +1556,9 @@ msgid ""
msgstr "" msgstr ""
" -u, --user GEBRUIKER lastlog-informatie over GEBRUIKER tonen\n" " -u, --user GEBRUIKER lastlog-informatie over GEBRUIKER tonen\n"
#, fuzzy, c-format #, c-format
#| msgid "Username Port Latest"
msgid "Username Port From%*sLatest\n" msgid "Username Port From%*sLatest\n"
msgstr "Gebruikersnaam Poort Laatste" msgstr "Gebruikersnaam Poort Van%*sLaatste\n"
msgid "Username Port Latest" msgid "Username Port Latest"
msgstr "Gebruikersnaam Poort Laatste" msgstr "Gebruikersnaam Poort Laatste"
@@ -1861,10 +1851,9 @@ msgstr "%s: regel %d: gebruiker '%s' bestaat niet in %s\n"
msgid "%s: line %d: can't update password\n" msgid "%s: line %d: can't update password\n"
msgstr "%s: regel %d: kan wachtwoord niet bijwerken\n" msgstr "%s: regel %d: kan wachtwoord niet bijwerken\n"
#, fuzzy, c-format #, c-format
#| msgid "%s: line %d: mkdir %s failed: %s\n"
msgid "%s: line %d: homedir must be an absolute path\n" msgid "%s: line %d: homedir must be an absolute path\n"
msgstr "%s: regel %d: mkdir %s is mislukt: %s\n" msgstr "%s: regel %d: thuismap moet een absoluut pad zijn\n"
#, c-format #, c-format
msgid "%s: line %d: mkdir %s failed: %s\n" msgid "%s: line %d: mkdir %s failed: %s\n"
@@ -2236,11 +2225,11 @@ msgstr ""
#, c-format #, c-format
msgid "Password field is empty, this is forbidden for all accounts.\n" msgid "Password field is empty, this is forbidden for all accounts.\n"
msgstr "" msgstr "Wachtwoordveld is leeg; dit is voor alle accounts verboden.\n"
#, c-format #, c-format
msgid "Password field is empty, this is forbidden for super-user.\n" msgid "Password field is empty, this is forbidden for super-user.\n"
msgstr "" msgstr "Wachtwoordveld is leeg; dit is verboden voor de systeembeheerder.\n"
#, c-format #, c-format
msgid "You are not authorized to su %s\n" msgid "You are not authorized to su %s\n"
@@ -2338,10 +2327,9 @@ msgstr "%s: groep '%s' is een NIS-groep.\n"
msgid "%s: too many groups specified (max %d).\n" msgid "%s: too many groups specified (max %d).\n"
msgstr "%s: te veel groepen gespecificeerd (max %d).\n" msgstr "%s: te veel groepen gespecificeerd (max %d).\n"
#, fuzzy, c-format #, c-format
#| msgid "%s: Out of memory. Cannot update %s.\n"
msgid "%s: Out of memory. Cannot find group '%s'.\n" msgid "%s: Out of memory. Cannot find group '%s'.\n"
msgstr "%s: onvoldoende geheugen. Kan %s niet bijwerken.\n" msgstr "%s: onvoldoende geheugen. Kan groep '%s' niet vinden.\n"
#, c-format #, c-format
msgid "" msgid ""
@@ -2517,44 +2505,35 @@ msgstr "%s: -Z kan niet gebruikt worden met --prefix\n"
msgid "%s: -Z requires SELinux enabled kernel\n" msgid "%s: -Z requires SELinux enabled kernel\n"
msgstr "%s: -Z vereist dat SELinux geactiveerd is in de kernel\n" msgstr "%s: -Z vereist dat SELinux geactiveerd is in de kernel\n"
#, fuzzy, c-format #, c-format
#| msgid "%s: invalid user name '%s'\n"
msgid "%s: invalid user name '%s': use --badname to ignore\n" msgid "%s: invalid user name '%s': use --badname to ignore\n"
msgstr "%s: ongeldige gebruikersnaam '%s'\n" msgstr "%s: ongeldige gebruikersnaam '%s': gebruik --badname om te negeren\n"
#, fuzzy, c-format #, c-format
#| msgid "%s: failed to reset the faillog entry of UID %lu: %s\n"
msgid "%s: failed to open the faillog file for UID %lu: %s\n" msgid "%s: failed to open the faillog file for UID %lu: %s\n"
msgstr "" msgstr "%s: openen van het faillog-bestand voor UID %lu is mislukt: %s\n"
"%s: opnieuw instellen van het faillog-item voor UID %lu is mislukt: %s\n"
#, c-format #, c-format
msgid "%s: failed to reset the faillog entry of UID %lu: %s\n" msgid "%s: failed to reset the faillog entry of UID %lu: %s\n"
msgstr "" msgstr ""
"%s: opnieuw instellen van het faillog-item voor UID %lu is mislukt: %s\n" "%s: opnieuw instellen van het faillog-item voor UID %lu is mislukt: %s\n"
#, fuzzy, c-format #, c-format
#| msgid "%s: failed to reset the faillog entry of UID %lu: %s\n"
msgid "%s: failed to close the faillog file for UID %lu: %s\n" msgid "%s: failed to close the faillog file for UID %lu: %s\n"
msgstr "" msgstr "%s: sluiten van het faillog-bestand voor UID %lu is mislukt: %s\n"
"%s: opnieuw instellen van het faillog-item voor UID %lu is mislukt: %s\n"
#, fuzzy, c-format #, c-format
#| msgid "%s: failed to reset the lastlog entry of UID %lu: %s\n"
msgid "%s: failed to open the lastlog file for UID %lu: %s\n" msgid "%s: failed to open the lastlog file for UID %lu: %s\n"
msgstr "" msgstr "%s: openen van het lastlog-bestand voor UID %lu is mislukt: %s\n"
"%s: opnieuw instellen van de lastlog-item voor UID %lu is mislukt: %s\n"
#, c-format #, c-format
msgid "%s: failed to reset the lastlog entry of UID %lu: %s\n" msgid "%s: failed to reset the lastlog entry of UID %lu: %s\n"
msgstr "" msgstr ""
"%s: opnieuw instellen van de lastlog-item voor UID %lu is mislukt: %s\n" "%s: opnieuw instellen van de lastlog-item voor UID %lu is mislukt: %s\n"
#, fuzzy, c-format #, c-format
#| msgid "%s: failed to reset the lastlog entry of UID %lu: %s\n"
msgid "%s: failed to close the lastlog file for UID %lu: %s\n" msgid "%s: failed to close the lastlog file for UID %lu: %s\n"
msgstr "" msgstr "%s: sluiten van het lastlog-bestand voor UID %lu is mislukt: %s\n"
"%s: opnieuw instellen van de lastlog-item voor UID %lu is mislukt: %s\n"
#, c-format #, c-format
msgid "%s: failed to reset the tallylog entry of user \"%s\"\n" msgid "%s: failed to reset the tallylog entry of user \"%s\"\n"
@@ -2598,8 +2577,7 @@ msgstr "%s: waarschuwing: chown uitvoeren op `%s' is mislukt: %m\n"
msgid "%s: warning: chmod on `%s' failed: %m\n" msgid "%s: warning: chmod on `%s' failed: %m\n"
msgstr "%s: waarschuwing: chmod uitvoeren op `%s' is mislukt: %m\n" msgstr "%s: waarschuwing: chmod uitvoeren op `%s' is mislukt: %m\n"
#, fuzzy, c-format #, c-format
#| msgid "%s: warning: chown on `%s' failed: %m\n"
msgid "%s: warning: chown on '%s' failed: %m\n" msgid "%s: warning: chown on '%s' failed: %m\n"
msgstr "%s: waarschuwing: chown uitvoeren op `%s' is mislukt: %m\n" msgstr "%s: waarschuwing: chown uitvoeren op `%s' is mislukt: %m\n"
@@ -2607,10 +2585,9 @@ msgstr "%s: waarschuwing: chown uitvoeren op `%s' is mislukt: %m\n"
msgid "%s: cannot reset SELinux file creation context\n" msgid "%s: cannot reset SELinux file creation context\n"
msgstr "%s: kan SELinux-context voor bestandscreatie niet opnieuw instellen\n" msgstr "%s: kan SELinux-context voor bestandscreatie niet opnieuw instellen\n"
#, fuzzy, c-format #, c-format
#| msgid "%s: cannot set SELinux context for home directory %s\n"
msgid "%s: cannot set SELinux context for mailbox file %s\n" msgid "%s: cannot set SELinux context for mailbox file %s\n"
msgstr "%s: kan SELinux-context voor persoonlijke map %s niet instellen\n" msgstr "%s: kan SELinux-context voor postvakbestand %s niet instellen\n"
msgid "Creating mailbox file" msgid "Creating mailbox file"
msgstr "Postvak-bestand wordt aangemaakt" msgstr "Postvak-bestand wordt aangemaakt"
@@ -2629,11 +2606,15 @@ msgid ""
"%s warning: %s's uid %d outside of the SYS_UID_MIN %d and SYS_UID_MAX %d " "%s warning: %s's uid %d outside of the SYS_UID_MIN %d and SYS_UID_MAX %d "
"range.\n" "range.\n"
msgstr "" msgstr ""
"%s waarschuwing: %s zijn/haar uid %d valt buiten het bereik SYS_UID_MIN %d "
"en SYS_UID_MAX %d.\n"
#, c-format #, c-format
msgid "" msgid ""
"%s warning: %s's uid %d outside of the UID_MIN %d and UID_MAX %d range.\n" "%s warning: %s's uid %d outside of the UID_MIN %d and UID_MAX %d range.\n"
msgstr "" msgstr ""
"%s waarschuwing: %s zijn/haar uid %d valt buiten het bereik UID_MIN %d en "
"UID_MAX %d.\n"
#, c-format #, c-format
msgid "%s: user '%s' already exists\n" msgid "%s: user '%s' already exists\n"
@@ -2684,18 +2665,16 @@ msgstr ""
"%s: waarschuwing: de koppeling van gebruikersnaam %s aan SELinux-gebruiker " "%s: waarschuwing: de koppeling van gebruikersnaam %s aan SELinux-gebruiker "
"%s is mislukt.\n" "%s is mislukt.\n"
#, fuzzy
#| msgid ""
#| " -f, --force force removal of files,\n"
#| " even if not owned by user\n"
msgid "" msgid ""
" -f, --force force some actions that would fail " " -f, --force force some actions that would fail "
"otherwise\n" "otherwise\n"
" e.g. removal of user still logged in\n" " e.g. removal of user still logged in\n"
" or files, even if not owned by the user\n" " or files, even if not owned by the user\n"
msgstr "" msgstr ""
" -f, --force geforceerde verwijdering van bestanden,\n" " -f, --force sommige acties afdwingen die anders zouden\n"
" ook als ze geen eigendom van gebruiker zijn\n" " mislukken, bijv. verwijderen van een nog\n"
" aangemelde gebruiker of van bestanden\n"
" zelfs als deze niet van de gebruker zijn\n"
msgid " -r, --remove remove home directory and mail spool\n" msgid " -r, --remove remove home directory and mail spool\n"
msgstr " -r, --remove thuismap en postvak verwijderen\n" msgstr " -r, --remove thuismap en postvak verwijderen\n"
@@ -2893,10 +2872,9 @@ msgstr ""
msgid "%s: user '%s' already exists in %s\n" msgid "%s: user '%s' already exists in %s\n"
msgstr "%s: gebruiker '%s' bestaat al in %s\n" msgstr "%s: gebruiker '%s' bestaat al in %s\n"
#, fuzzy, c-format #, c-format
#| msgid "%s: home directory \"%s\" must be mounted on BTRFS\n"
msgid "%s: homedir must be an absolute path\n" msgid "%s: homedir must be an absolute path\n"
msgstr "%s: persoonlijke map \"%s\" moet aangekoppeld zijn op BTRFS\n" msgstr "%s: persoonlijke map moet een absoluut pad zijn\n"
#, c-format #, c-format
msgid "%s: invalid subordinate uid range '%s'\n" msgid "%s: invalid subordinate uid range '%s'\n"
@@ -3083,6 +3061,3 @@ msgstr "%s: kan %s niet herstellen: %s (uw aanpassingen staan in %s)\n"
#, c-format #, c-format
msgid "%s: failed to find tcb directory for %s\n" msgid "%s: failed to find tcb directory for %s\n"
msgstr "%s: tcb-map van %s vinden is mislukt\n" msgstr "%s: tcb-map van %s vinden is mislukt\n"
#~ msgid "Username Port From Latest"
#~ msgstr "Gebruikersnaam Poort Vanaf Laatste"

3
src/.gitignore vendored
View File

@@ -34,6 +34,7 @@
/usermod /usermod
/vipw /vipw
/get_subid_owners /get_subid_owners
/list_subid_ranges /getsubids
/new_subid_range /new_subid_range
/free_subid_range /free_subid_range
/check_subid_range

View File

@@ -10,6 +10,7 @@ sgidperms = 2755
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-I${top_srcdir}/lib \ -I${top_srcdir}/lib \
-I$(top_srcdir)/libmisc \ -I$(top_srcdir)/libmisc \
-I$(top_srcdir) \
-DLOCALEDIR=\"$(datadir)/locale\" -DLOCALEDIR=\"$(datadir)/locale\"
# XXX why are login and su in /bin anyway (other than for # XXX why are login and su in /bin anyway (other than for
@@ -95,8 +96,8 @@ LIBCRYPT_NOPAM = $(LIBCRYPT)
endif endif
chage_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBECONF) chage_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBECONF)
newuidmap_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCAP) -ldl newuidmap_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCAP) $(LIBECONF) -ldl
newgidmap_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCAP) -ldl newgidmap_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCAP) $(LIBECONF) -ldl
chfn_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) $(LIBECONF) chfn_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) $(LIBECONF)
chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) $(LIBECONF) chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) $(LIBECONF)
chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) $(LIBECONF) chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) $(LIBECONF)
@@ -157,8 +158,8 @@ if FCAPS
setcap cap_setgid+ep $(DESTDIR)$(ubindir)/newgidmap setcap cap_setgid+ep $(DESTDIR)$(ubindir)/newgidmap
endif endif
noinst_PROGRAMS += list_subid_ranges \ bin_PROGRAMS += getsubids
get_subid_owners \ noinst_PROGRAMS += get_subid_owners \
new_subid_range \ new_subid_range \
free_subid_range \ free_subid_range \
check_subid_range check_subid_range
@@ -174,15 +175,16 @@ MISCLIBS = \
$(LIBCRYPT) \ $(LIBCRYPT) \
$(LIBTCB) $(LIBTCB)
list_subid_ranges_LDADD = \ getsubids_LDADD = \
$(top_builddir)/lib/libshadow.la \ $(top_builddir)/lib/libshadow.la \
$(top_builddir)/libmisc/libmisc.la \ $(top_builddir)/libmisc/libmisc.la \
$(top_builddir)/libsubid/libsubid.la \ $(top_builddir)/libsubid/libsubid.la \
$(MISCLIBS) -ldl $(MISCLIBS) -ldl
list_subid_ranges_CPPFLAGS = \ getsubids_CPPFLAGS = \
-I$(top_srcdir)/lib \ -I$(top_srcdir)/lib \
-I$(top_srcdir)/libmisc \ -I$(top_srcdir)/libmisc \
-I$(top_srcdir) \
-I$(top_srcdir)/libsubid -I$(top_srcdir)/libsubid
get_subid_owners_LDADD = \ get_subid_owners_LDADD = \
@@ -194,11 +196,13 @@ get_subid_owners_LDADD = \
get_subid_owners_CPPFLAGS = \ get_subid_owners_CPPFLAGS = \
-I$(top_srcdir)/lib \ -I$(top_srcdir)/lib \
-I$(top_srcdir)/libmisc \ -I$(top_srcdir)/libmisc \
-I$(top_srcdir) \
-I$(top_srcdir)/libsubid -I$(top_srcdir)/libsubid
new_subid_range_CPPFLAGS = \ new_subid_range_CPPFLAGS = \
-I$(top_srcdir)/lib \ -I$(top_srcdir)/lib \
-I$(top_srcdir)/libmisc \ -I$(top_srcdir)/libmisc \
-I$(top_srcdir) \
-I$(top_srcdir)/libsubid -I$(top_srcdir)/libsubid
new_subid_range_LDADD = \ new_subid_range_LDADD = \
@@ -210,6 +214,7 @@ new_subid_range_LDADD = \
free_subid_range_CPPFLAGS = \ free_subid_range_CPPFLAGS = \
-I$(top_srcdir)/lib \ -I$(top_srcdir)/lib \
-I$(top_srcdir)/libmisc \ -I$(top_srcdir)/libmisc \
-I$(top_srcdir) \
-I$(top_srcdir)/libsubid -I$(top_srcdir)/libsubid
free_subid_range_LDADD = \ free_subid_range_LDADD = \
@@ -220,6 +225,7 @@ free_subid_range_LDADD = \
check_subid_range_CPPFLAGS = \ check_subid_range_CPPFLAGS = \
-I$(top_srcdir)/lib \ -I$(top_srcdir)/lib \
-I$(top_srcdir) \
-I$(top_srcdir)/libmisc -I$(top_srcdir)/libmisc
check_subid_range_LDADD = \ check_subid_range_LDADD = \

View File

@@ -263,7 +263,7 @@ static void print_date (time_t date)
char buf[80]; char buf[80];
char format[80]; char format[80];
if( iflg ) { if (iflg) {
(void) snprintf (format, 80, "%%Y-%%m-%%d"); (void) snprintf (format, 80, "%%Y-%%m-%%d");
} }
else { else {

View File

@@ -515,7 +515,7 @@ int main (int argc, char **argv)
newpwd = cp; newpwd = cp;
#ifdef USE_PAM #ifdef USE_PAM
if (use_pam){ if (use_pam) {
if (do_pam_passwd_non_interactive ("chpasswd", name, newpwd) != 0) { if (do_pam_passwd_non_interactive ("chpasswd", name, newpwd) != 0) {
fprintf (stderr, fprintf (stderr,
_("%s: (line %d, user %s) password not changed\n"), _("%s: (line %d, user %s) password not changed\n"),

View File

@@ -39,9 +39,9 @@ int main(int argc, char *argv[])
range.start = atoi(argv[1]); range.start = atoi(argv[1]);
range.count = atoi(argv[2]); range.count = atoi(argv[2]);
if (group) if (group)
ok = ungrant_subgid_range(&range); ok = subid_ungrant_gid_range(&range);
else else
ok = ungrant_subuid_range(&range); ok = subid_ungrant_uid_range(&range);
if (!ok) { if (!ok) {
fprintf(stderr, "Failed freeing id range\n"); fprintf(stderr, "Failed freeing id range\n");

View File

@@ -25,11 +25,11 @@ int main(int argc, char *argv[])
usage(); usage();
} }
if (argc == 3 && strcmp(argv[1], "-g") == 0) if (argc == 3 && strcmp(argv[1], "-g") == 0)
n = get_subgid_owners(atoi(argv[2]), &uids); n = subid_get_gid_owners(atoi(argv[2]), &uids);
else if (argc == 2 && strcmp(argv[1], "-h") == 0) else if (argc == 2 && strcmp(argv[1], "-h") == 0)
usage(); usage();
else else
n = get_subuid_owners(atoi(argv[1]), &uids); n = subid_get_uid_owners(atoi(argv[1]), &uids);
if (n < 0) { if (n < 0) {
fprintf(stderr, "No owners found\n"); fprintf(stderr, "No owners found\n");
exit(1); exit(1);

View File

@@ -1,6 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "subid.h" #include "subid.h"
#include "stdlib.h"
#include "prototypes.h" #include "prototypes.h"
const char *Prog; const char *Prog;
@@ -27,11 +28,11 @@ int main(int argc, char *argv[])
owner = argv[1]; owner = argv[1];
if (argc == 3 && strcmp(argv[1], "-g") == 0) { if (argc == 3 && strcmp(argv[1], "-g") == 0) {
owner = argv[2]; owner = argv[2];
count = get_subgid_ranges(owner, &ranges); count = subid_get_gid_ranges(owner, &ranges);
} else if (argc == 2 && strcmp(argv[1], "-h") == 0) { } else if (argc == 2 && strcmp(argv[1], "-h") == 0) {
usage(); usage();
} else { } else {
count = get_subuid_ranges(owner, &ranges); count = subid_get_uid_ranges(owner, &ranges);
} }
if (!ranges) { if (!ranges) {
fprintf(stderr, "Error fetching ranges\n"); fprintf(stderr, "Error fetching ranges\n");

View File

@@ -1207,11 +1207,13 @@ int main (int argc, char **argv)
sssd_flush_cache (SSSD_DB_GROUP); sssd_flush_cache (SSSD_DB_GROUP);
#ifdef SHADOWGRP #ifdef SHADOWGRP
if (sgent.sg_adm) { if (is_shadowgrp) {
xfree(sgent.sg_adm); if (sgent.sg_adm) {
} xfree(sgent.sg_adm);
if (sgent.sg_mem) { }
xfree(sgent.sg_mem); if (sgent.sg_mem) {
xfree(sgent.sg_mem);
}
} }
#endif #endif
if (grent.gr_mem) { if (grent.gr_mem) {

View File

@@ -983,12 +983,12 @@ int main (int argc, char **argv)
if (strcmp (user_passwd, "") == 0) { if (strcmp (user_passwd, "") == 0) {
char *prevent_no_auth = getdef_str("PREVENT_NO_AUTH"); char *prevent_no_auth = getdef_str("PREVENT_NO_AUTH");
if(prevent_no_auth == NULL) { if (prevent_no_auth == NULL) {
prevent_no_auth = "superuser"; prevent_no_auth = "superuser";
} }
if(strcmp(prevent_no_auth, "yes") == 0) { if (strcmp(prevent_no_auth, "yes") == 0) {
failed = true; failed = true;
} else if( (pwd->pw_uid == 0) } else if ((pwd->pw_uid == 0)
&& (strcmp(prevent_no_auth, "superuser") == 0)) { && (strcmp(prevent_no_auth, "superuser") == 0)) {
failed = true; failed = true;
} }
@@ -1288,6 +1288,7 @@ int main (int argc, char **argv)
env++; env++;
} }
} }
(void) pam_end (pamh, PAM_SUCCESS | PAM_DATA_SILENT);
#endif #endif
(void) setlocale (LC_ALL, ""); (void) setlocale (LC_ALL, "");

View File

@@ -45,9 +45,9 @@ int main(int argc, char *argv[])
if (argc > 1) if (argc > 1)
range.count = atoi(argv[1]); range.count = atoi(argv[1]);
if (group) if (group)
ok = grant_subgid_range(&range, !makenew); ok = subid_grant_gid_range(&range, !makenew);
else else
ok = grant_subuid_range(&range, !makenew); ok = subid_grant_uid_range(&range, !makenew);
if (!ok) { if (!ok) {
fprintf(stderr, "Failed creating new id range\n"); fprintf(stderr, "Failed creating new id range\n");

View File

@@ -163,8 +163,8 @@ static void check_perms (const struct group *grp,
spwd = xgetspnam (pwd->pw_name); spwd = xgetspnam (pwd->pw_name);
if (NULL != spwd) { if (NULL != spwd) {
pwd->pw_passwd = xstrdup (spwd->sp_pwdp); pwd->pw_passwd = xstrdup (spwd->sp_pwdp);
spw_free (spwd);
} }
spw_free (spwd);
if ((pwd->pw_passwd[0] == '\0') && (grp->gr_passwd[0] != '\0')) { if ((pwd->pw_passwd[0] == '\0') && (grp->gr_passwd[0] != '\0')) {
needspasswd = true; needspasswd = true;

View File

@@ -490,9 +490,12 @@ static void print_status (const struct passwd *pw)
((long long)sp->sp_max * SCALE) / DAY, ((long long)sp->sp_max * SCALE) / DAY,
((long long)sp->sp_warn * SCALE) / DAY, ((long long)sp->sp_warn * SCALE) / DAY,
((long long)sp->sp_inact * SCALE) / DAY); ((long long)sp->sp_inact * SCALE) / DAY);
} else { } else if (NULL != pw->pw_passwd) {
(void) printf ("%s %s\n", (void) printf ("%s %s\n",
pw->pw_name, pw_status (pw->pw_passwd)); pw->pw_name, pw_status (pw->pw_passwd));
} else {
(void) fprintf(stderr, _("%s: malformed password data obtained for user %s\n"),
Prog, pw->pw_name);
} }
} }
@@ -1106,7 +1109,7 @@ int main (int argc, char **argv)
(void) printf (_("%s: password changed.\n"), Prog); (void) printf (_("%s: password changed.\n"), Prog);
#endif /* USE_PAM */ #endif /* USE_PAM */
} else { } else {
(void) printf (_("%s: password expiry information changed.\n"), Prog); (void) printf (_("%s: password changed.\n"), Prog);
} }
} }

View File

@@ -857,6 +857,7 @@ int main (int argc, char **argv)
* Get my name so that I can use it to report errors. * Get my name so that I can use it to report errors.
*/ */
Prog = Basename (argv[0]); Prog = Basename (argv[0]);
shadow_logfd = stderr;
(void) setlocale (LC_ALL, ""); (void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR); (void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -295,6 +295,21 @@ static void prepare_pam_close_session (void)
sigset_t ourset; sigset_t ourset;
int status; int status;
int ret; int ret;
struct sigaction action;
/* reset SIGCHLD handling to default */
action.sa_handler = SIG_DFL;
sigemptyset (&action.sa_mask);
action.sa_flags = 0;
if (0 == caught && sigaction (SIGCHLD, &action, NULL) != 0) {
fprintf (stderr,
_("%s: signal masking malfunction\n"),
Prog);
SYSLOG ((LOG_WARN, "Will not execute %s", shellstr));
closelog ();
exit (1);
/* Only the child returns. See above. */
}
pid_child = fork (); pid_child = fork ();
if (pid_child == 0) { /* child shell */ if (pid_child == 0) { /* child shell */
@@ -318,11 +333,7 @@ static void prepare_pam_close_session (void)
caught = SIGTERM; caught = SIGTERM;
} }
if (0 == caught) { if (0 == caught) {
struct sigaction action;
action.sa_handler = catch_signals; action.sa_handler = catch_signals;
sigemptyset (&action.sa_mask);
action.sa_flags = 0;
sigemptyset (&ourset); sigemptyset (&ourset);
if ( (sigaddset (&ourset, SIGTERM) != 0) if ( (sigaddset (&ourset, SIGTERM) != 0)
@@ -397,22 +408,28 @@ static void prepare_pam_close_session (void)
snprintf (kill_msg, sizeof kill_msg, _(" ...killed.\n")); snprintf (kill_msg, sizeof kill_msg, _(" ...killed.\n"));
snprintf (wait_msg, sizeof wait_msg, _(" ...waiting for child to terminate.\n")); snprintf (wait_msg, sizeof wait_msg, _(" ...waiting for child to terminate.\n"));
/* Any signals other than SIGCHLD and SIGALRM will no longer have any effect,
* so it's time to block all of them. */
sigfillset (&ourset);
if (sigprocmask (SIG_BLOCK, &ourset, NULL) != 0) {
fprintf (stderr, _("%s: signal masking malfunction\n"), Prog);
kill_child (0);
/* Never reach (_exit called). */
}
/* Send SIGKILL to the child if it doesn't
* exit within 2 seconds (after SIGTERM) */
(void) signal (SIGALRM, kill_child); (void) signal (SIGALRM, kill_child);
(void) signal (SIGCHLD, catch_signals); (void) signal (SIGCHLD, catch_signals);
(void) alarm (2); (void) alarm (2);
sigemptyset (&ourset); (void) sigdelset (&ourset, SIGALRM);
if ((sigaddset (&ourset, SIGALRM) != 0) (void) sigdelset (&ourset, SIGCHLD);
|| (sigprocmask (SIG_BLOCK, &ourset, NULL) != 0)) {
fprintf (stderr, _("%s: signal masking malfunction\n"), Prog); while (0 == waitpid (pid_child, &status, WNOHANG)) {
kill_child (0); sigsuspend (&ourset);
} else {
while (0 == waitpid (pid_child, &status, WNOHANG)) {
sigsuspend (&ourset);
}
pid_child = 0;
(void) sigprocmask (SIG_UNBLOCK, &ourset, NULL);
} }
pid_child = 0;
(void) fputs (_(" ...terminated.\n"), stderr); (void) fputs (_(" ...terminated.\n"), stderr);
} }
@@ -508,13 +525,13 @@ static void check_perms_nopam (const struct passwd *pw)
if (strcmp (pw->pw_passwd, "") == 0) { if (strcmp (pw->pw_passwd, "") == 0) {
char *prevent_no_auth = getdef_str("PREVENT_NO_AUTH"); char *prevent_no_auth = getdef_str("PREVENT_NO_AUTH");
if(prevent_no_auth == NULL) { if (prevent_no_auth == NULL) {
prevent_no_auth = "superuser"; prevent_no_auth = "superuser";
} }
if(strcmp(prevent_no_auth, "yes") == 0) { if (strcmp(prevent_no_auth, "yes") == 0) {
fprintf(stderr, _("Password field is empty, this is forbidden for all accounts.\n")); fprintf(stderr, _("Password field is empty, this is forbidden for all accounts.\n"));
exit(1); exit(1);
} else if( (pw->pw_uid == 0) } else if ((pw->pw_uid == 0)
&& (strcmp(prevent_no_auth, "superuser") == 0)) { && (strcmp(prevent_no_auth, "superuser") == 0)) {
fprintf(stderr, _("Password field is empty, this is forbidden for super-user.\n")); fprintf(stderr, _("Password field is empty, this is forbidden for super-user.\n"));
exit(1); exit(1);
@@ -1156,12 +1173,9 @@ int main (int argc, char **argv)
} }
} }
/* #ifdef USE_PAM
* PAM_DATA_SILENT is not supported by some modules, and (void) pam_end (pamh, PAM_SUCCESS | PAM_DATA_SILENT);
* there is no strong need to clean up the process space's #endif
* memory since we will either call exec or exit.
pam_end (pamh, PAM_SUCCESS | PAM_DATA_SILENT);
*/
endpwent (); endpwent ();
endspent (); endspent ();

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