Compare commits

...

146 Commits

Author SHA1 Message Date
Serge Hallyn eccf1c569c configure.ac and changelog: release 4.11.1
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2022-01-02 21:08:26 -06:00
Sam James 7ad96661ef build: include lib/shadowlog_internal.h in dist tarballs
Fixes: #485
Signed-off-by: Sam James <sam@gentoo.org>
2022-01-02 21:06:36 -06:00
Serge Hallyn 8736e4a37e configure.ac and changelog: release 4.11
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2022-01-02 21:06:36 -06:00
Serge Hallyn e8a2cfa7dc Merge pull request #451 from hallyn/2021-12-05/license 2022-01-02 18:38:42 -06:00
Serge Hallyn f06a1d8b00 Merge pull request #483 from edneville/317_nofollow
Adding nofollow to opens
2022-01-02 10:38:45 -06:00
ed neville b4472167c2 Adding nofollow to opens 2022-01-01 21:13:41 +00:00
Serge Hallyn d22f1c18cc Merge pull request #460 from edneville/404_userdel_kill
script to kill subjects processes
2021-12-30 17:45:20 -06:00
ed neville dcca8653a5 script to kill subjects processes from userdel
Closes #404
Closes #317

Signed-off-by: ed neville <ed@s5h.net>
2021-12-29 20:43:38 +00:00
Serge Hallyn 5575995541 Merge pull request #482 from xry111/useradd_segfault_fix
fix segfault running useradd -D
2021-12-29 12:03:34 -06:00
Xi Ruoyao 6f266a30ff fix segfault running useradd -D 2021-12-29 17:06:39 +08:00
Serge Hallyn e668c7e725 Merge pull request #479 from alejandro-colomar/getgroups
Remove HAVE_GETGROUPS ifdefs
2021-12-27 19:12:24 -06:00
Serge Hallyn 9e5a852ee0 Merge pull request #480 from alejandro-colomar/memcpy
Remove HAVE_MEMCPY and HAVE_MEMSET ifdefs
2021-12-27 19:10:48 -06:00
Serge Hallyn 80b52a597f Merge pull request #477 from alejandro-colomar/strftime
Remove HAVE_STRFTIME ifdefs
2021-12-27 19:10:06 -06:00
Serge Hallyn d355cb2b16 Merge pull request #478 from hallyn/alpine
add alpine edge CI build
2021-12-27 17:10:21 -06:00
Serge Hallyn 4ce27b5e60 nss test_range: make sure /etc/nsswitch.conf and /etc/subuid exists
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-27 15:47:29 -06:00
Serge Hallyn 62449968fa add alpine edge CI build
Mainly to get a musl build in there.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-27 15:47:26 -06:00
Alejandro Colomar b7e12ec04e Remove HAVE_MEMSET ifdefs
memset(3) has been in standard C since C89.  It is also in
POSIX.1-2001, in SVr4, and in 4.3BSD (see memset(3) and memset(3p)).
We can assume that this function is always available.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-12-27 21:52:00 +01:00
Alejandro Colomar 047bfc47c6 Remove HAVE_MEMCPY ifdefs
memcpy(3) has been in standard C since C89.  It is also in
POSIX.1-2001, in SVr4, and in 4.3BSD (see memcpy(3) and memcpy(3p)).
We can assume that this function is always available.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-12-27 21:38:47 +01:00
Alejandro Colomar 913e16ce20 Remove HAVE_GETGROUPS ifdefs
getgroups(2) has been in POSIX since POSIX.1-2001.  It is also in
in SVr4 and in 4.3BSD (see getgroups(2) and getgroups(3p)).
We can assume that this function is always available.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-12-27 21:17:50 +01:00
Alejandro Colomar 3e602b58a2 Remove HAVE_STRFTIME ifdefs
strftime(3) has been in standard C since C89.  It is also in
POSIX.1-2001, and in SVr4 (see strftime(3) and strftime(3p)).
We can assume that this function is always available.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-12-27 20:50:13 +01:00
Serge Hallyn 6b341b1e90 Merge pull request #476 from hallyn/2021-12-27/impish
add ubuntu impish build
2021-12-27 13:26:11 -06:00
Serge Hallyn e751bc67eb add ubuntu impish build
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-27 13:21:24 -06:00
Serge Hallyn 92bd73c657 Merge pull request #474 from atsampson/subidprogname
Default value for progname/logfd, and set progname in subid_init too
2021-12-27 12:46:34 -06:00
Adam Sampson 2b0bdef6f9 lib: provide default values for shadow_progname/shadow_logfd 2021-12-27 16:28:23 +00:00
Adam Sampson 9750fd6819 libsubid: use log_set_progname in subid_init
The static Prog variable here is no longer used, so remove it.
2021-12-27 16:28:23 +00:00
Serge Hallyn e1b1d187f4 Merge pull request #467 from alejandro-colomar/date_to_str
Have a single definition of date_to_str()
2021-12-27 09:53:00 -06:00
Serge Hallyn 7052a0a2dd Merge pull request #473 from hallyn/2021-12-26/srht
Test sr.ht CI integration
2021-12-27 09:40:19 -06:00
Serge Hallyn 962c820fba fix newuidmap testcase
sleep 2s before running newxidmap - it seems we were sometimes
racing, causing newxidmap to fail.

Make sure to remove /tmp/test-xidmap, for some reason they
were sometimes still there, causing test to fail.

Fix some irregular tabbing.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-27 09:27:44 -06:00
Serge Hallyn 363eab25f0 libsubid_zzz (test): fix pointer test
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-27 09:26:55 -06:00
Serge Hallyn 4758641b1d run_some: exit error if there were failed tests
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-27 09:26:32 -06:00
Serge Hallyn f5a7404c7a remove broken github actions
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-27 09:26:32 -06:00
Serge Hallyn 618bafc238 add a .build.yml to build on builds.sr.ht
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-27 09:26:27 -06:00
Alejandro Colomar 355ad6a9e0 Have a single definition of date_to_str()
PARAMETERS:

According to the C2x charter, I reordered the parameters 'size'
and 'buf' from previously existing date_to_str() definitions.

C2x charter:
> 15. Application Programming Interfaces (APIs) should be
> self-documenting when possible.  In particular, the order of
> parameters in function declarations should be arranged such that
> the size of an array appears before the array.  The purpose is to
> allow Variable-Length Array (VLA) notation to be used.  This not
> only makes the code's purpose clearer to human readers, but also
> makes static analysis easier.  Any new APIs added to the Standard
> should take this into consideration.

I used 'long' for the date parameter, as some uses of the function
need to pass a negative value meaning "never".

FUNCTION BODY:

I didn't check '#ifdef HAVE_STRFTIME', which old definitions did,
since strftime(3) is guaranteed by the C89 standard, and all of
the conversion specifiers that we use are also specified by that
standard, so we don't need any extensions at all.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-12-26 18:55:39 +01:00
Serge Hallyn d59a090933 Merge pull request #472 from atsampson/progname
lib: rename Prog to shadow_progname, with only one definition
2021-12-26 10:02:04 -06:00
Adam Sampson 0e6fe5e728 lib: rename Prog to shadow_progname, with only one definition
The build was failing with duplicate symbol errors with -fno-common.
This is the default in GCC 10 and later, and explicitly enabled in some
distributions to catch problems like this. There were two causes:

- Prog and shadow_logfd were defined in a header file that was included
  in multiple other files. Fix this by defining them once in
  shadowlog.c, and having extern declarations in the header.

- Most of the tools (except id/nologin) also define a Prog variable,
  which is not intended to alias the one in the library. Fix
  this by renaming Prog in the library to shadow_progname, which also
  matches the new accessor functions for it.
2021-12-25 22:41:58 +00:00
Serge Hallyn f93cf255d4 Update licensing info
Closes #238

Update all files to list SPDX license shortname.  Most files are
BSD 3 clause license.

The exceptions are:

serge@sl ~/src/shadow$ git grep SPDX-License | grep -v BSD-3-Clause
contrib/atudel:# SPDX-License-Identifier: BSD-4-Clause
lib/tcbfuncs.c: * SPDX-License-Identifier: 0BSD
libmisc/salt.c: * SPDX-License-Identifier: Unlicense
src/login_nopam.c: * SPDX-License-Identifier: Unlicense
src/nologin.c: * SPDX-License-Identifier: BSD-2-Clause
src/vipw.c: * SPDX-License-Identifier: GPL-2.0-or-later

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-23 19:36:50 -06:00
Serge Hallyn 6761cf2d7e Merge pull request #471 from hallyn/2021-12-23/extern
Make shadow_logfd and Prog not extern
2021-12-23 15:19:16 -06:00
Serge Hallyn 79157cbad8 Make shadow_logfd and Prog not extern
Closes #444
Closes #465

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-12-23 15:18:07 -06:00
Serge Hallyn b8c67c320c Merge pull request #463 from thesamesam/master
libsubid: fix defining SONAME version
2021-12-19 19:46:55 -06:00
Sam James e0d66b4be1 libsubid: fix defining SONAME version
We were overriding this when --enable-shared was passed. We can actually
just dump the conditional logic as libtool will do the right thing for
us here anyway.

Without this patch, libsubid is installed as .0.

Signed-off-by: Sam James <sam@gentoo.org>
2021-12-20 01:37:42 +00:00
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
https://github.com/shadow-maint/shadow/commit/e65cc6aebcb4132fa413f00a905216a5b35b3d57

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
681 changed files with 3251 additions and 10351 deletions
+32
View File
@@ -0,0 +1,32 @@
image: alpine/latest
# apk add --update alpine-sdk
packages:
- cmd:setcap
- autoconf
- automake
- byacc
- expect
- gettext
- gettext-dev
- gettext-lang
- libcap-dev
- libtool
- linux-pam-dev
- sed
sources:
- https://github.com/shadow-maint/shadow
tasks:
- build: |
cd shadow
./autogen.sh --without-selinux --disable-man --disable-nls
grep ENABLE_ config.status
- tasks: |
cd shadow
cat /proc/self/uid_map
cat /proc/self/status
make
make DESTDIR=/tmp/shadow-inst install
sudo make install
#TODO - fix up the tests. Let's merge what's here now as it
#at least tests build.
#(cd tests; sudo ./run_some || { cat testsuite.log; false; })
+26
View File
@@ -0,0 +1,26 @@
image: ubuntu/focal
packages:
- automake
- autopoint
- xsltproc
- libselinux1-dev
- gettext
- expect
- byacc
- libtool
sources:
- https://github.com/shadow-maint/shadow
tasks:
- build: |
cd shadow
./autogen.sh --without-selinux --disable-man
grep ENABLE_ config.status
- tasks: |
cd shadow
cat /proc/self/uid_map
cat /proc/self/status
systemd-detect-virt
make
make DESTDIR=/tmp/shadow-inst install
sudo make install
(cd tests; sudo ./run_some || { cat testsuite.log; false; })
+26
View File
@@ -0,0 +1,26 @@
image: ubuntu/21.10
packages:
- automake
- autopoint
- xsltproc
- libselinux1-dev
- gettext
- expect
- byacc
- libtool
sources:
- https://github.com/shadow-maint/shadow
tasks:
- build: |
cd shadow
./autogen.sh --without-selinux --enable-man
grep ENABLE_ config.status
- tasks: |
cat /proc/self/uid_map
cat /proc/self/status
systemd-detect-virt
cd shadow
make
make DESTDIR=/tmp/shadow-inst install
sudo make install
(cd tests; sudo ./run_some || { cat testsuite.log; false; })
+1
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
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>
+33 -110
View File
@@ -1,118 +1,41 @@
NOTE: SPDX-License-Identifier: BSD-3-Clause
This license has been obsoleted by the change to the BSD-style copyright.
You may continue to use this license if you wish, but you are under no
obligation to do so.
(* All files under this project either
This document is freely plagiarised from the 'Artistic Licence',
distributed as part of the Perl v4.0 kit by Larry Wall, which is
available from most major archive sites. I stole it from CrackLib.
$Id$ 1. fall under the BSD 3 clause license (by default).
*)
This documents purpose is to state the conditions under which this 2. carry an SPDX header declaring what license applies.
Package (See definition below) viz: "Shadow", the Shadow Password Suite
which is held by Julianne Frances Haugh, may be copied, such that the
copyright holder maintains some semblance of artistic control over the
development of the package, while giving the users of the package the
right to use and distribute the Package in a more-or-less customary
fashion, plus the right to make reasonable modifications.
So there. or
*************************************************************************** 3. list a full custom license
Definitions: This software is originally
* Copyright (c) 1989 - 1994, Julianne Frances Haugh
A "Package" refers to the collection of files distributed by the * All rights reserved.
Copyright Holder, and derivatives of that collection of files created *
through textual modification, or segments thereof. * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
"Standard Version" refers to such a Package if it has not been modified, * are met:
or has been modified in accordance with the wishes of the Copyright * 1. Redistributions of source code must retain the above copyright
Holder. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
"Copyright Holder" is whoever is named in the copyright or copyrights * notice, this list of conditions and the following disclaimer in the
for the package. * documentation and/or other materials provided with the distribution.
* 3. The name of the copyright holders or contributors may not be used to
"You" is you, if you're thinking about copying or distributing this * endorse or promote products derived from this software without
Package. * specific prior written permission.
*
"Reasonable copying fee" is whatever you can justify on the basis of * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
media cost, duplication charges, time of people involved, and so on. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
(You will not be required to justify it to the Copyright Holder, but * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
only to the computing community at large as a market that must bear the * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
fee.) * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
"Freely Available" means that no fee is charged for the item itself, * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
though there may be fees involved in handling the item. It also means * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
that recipients of the item may redistribute it under the same * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
conditions they received it. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated
disclaimers.
2. You may apply bug fixes, portability fixes and other modifications
derived from the Public Domain or from the Copyright Holder. A Package
modified in such a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way,
provided that you insert a prominent notice in each changed file stating
how and when AND WHY you changed that file, and provided that you do at
least ONE of the following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or an
equivalent medium, or placing the modifications on a major archive site
such as uunet.uu.net, or by allowing the Copyright Holder to include
your modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict with
standard executables, which must also be provided, and provide separate
documentation for each non-standard executable that clearly documents
how it differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or
executable form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where
to get the Standard Version.
b) accompany the distribution with the machine-readable source of the
Package with your modifications.
c) accompany any non-standard executables with their corresponding
Standard Version executables, giving the non-standard executables
non-standard names, and clearly documenting the differences in manual
pages (or equivalent), together with instructions on where to get the
Standard Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
Package. You may charge any fee you choose for support of this Package.
YOU MAY NOT CHARGE A FEE FOR THIS PACKAGE ITSELF. However, you may
distribute this Package in aggregate with other (possibly commercial)
programs as part of a larger (possibly commercial) software distribution
provided that YOU DO NOT ADVERTISE this package as a product of your
own.
6. The name of the Copyright Holder may not be used to endorse or
promote products derived from this software without specific prior
written permission.
7. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
+60
View File
@@ -1,3 +1,63 @@
2022-01-02 Serge Hallyn <serge@hallyn.com>
* build: include lib/shadowlog_internal.h in dist tarballs (Sam James)
2022-01-02 Serge Hallyn <serge@hallyn.com>
* Handle possible TOCTTOU issues in usermod/userdel (edneville)
* (CVE-2013-4235)
* Use O_NOFOLLOW when copying file
* Kill all user tasks in userdel
* Fix useradd -D segfault (Xi Ruoyao)
* Clean up obsolete libc feature-check ifdefs (Alejandro Colomar)
* Fix -fno-common build breaks due to duplicate Prog declarations
(Adam Sampson)
* Have single date_to_str definition (Alejandro Colomar)
* Fix libsubid SONAME version (Sam James)
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
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)
Symlink
+1
View File
@@ -0,0 +1 @@
README.md
+36
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
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)
+6 -6
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.11.1], [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])
@@ -51,9 +51,9 @@ AC_CHECK_HEADERS(crypt.h errno.h fcntl.h limits.h unistd.h sys/time.h utmp.h \
dnl shadow now uses the libc's shadow implementation dnl shadow now uses the libc's shadow implementation
AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])]) AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
AC_CHECK_FUNCS(arc4random_buf l64a fchmod fchown fsync futimes getgroups \ AC_CHECK_FUNCS(arc4random_buf l64a fchmod fchown fsync futimes \
gethostname getentropy getrandom getspnam gettimeofday getusershell \ gethostname getentropy getrandom getspnam gettimeofday getusershell \
getutent initgroups lchown lckpwdf lstat lutimes memcpy memset \ getutent initgroups lchown lckpwdf lstat lutimes \
setgroups sigaction strchr updwtmp updwtmpx innetgr getpwnam_r \ setgroups sigaction strchr updwtmp updwtmpx innetgr getpwnam_r \
getpwuid_r getgrnam_r getgrgid_r getspnam_r getaddrinfo ruserok \ getpwuid_r getgrnam_r getgrgid_r getspnam_r getaddrinfo ruserok \
dlopen) dlopen)
@@ -115,7 +115,6 @@ dnl Checks for library functions.
AC_TYPE_GETGROUPS AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_FUNC_UTIME_NULL AC_FUNC_UTIME_NULL
AC_FUNC_STRFTIME
AC_REPLACE_FUNCS(mkdir putgrent putpwent putspent rename rmdir) AC_REPLACE_FUNCS(mkdir putgrent putpwent putspent rename rmdir)
AC_REPLACE_FUNCS(sgetgrent sgetpwent sgetspent) AC_REPLACE_FUNCS(sgetgrent sgetpwent sgetspent)
AC_REPLACE_FUNCS(snprintf strcasecmp strdup strerror strstr) AC_REPLACE_FUNCS(snprintf strcasecmp strdup strerror strstr)
@@ -343,7 +342,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 +738,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
+2 -29
View File
@@ -1,34 +1,7 @@
#!/usr/bin/perl #!/usr/bin/perl
# #
# Copyright (c) 1996 Brian R. Gaeke # SPDX-FileCopyrightText: 1996 Brian R. Gaeke
# All rights reserved. # SPDX-License-Identifier: BSD-4-Clause
#
# 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. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Brian R. Gaeke.
# 4. The name of the author, Brian R. Gaeke, may not be used to endorse
# or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY BRIAN R. GAEKE ``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 BRIAN R. GAEKE 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.
# #
# Additionally: # Additionally:
# #
+9 -90
View File
@@ -76,36 +76,9 @@ else
$echo 'x -' extracting 'Makefile' '(text)' $echo 'x -' extracting 'Makefile' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'Makefile' && sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
/* /*
# Copyright 2000, International Business Machines, Inc. # SPDX-FileCopyrightText: 2000, International Business Machines, Inc.
# All rights reserved. # SPDX-FileCopyrightText: 2000, George Kraft IV, gk4@us.ibm.com
# # SPDX-License-Identifier: BSD-3-Clause
# original author: George Kraft IV, gk4@us.ibm.com
#
# 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. Neither the name of International Business Machines, Inc., nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY INTERNATIONAL BUSINESS MACHINES, INC. 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
# INTERNATIONAL BUSINESS MACHINES, INC. 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.
# #
X X
all: groupmems all: groupmems
@@ -143,36 +116,9 @@ else
$echo 'x -' extracting 'groupmems.c' '(text)' $echo 'x -' extracting 'groupmems.c' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'groupmems.c' && sed 's/^X//' << 'SHAR_EOF' > 'groupmems.c' &&
/* /*
X * Copyright 2000, International Business Machines, Inc. X * SPDX-FileCopyrightText: 2000, International Business Machines, Inc.
X * All rights reserved. X * SPDX-FileCopyrightText: 2000, George Kraft IV, gk4@us.ibm.com
X * X * SPDX-License-Identifier: BSD-3-Clause
X * original author: George Kraft IV, gk4@us.ibm.com
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X *
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. Neither the name of International Business Machines, Inc., nor the
X * names of its contributors may be used to endorse or promote products
X * derived from this software without specific prior written permission.
X *
X * THIS SOFTWARE IS PROVIDED BY INTERNATIONAL BUSINESS MACHINES, INC. AND
X * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
X * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
X * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
X * INTERNATIONAL BUSINESS MACHINES, INC. OR CONTRIBUTORS BE LIABLE
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */ X */
/* /*
** **
@@ -436,36 +382,9 @@ else
$echo 'x -' extracting 'groupmems.8' '(text)' $echo 'x -' extracting 'groupmems.8' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'groupmems.8' && sed 's/^X//' << 'SHAR_EOF' > 'groupmems.8' &&
X.\" X.\"
X.\" Copyright 2000, International Business Machines, Inc. X.\" SPDX-FileCopyrightText: 2000, International Business Machines, Inc.
X.\" All rights reserved. X.\" SPDX-FileCopyrightText: 2000, George Kraft IV, gk4@us.ibm.com
X.\" X.\" SPDX-License-Identifier: BSD-3-Clause
X.\" original author: George Kraft IV, gk4@us.ibm.com
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\"
X.\" 1. Redistributions of source code must retain the above copyright
X.\" notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\" notice, this list of conditions and the following disclaimer in the
X.\" documentation and/or other materials provided with the distribution.
X.\" 3. Neither the name of International Business Machines, Inc., nor the
X.\" names of its contributors may be used to endorse or promote products
X.\" derived from this software without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY INTERNATIONAL BUSINESS MACHINES, INC. AND
X.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
X.\" BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
X.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
X.\" INTERNATIONAL BUSINESS MACHINES, INC. OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\" X.\"
X.\" $Id$ X.\" $Id$
X.\" X.\"
+2 -2
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
-1
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
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
-1
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)
+1 -1
View File
@@ -1,4 +1,4 @@
<HEAD> <head>
<title>shadow - Welcome</title> <title>shadow - Welcome</title>
</head> </head>
<body> <body>
-1
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
# #
+28
View File
@@ -0,0 +1,28 @@
#!/bin/sh
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Check user exists, and if so, send sigkill to processes that the user owns
RUNNING=`ps -eo user | grep -Fx "$SUBJECT" | wc -l`
# if the user does not exist, RUNNING will be 0
if [ "${RUNNING}x" = "0x" ]; then
exit 0
fi
ls -1 /proc | while IFS= read -r PROC; do
echo "$PROC" | grep -E '^[0-9]+$' >/dev/null
if [ $? -ne 0 ]; then
continue
fi
if [ -d "/proc/${PROC}" ]; then
USR=`stat -c "%U" /proc/${PROC}`
if [ "${USR}" = "${SUBJECT}" ]; then
echo "Killing ${SUBJECT} owned ${PROC}"
kill -9 "${PROC}"
fi
fi
done
+5
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 \
@@ -34,6 +36,9 @@ libshadow_la_SOURCES = \
nss.c \ nss.c \
nscd.c \ nscd.c \
nscd.h \ nscd.h \
shadowlog.c \
shadowlog.h \
shadowlog_internal.h \
sssd.c \ sssd.c \
sssd.h \ sssd.h \
pam_defs.h \ pam_defs.h \
+23 -45
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2001, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2001, Marek Michałkiewicz
* Copyright (c) 2001 - 2006, Tomasz Kłoczko * SPDX-FileCopyrightText: 2001 - 2006, Tomasz Kłoczko
* Copyright (c) 2007 - 2011, Nicolas François * SPDX-FileCopyrightText: 2007 - 2011, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -51,6 +28,7 @@
#endif /* WITH_TCB */ #endif /* WITH_TCB */
#include "prototypes.h" #include "prototypes.h"
#include "commonio.h" #include "commonio.h"
#include "shadowlog_internal.h"
/* local function prototypes */ /* local function prototypes */
static int lrename (const char *, const char *); static int lrename (const char *, const char *);
@@ -146,7 +124,7 @@ static int do_lock_file (const char *file, const char *lock, bool log)
if (log) { if (log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: %s: %s\n", "%s: %s: %s\n",
Prog, file, strerror (errno)); shadow_progname, file, strerror (errno));
} }
return 0; return 0;
} }
@@ -158,7 +136,7 @@ static int do_lock_file (const char *file, const char *lock, bool log)
if (log) { if (log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: %s file write error: %s\n", "%s: %s file write error: %s\n",
Prog, file, strerror (errno)); shadow_progname, file, strerror (errno));
} }
(void) close (fd); (void) close (fd);
unlink (file); unlink (file);
@@ -168,7 +146,7 @@ static int do_lock_file (const char *file, const char *lock, bool log)
if (log) { if (log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: %s file sync error: %s\n", "%s: %s file sync error: %s\n",
Prog, file, strerror (errno)); shadow_progname, file, strerror (errno));
} }
(void) close (fd); (void) close (fd);
unlink (file); unlink (file);
@@ -181,7 +159,7 @@ static int do_lock_file (const char *file, const char *lock, bool log)
if ((0==retval) && log) { if ((0==retval) && log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: %s: lock file already used\n", "%s: %s: lock file already used\n",
Prog, file); shadow_progname, file);
} }
unlink (file); unlink (file);
return retval; return retval;
@@ -192,7 +170,7 @@ static int do_lock_file (const char *file, const char *lock, bool log)
if (log) { if (log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: %s: %s\n", "%s: %s: %s\n",
Prog, lock, strerror (errno)); shadow_progname, lock, strerror (errno));
} }
unlink (file); unlink (file);
errno = EINVAL; errno = EINVAL;
@@ -204,7 +182,7 @@ static int do_lock_file (const char *file, const char *lock, bool log)
if (log) { if (log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: existing lock file %s without a PID\n", "%s: existing lock file %s without a PID\n",
Prog, lock); shadow_progname, lock);
} }
unlink (file); unlink (file);
errno = EINVAL; errno = EINVAL;
@@ -215,7 +193,7 @@ static int do_lock_file (const char *file, const char *lock, bool log)
if (log) { if (log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: existing lock file %s with an invalid PID '%s'\n", "%s: existing lock file %s with an invalid PID '%s'\n",
Prog, lock, buf); shadow_progname, lock, buf);
} }
unlink (file); unlink (file);
errno = EINVAL; errno = EINVAL;
@@ -225,7 +203,7 @@ static int do_lock_file (const char *file, const char *lock, bool log)
if (log) { if (log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: lock %s already used by PID %lu\n", "%s: lock %s already used by PID %lu\n",
Prog, lock, (unsigned long) pid); shadow_progname, lock, (unsigned long) pid);
} }
unlink (file); unlink (file);
errno = EEXIST; errno = EEXIST;
@@ -235,7 +213,7 @@ static int do_lock_file (const char *file, const char *lock, bool log)
if (log) { if (log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: cannot get lock %s: %s\n", "%s: cannot get lock %s: %s\n",
Prog, lock, strerror (errno)); shadow_progname, lock, strerror (errno));
} }
unlink (file); unlink (file);
return 0; return 0;
@@ -247,13 +225,13 @@ static int do_lock_file (const char *file, const char *lock, bool log)
if ((0==retval) && log) { if ((0==retval) && log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: %s: lock file already used\n", "%s: %s: lock file already used\n",
Prog, file); shadow_progname, file);
} }
} else { } else {
if (log) { if (log) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: cannot get lock %s: %s\n", "%s: cannot get lock %s: %s\n",
Prog, lock, strerror (errno)); shadow_progname, lock, strerror (errno));
} }
} }
@@ -403,11 +381,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 +397,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;
} }
@@ -448,7 +426,7 @@ int commonio_lock (struct commonio_db *db)
if (geteuid () != 0) { if (geteuid () != 0) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
"%s: Permission denied.\n", "%s: Permission denied.\n",
Prog); shadow_progname);
} }
return 0; /* failure */ return 0; /* failure */
} }
@@ -483,7 +461,7 @@ int commonio_lock (struct commonio_db *db)
/* no unnecessary retries on "permission denied" errors */ /* no unnecessary retries on "permission denied" errors */
if (geteuid () != 0) { if (geteuid () != 0) {
(void) fprintf (shadow_logfd, "%s: Permission denied.\n", (void) fprintf (shadow_logfd, "%s: Permission denied.\n",
Prog); shadow_progname);
return 0; return 0;
} }
} }
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko
* Copyright (c) 2007 - 2010, Nicolas François * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* $Id$ */ /* $Id$ */
+1 -9
View File
@@ -70,10 +70,6 @@ extern char * textdomain (const char * domainname);
# define strrchr rindex # define strrchr rindex
# endif # endif
char *strchr (), *strrchr (), *strtok (); char *strchr (), *strrchr (), *strtok ();
# ifndef HAVE_MEMCPY
# define memcpy(d, s, n) bcopy((s), (d), (n))
# endif
#endif /* not STDC_HEADERS */ #endif /* not STDC_HEADERS */
#if HAVE_ERRNO_H #if HAVE_ERRNO_H
@@ -115,11 +111,7 @@ char *strchr (), *strrchr (), *strtok ();
# endif # endif
#endif /* not TIME_WITH_SYS_TIME */ #endif /* not TIME_WITH_SYS_TIME */
#ifdef HAVE_MEMSET #define memzero(ptr, size) memset((void *)(ptr), 0, (size))
# define memzero(ptr, size) memset((void *)(ptr), 0, (size))
#else
# define memzero(ptr, size) bzero((char *)(ptr), (size))
#endif
#define strzero(s) memzero(s, strlen(s)) /* warning: evaluates twice */ #define strzero(s) memzero(s, strlen(s)) /* warning: evaluates twice */
#ifdef HAVE_DIRENT_H /* DIR_SYSV */ #ifdef HAVE_DIRENT_H /* DIR_SYSV */
+6 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1993, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1993, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2007 - 2010, Nicolas François * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -39,6 +16,7 @@
#include "prototypes.h" #include "prototypes.h"
#include "defines.h" #include "defines.h"
#include "shadowlog_internal.h"
/*@exposed@*//*@null@*/char *pw_encrypt (const char *clear, const char *salt) /*@exposed@*//*@null@*/char *pw_encrypt (const char *clear, const char *salt)
{ {
+2 -25
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2005 - 2006, Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 - 2006, Tomasz Kłoczko
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* $Id$ */ /* $Id$ */
+6 -29
View File
@@ -1,32 +1,9 @@
/* /*
* Copyright (c) 1989 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1997, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* /*
@@ -45,8 +22,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.
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 , Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 , Julianne Frances Haugh
* Copyright (c) 1996 - 1997, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2007 , Nicolas François * SPDX-FileCopyrightText: 2007 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1999, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1999, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+2 -25
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2009 , Nicolas François * SPDX-FileCopyrightText: 2009 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+2 -25
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2009 , Nicolas François * SPDX-FileCopyrightText: 2009 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+2 -25
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2009 , Nicolas François * SPDX-FileCopyrightText: 2009 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+6 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1991 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2002 - 2006, Tomasz Kłoczko * SPDX-FileCopyrightText: 2002 - 2006, Tomasz Kłoczko
* Copyright (c) 2007 - 2008, Nicolas François * SPDX-FileCopyrightText: 2007 - 2008, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -44,6 +21,7 @@
#include <libeconf.h> #include <libeconf.h>
#endif #endif
#include "getdef.h" #include "getdef.h"
#include "shadowlog_internal.h"
/* /*
* A configuration item definition. * A configuration item definition.
*/ */
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1991 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2002 - 2006, Tomasz Kłoczko * SPDX-FileCopyrightText: 2002 - 2006, Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#ifndef _GETDEF_H #ifndef _GETDEF_H
#define _GETDEF_H #define _GETDEF_H
+2 -25
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2007 - 2009, Nicolas François * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+2 -25
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2007 - 2009, Nicolas François * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+6 -29
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 , Michał Moskal * SPDX-FileCopyrightText: 2001 , Michał Moskal
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2007 - 2010, Nicolas François * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+6 -29
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 , Michał Moskal * SPDX-FileCopyrightText: 2001 , Michał Moskal
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* $Id$ */ /* $Id$ */
+6 -29
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 , Michał Moskal * SPDX-FileCopyrightText: 2001 , Michał Moskal
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2007 - 2013, Nicolas François * SPDX-FileCopyrightText: 2007 - 2013, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2008 - 2009, Nicolas François * SPDX-FileCopyrightText: 2008 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+4 -27
View File
@@ -1,32 +1,9 @@
/* /*
* Copyright (c) 1988 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1988 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1997, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* /*
+4 -27
View File
@@ -1,32 +1,9 @@
/* /*
* Copyright (c) 1992 , Julianne Frances Haugh * SPDX-FileCopyrightText: 1992 , Julianne Frances Haugh
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+5 -4
View File
@@ -10,6 +10,7 @@
#include "defines.h" #include "defines.h"
#include "prototypes.h" #include "prototypes.h"
#include "nscd.h" #include "nscd.h"
#include "shadowlog_internal.h"
#define MSG_NSCD_FLUSH_CACHE_FAILED "%s: Failed to flush the nscd cache.\n" #define MSG_NSCD_FLUSH_CACHE_FAILED "%s: Failed to flush the nscd cache.\n"
@@ -25,7 +26,7 @@ int nscd_flush_cache (const char *service)
if (run_command (cmd, spawnedArgs, spawnedEnv, &status) != 0) { if (run_command (cmd, spawnedArgs, spawnedEnv, &status) != 0) {
/* run_command writes its own more detailed message. */ /* run_command writes its own more detailed message. */
(void) fprintf (shadow_logfd, _(MSG_NSCD_FLUSH_CACHE_FAILED), Prog); (void) fprintf (shadow_logfd, _(MSG_NSCD_FLUSH_CACHE_FAILED), shadow_progname);
return -1; return -1;
} }
@@ -33,7 +34,7 @@ int nscd_flush_cache (const char *service)
if (!WIFEXITED (status)) { if (!WIFEXITED (status)) {
(void) fprintf (shadow_logfd, (void) fprintf (shadow_logfd,
_("%s: nscd did not terminate normally (signal %d)\n"), _("%s: nscd did not terminate normally (signal %d)\n"),
Prog, WTERMSIG (status)); shadow_progname, WTERMSIG (status));
return -1; return -1;
} else if (code == E_CMD_NOTFOUND) { } else if (code == E_CMD_NOTFOUND) {
/* nscd is not installed, or it is installed but uses an /* nscd is not installed, or it is installed but uses an
@@ -44,8 +45,8 @@ int nscd_flush_cache (const char *service)
return 0; return 0;
} else if (code != 0) { } else if (code != 0) {
(void) fprintf (shadow_logfd, _("%s: nscd exited with status %d\n"), (void) fprintf (shadow_logfd, _("%s: nscd exited with status %d\n"),
Prog, code); shadow_progname, code);
(void) fprintf (shadow_logfd, _(MSG_NSCD_FLUSH_CACHE_FAILED), Prog); (void) fprintf (shadow_logfd, _(MSG_NSCD_FLUSH_CACHE_FAILED), shadow_progname);
return -1; return -1;
} }
+1
View File
@@ -8,6 +8,7 @@
#include <stdatomic.h> #include <stdatomic.h>
#include "prototypes.h" #include "prototypes.h"
#include "../libsubid/subid.h" #include "../libsubid/subid.h"
#include "shadowlog_internal.h"
#define NSSWITCH "/etc/nsswitch.conf" #define NSSWITCH "/etc/nsswitch.conf"
+3 -26
View File
@@ -1,31 +1,8 @@
/* /*
* Copyright (c) 1999 , Marek Michałkiewicz * SPDX-FileCopyrightText: 1999 , Marek Michałkiewicz
* Copyright (c) 2001 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1989 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1997, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+4 -27
View File
@@ -1,32 +1,9 @@
/* /*
* Copyright (c) 1989 - 1991, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1991, Julianne Frances Haugh
* Copyright (c) 1996 - 1997, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* /*
+9 -31
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2003 - 2006, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2006, Tomasz Kłoczko
* Copyright (c) 2007 - 2010, Nicolas François * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* /*
@@ -59,9 +36,6 @@
#include "defines.h" #include "defines.h"
#include "commonio.h" #include "commonio.h"
extern /*@observer@*/ const char *Prog; /* Program name showed in error messages */
extern FILE *shadow_logfd; /* file descripter to which error messages are printed */
/* addgrps.c */ /* addgrps.c */
#if defined (HAVE_SETGROUPS) && ! defined (USE_PAM) #if defined (HAVE_SETGROUPS) && ! defined (USE_PAM)
extern int add_groups (const char *); extern int add_groups (const char *);
@@ -134,6 +108,9 @@ extern int copy_tree (const char *src_root, const char *dst_root,
uid_t old_uid, uid_t new_uid, uid_t old_uid, uid_t new_uid,
gid_t old_gid, gid_t new_gid); gid_t old_gid, gid_t new_gid);
/* date_to_str.c */
extern void date_to_str (size_t size, char buf[size], long date);
/* encrypt.c */ /* encrypt.c */
extern /*@exposed@*//*@null@*/char *pw_encrypt (const char *, const char *); extern /*@exposed@*//*@null@*/char *pw_encrypt (const char *, const char *);
@@ -392,6 +369,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
+6 -29
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1992 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1992 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2003 - 2006, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2006, Tomasz Kłoczko
* Copyright (c) 2008 - 2009, Nicolas François * SPDX-FileCopyrightText: 2008 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -127,7 +104,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.
*/ */
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1992 - 1993, Julianne Frances Haugh * SPDX-FileCopyrightText: 1992 - 1993, Julianne Frances Haugh
* Copyright (c) 1996 - 1997, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2009 , Nicolas François * SPDX-FileCopyrightText: 2009 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* /*
+6 -29
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 , Michał Moskal * SPDX-FileCopyrightText: 2001 , Michał Moskal
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2007 - 2009, Nicolas François * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+6 -29
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2005 , Michał Moskal * SPDX-FileCopyrightText: 2005 , Michał Moskal
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* $Id$ */ /* $Id$ */
+16 -37
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 , Michał Moskal * SPDX-FileCopyrightText: 2001 , Michał Moskal
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2007 - 2013, Nicolas François * SPDX-FileCopyrightText: 2007 - 2013, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -93,14 +70,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);
} }
+2 -1
View File
@@ -8,6 +8,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
#include <lib/prototypes.h> #include <lib/prototypes.h>
#include "shadowlog_internal.h"
int run_part (char *script_path, char *name, char *action) int run_part (char *script_path, char *name, char *action)
{ {
@@ -17,7 +18,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;
} }
+10 -26
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2011 , Peter Vrabec <pvrabec@redhat.com> * SPDX-FileCopyrightText: 2011 , Peter Vrabec <pvrabec@redhat.com>
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -38,6 +15,8 @@
#include <selinux/label.h> #include <selinux/label.h>
#include "prototypes.h" #include "prototypes.h"
#include "shadowlog_internal.h"
static bool selinux_checked = false; static bool selinux_checked = false;
static bool selinux_enabled; static bool selinux_enabled;
static /*@null@*/struct selabel_handle *selabel_hnd = NULL; static /*@null@*/struct selabel_handle *selabel_hnd = NULL;
@@ -50,6 +29,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.
@@ -209,7 +193,7 @@ int check_selinux_permit (const char *perm_name)
if (getprevcon_raw (&user_context_raw) != 0) { if (getprevcon_raw (&user_context_raw) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: can not get previous SELinux process context: %s\n"), _("%s: can not get previous SELinux process context: %s\n"),
Prog, strerror (errno)); shadow_progname, strerror (errno));
SYSLOG ((LOG_WARN, SYSLOG ((LOG_WARN,
"can not get previous SELinux process context: %s", "can not get previous SELinux process context: %s",
strerror (errno))); strerror (errno)));
+5 -26
View File
@@ -1,31 +1,8 @@
/* /*
* Copyright (c) 2010 , Jakub Hrozek <jhrozek@redhat.com> * SPDX-FileCopyrightText: 2010 , Jakub Hrozek <jhrozek@redhat.com>
* Copyright (c) 2011 , Peter Vrabec <pvrabec@redhat.com> * SPDX-FileCopyrightText: 2011 , Peter Vrabec <pvrabec@redhat.com>
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -43,6 +20,7 @@
#include <semanage/semanage.h> #include <semanage/semanage.h>
#include "prototypes.h" #include "prototypes.h"
#include "shadowlog_internal.h"
#ifndef DEFAULT_SERANGE #ifndef DEFAULT_SERANGE
#define DEFAULT_SERANGE "s0" #define DEFAULT_SERANGE "s0"
@@ -293,6 +271,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);
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+6 -29
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1989 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -91,7 +68,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 );
} }
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1989 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2009 , Nicolas François * SPDX-FileCopyrightText: 2009 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+6 -29
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 , Michał Moskal * SPDX-FileCopyrightText: 2001 , Michał Moskal
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2007 - 2013, Nicolas François * SPDX-FileCopyrightText: 2007 - 2013, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+6 -29
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 , Michał Moskal * SPDX-FileCopyrightText: 2001 , Michał Moskal
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* $Id$ */ /* $Id$ */
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1989 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2009 , Nicolas François * SPDX-FileCopyrightText: 2009 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+6 -29
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 , Michał Moskal * SPDX-FileCopyrightText: 2001 , Michał Moskal
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2007 - 2009, Nicolas François * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* $Id$ */ /* $Id$ */
+31
View File
@@ -0,0 +1,31 @@
#include "shadowlog.h"
#include "lib/shadowlog_internal.h"
const char *shadow_progname = "libshadow";
FILE *shadow_logfd = NULL;
void log_set_progname(const char *progname)
{
shadow_progname = progname;
}
const char *log_get_progname(void)
{
return shadow_progname;
}
void log_set_logfd(FILE *fd)
{
if (NULL != fd)
shadow_logfd = fd;
else
shadow_logfd = stderr;
}
FILE *log_get_logfd(void)
{
if (shadow_logfd != NULL)
return shadow_logfd;
return stderr;
}
+41
View File
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2021 , Serge Hallyn
* 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.
*/
/* $Id$ */
#ifndef _LOG_H
#define _LOG_H
#include <stdio.h>
extern void log_set_progname(const char *);
extern const char *log_get_progname(void);
extern void log_set_logfd(FILE *fd);
extern FILE *log_get_logfd(void);
extern void log_dolog(char *, ...);
#endif
+2
View File
@@ -0,0 +1,2 @@
extern const char *shadow_progname; /* Program name showed in error messages */
extern FILE *shadow_logfd; /* file descripter to which error messages are printed */
+13 -34
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 , Michał Moskal * SPDX-FileCopyrightText: 2001 , Michał Moskal
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2007 - 2013, Nicolas François * SPDX-FileCopyrightText: 2007 - 2013, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -79,11 +56,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);
} }
+7 -28
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2011 , Jonathan Nieder * SPDX-FileCopyrightText: 2011 , Jonathan Nieder
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -38,6 +15,8 @@
#include "exitcodes.h" #include "exitcodes.h"
#include "prototypes.h" #include "prototypes.h"
#include "shadowlog_internal.h"
int run_command (const char *cmd, const char *argv[], int run_command (const char *cmd, const char *argv[],
/*@null@*/const char *envp[], /*@out@*/int *status) /*@null@*/const char *envp[], /*@out@*/int *status)
{ {
@@ -58,11 +37,11 @@ int run_command (const char *cmd, const char *argv[],
exit (E_CMD_NOTFOUND); exit (E_CMD_NOTFOUND);
} }
fprintf (shadow_logfd, "%s: cannot execute %s: %s\n", fprintf (shadow_logfd, "%s: cannot execute %s: %s\n",
Prog, cmd, strerror (errno)); shadow_progname, cmd, strerror (errno));
exit (E_CMD_NOEXEC); exit (E_CMD_NOEXEC);
} else if ((pid_t)-1 == pid) { } else if ((pid_t)-1 == pid) {
fprintf (shadow_logfd, "%s: cannot execute %s: %s\n", fprintf (shadow_logfd, "%s: cannot execute %s: %s\n",
Prog, cmd, strerror (errno)); shadow_progname, cmd, strerror (errno));
return -1; return -1;
} }
@@ -75,7 +54,7 @@ int run_command (const char *cmd, const char *argv[],
if ((pid_t)-1 == wpid) { if ((pid_t)-1 == wpid) {
fprintf (shadow_logfd, "%s: waitpid (status: %d): %s\n", fprintf (shadow_logfd, "%s: waitpid (status: %d): %s\n",
Prog, *status, strerror (errno)); shadow_progname, *status, strerror (errno));
return -1; return -1;
} }
+6 -4
View File
@@ -11,6 +11,8 @@
#include "prototypes.h" #include "prototypes.h"
#include "sssd.h" #include "sssd.h"
#include "shadowlog_internal.h"
#define MSG_SSSD_FLUSH_CACHE_FAILED "%s: Failed to flush the sssd cache." #define MSG_SSSD_FLUSH_CACHE_FAILED "%s: Failed to flush the sssd cache."
int sssd_flush_cache (int dbflags) int sssd_flush_cache (int dbflags)
@@ -46,22 +48,22 @@ int sssd_flush_cache (int dbflags)
free(sss_cache_args); free(sss_cache_args);
if (rv != 0) { if (rv != 0) {
/* run_command writes its own more detailed message. */ /* run_command writes its own more detailed message. */
SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, Prog)); SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, shadow_progname));
return -1; return -1;
} }
code = WEXITSTATUS (status); code = WEXITSTATUS (status);
if (!WIFEXITED (status)) { if (!WIFEXITED (status)) {
SYSLOG ((LOG_WARN, "%s: sss_cache did not terminate normally (signal %d)", SYSLOG ((LOG_WARN, "%s: sss_cache did not terminate normally (signal %d)",
Prog, WTERMSIG (status))); shadow_progname, WTERMSIG (status)));
return -1; return -1;
} else if (code == E_CMD_NOTFOUND) { } else if (code == E_CMD_NOTFOUND) {
/* sss_cache is not installed, or it is installed but uses an /* sss_cache is not installed, or it is installed but uses an
interpreter that is missing. Probably the former. */ interpreter that is missing. Probably the former. */
return 0; return 0;
} else if (code != 0) { } else if (code != 0) {
SYSLOG ((LOG_WARN, "%s: sss_cache exited with status %d", Prog, code)); SYSLOG ((LOG_WARN, "%s: sss_cache exited with status %d", shadow_progname, code));
SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, Prog)); SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, shadow_progname));
return -1; return -1;
} }
+3 -3
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012 - Eric Biederman * SPDX-FileCopyrightText: 2012 - Eric Biederman
*/ */
#include <config.h> #include <config.h>
@@ -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;
+41 -48
View File
@@ -1,21 +1,6 @@
/* /*
* Copyright (c) 2001 Rafal Wojtczuk, Solar Designer * SPDX-FileCopyrightText: 2001 Rafal Wojtczuk, Solar Designer
* All rights reserved. * SPDX-License-Identifier: 0BSD
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted.
*
* 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.
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
@@ -38,6 +23,8 @@
#include "shadowio.h" #include "shadowio.h"
#include "tcbfuncs.h" #include "tcbfuncs.h"
#include "shadowlog_internal.h"
#define SHADOWTCB_HASH_BY 1000 #define SHADOWTCB_HASH_BY 1000
#define SHADOWTCB_LOCK_SUFFIX ".lock" #define SHADOWTCB_LOCK_SUFFIX ".lock"
@@ -72,7 +59,7 @@ shadowtcb_status shadowtcb_gain_priv (void)
* to exit soon. * to exit soon.
*/ */
#define OUT_OF_MEMORY do { \ #define OUT_OF_MEMORY do { \
fprintf (shadow_logfd, _("%s: out of memory\n"), Prog); \ fprintf (shadow_logfd, _("%s: out of memory\n"), shadow_progname); \
(void) fflush (shadow_logfd); \ (void) fflush (shadow_logfd); \
} while (false) } while (false)
@@ -118,7 +105,7 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name)
if (lstat (path, &st) != 0) { if (lstat (path, &st) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot stat %s: %s\n"), _("%s: Cannot stat %s: %s\n"),
Prog, path, strerror (errno)); shadow_progname, path, strerror (errno));
free (path); free (path);
return NULL; return NULL;
} }
@@ -134,7 +121,7 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name)
if (!S_ISLNK (st.st_mode)) { if (!S_ISLNK (st.st_mode)) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: %s is neither a directory, nor a symlink.\n"), _("%s: %s is neither a directory, nor a symlink.\n"),
Prog, path); shadow_progname, path);
free (path); free (path);
return NULL; return NULL;
} }
@@ -142,7 +129,7 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name)
if (-1 == ret) { if (-1 == ret) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot read symbolic link %s: %s\n"), _("%s: Cannot read symbolic link %s: %s\n"),
Prog, path, strerror (errno)); shadow_progname, path, strerror (errno));
free (path); free (path);
return NULL; return NULL;
} }
@@ -151,7 +138,7 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name)
link[sizeof(link) - 1] = '\0'; link[sizeof(link) - 1] = '\0';
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Suspiciously long symlink: %s\n"), _("%s: Suspiciously long symlink: %s\n"),
Prog, link); shadow_progname, link);
return NULL; return NULL;
} }
link[(size_t)ret] = '\0'; link[(size_t)ret] = '\0';
@@ -209,7 +196,7 @@ static shadowtcb_status mkdir_leading (const char *name, uid_t uid)
if (stat (TCB_DIR, &st) != 0) { if (stat (TCB_DIR, &st) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot stat %s: %s\n"), _("%s: Cannot stat %s: %s\n"),
Prog, TCB_DIR, strerror (errno)); shadow_progname, TCB_DIR, strerror (errno));
goto out_free_path; goto out_free_path;
} }
while ((ind = strchr (ptr, '/'))) { while ((ind = strchr (ptr, '/'))) {
@@ -221,19 +208,19 @@ static shadowtcb_status mkdir_leading (const char *name, uid_t uid)
if ((mkdir (dir, 0700) != 0) && (errno != EEXIST)) { if ((mkdir (dir, 0700) != 0) && (errno != EEXIST)) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot create directory %s: %s\n"), _("%s: Cannot create directory %s: %s\n"),
Prog, dir, strerror (errno)); shadow_progname, dir, strerror (errno));
goto out_free_dir; goto out_free_dir;
} }
if (chown (dir, 0, st.st_gid) != 0) { if (chown (dir, 0, st.st_gid) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change owner of %s: %s\n"), _("%s: Cannot change owner of %s: %s\n"),
Prog, dir, strerror (errno)); shadow_progname, dir, strerror (errno));
goto out_free_dir; goto out_free_dir;
} }
if (chmod (dir, 0711) != 0) { if (chmod (dir, 0711) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change mode of %s: %s\n"), _("%s: Cannot change mode of %s: %s\n"),
Prog, dir, strerror (errno)); shadow_progname, dir, strerror (errno));
goto out_free_dir; goto out_free_dir;
} }
free (dir); free (dir);
@@ -263,7 +250,7 @@ static shadowtcb_status unlink_suffs (const char *user)
if ((unlink (tmp) != 0) && (errno != ENOENT)) { if ((unlink (tmp) != 0) && (errno != ENOENT)) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: unlink: %s: %s\n"), _("%s: unlink: %s: %s\n"),
Prog, tmp, strerror (errno)); shadow_progname, tmp, strerror (errno));
free (tmp); free (tmp);
return SHADOWTCB_FAILURE; return SHADOWTCB_FAILURE;
} }
@@ -288,7 +275,7 @@ static shadowtcb_status rmdir_leading (char *path)
if (errno != ENOTEMPTY) { if (errno != ENOTEMPTY) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot remove directory %s: %s\n"), _("%s: Cannot remove directory %s: %s\n"),
Prog, dir, strerror (errno)); shadow_progname, dir, strerror (errno));
ret = SHADOWTCB_FAILURE; ret = SHADOWTCB_FAILURE;
} }
free (dir); free (dir);
@@ -317,7 +304,7 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid)
if (stat (olddir, &oldmode) != 0) { if (stat (olddir, &oldmode) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot stat %s: %s\n"), _("%s: Cannot stat %s: %s\n"),
Prog, olddir, strerror (errno)); shadow_progname, olddir, strerror (errno));
goto out_free; goto out_free;
} }
old_uid = oldmode.st_uid; old_uid = oldmode.st_uid;
@@ -344,7 +331,7 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid)
if (rename (real_old_dir, real_new_dir) != 0) { if (rename (real_old_dir, real_new_dir) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot rename %s to %s: %s\n"), _("%s: Cannot rename %s to %s: %s\n"),
Prog, real_old_dir, real_new_dir, strerror (errno)); shadow_progname, real_old_dir, real_new_dir, strerror (errno));
goto out_free; goto out_free;
} }
if (rmdir_leading (real_old_dir_rel) == SHADOWTCB_FAILURE) { if (rmdir_leading (real_old_dir_rel) == SHADOWTCB_FAILURE) {
@@ -353,7 +340,7 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid)
if ((unlink (olddir) != 0) && (errno != ENOENT)) { if ((unlink (olddir) != 0) && (errno != ENOENT)) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot remove %s: %s\n"), _("%s: Cannot remove %s: %s\n"),
Prog, olddir, strerror (errno)); shadow_progname, olddir, strerror (errno));
goto out_free; goto out_free;
} }
if (asprintf (&newdir, TCB_DIR "/%s", user_newname) == -1) { if (asprintf (&newdir, TCB_DIR "/%s", user_newname) == -1) {
@@ -367,7 +354,7 @@ static shadowtcb_status move_dir (const char *user_newname, uid_t user_newid)
&& (symlink (real_new_dir_rel, newdir) != 0)) { && (symlink (real_new_dir_rel, newdir) != 0)) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot create symbolic link %s: %s\n"), _("%s: Cannot create symbolic link %s: %s\n"),
Prog, real_new_dir_rel, strerror (errno)); shadow_progname, real_new_dir_rel, strerror (errno));
goto out_free; goto out_free;
} }
ret = SHADOWTCB_SUCCESS; ret = SHADOWTCB_SUCCESS;
@@ -466,31 +453,31 @@ shadowtcb_status shadowtcb_move (/*@NULL@*/const char *user_newname, uid_t user_
if (stat (tcbdir, &dirmode) != 0) { if (stat (tcbdir, &dirmode) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot stat %s: %s\n"), _("%s: Cannot stat %s: %s\n"),
Prog, tcbdir, strerror (errno)); shadow_progname, tcbdir, strerror (errno));
goto out_free; goto out_free;
} }
if (chown (tcbdir, 0, 0) != 0) { if (chown (tcbdir, 0, 0) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change owners of %s: %s\n"), _("%s: Cannot change owners of %s: %s\n"),
Prog, tcbdir, strerror (errno)); shadow_progname, tcbdir, strerror (errno));
goto out_free; goto out_free;
} }
if (chmod (tcbdir, 0700) != 0) { if (chmod (tcbdir, 0700) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change mode of %s: %s\n"), _("%s: Cannot change mode of %s: %s\n"),
Prog, tcbdir, strerror (errno)); shadow_progname, tcbdir, strerror (errno));
goto out_free; goto out_free;
} }
if (lstat (shadow, &filemode) != 0) { if (lstat (shadow, &filemode) != 0) {
if (errno != ENOENT) { if (errno != ENOENT) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot lstat %s: %s\n"), _("%s: Cannot lstat %s: %s\n"),
Prog, shadow, strerror (errno)); shadow_progname, shadow, strerror (errno));
goto out_free; goto out_free;
} }
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Warning, user %s has no tcb shadow file.\n"), _("%s: Warning, user %s has no tcb shadow file.\n"),
Prog, user_newname); shadow_progname, user_newname);
} else { } else {
if (!S_ISREG (filemode.st_mode) || if (!S_ISREG (filemode.st_mode) ||
filemode.st_nlink != 1) { filemode.st_nlink != 1) {
@@ -498,19 +485,19 @@ shadowtcb_status shadowtcb_move (/*@NULL@*/const char *user_newname, uid_t user_
_("%s: Emergency: %s's tcb shadow is not a " _("%s: Emergency: %s's tcb shadow is not a "
"regular file with st_nlink=1.\n" "regular file with st_nlink=1.\n"
"The account is left locked.\n"), "The account is left locked.\n"),
Prog, user_newname); shadow_progname, user_newname);
goto out_free; goto out_free;
} }
if (chown (shadow, user_newid, filemode.st_gid) != 0) { if (chown (shadow, user_newid, filemode.st_gid) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change owner of %s: %s\n"), _("%s: Cannot change owner of %s: %s\n"),
Prog, shadow, strerror (errno)); shadow_progname, shadow, strerror (errno));
goto out_free; goto out_free;
} }
if (chmod (shadow, filemode.st_mode & 07777) != 0) { if (chmod (shadow, filemode.st_mode & 07777) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change mode of %s: %s\n"), _("%s: Cannot change mode of %s: %s\n"),
Prog, shadow, strerror (errno)); shadow_progname, shadow, strerror (errno));
goto out_free; goto out_free;
} }
} }
@@ -520,7 +507,13 @@ shadowtcb_status shadowtcb_move (/*@NULL@*/const char *user_newname, uid_t user_
if (chown (tcbdir, user_newid, dirmode.st_gid) != 0) { if (chown (tcbdir, user_newid, dirmode.st_gid) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change owner of %s: %s\n"), _("%s: Cannot change owner of %s: %s\n"),
Prog, tcbdir, strerror (errno)); shadow_progname, tcbdir, strerror (errno));
goto out_free;
}
if (chmod (tcbdir, dirmode.st_mode & 07777) != 0) {
fprintf (shadow_logfd,
_("%s: Cannot change mode of %s: %s\n"),
shadow_progname, tcbdir, strerror (errno));
goto out_free; goto out_free;
} }
ret = SHADOWTCB_SUCCESS; ret = SHADOWTCB_SUCCESS;
@@ -545,7 +538,7 @@ shadowtcb_status shadowtcb_create (const char *name, uid_t uid)
if (stat (TCB_DIR, &tcbdir_stat) != 0) { if (stat (TCB_DIR, &tcbdir_stat) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot stat %s: %s\n"), _("%s: Cannot stat %s: %s\n"),
Prog, TCB_DIR, strerror (errno)); shadow_progname, TCB_DIR, strerror (errno));
return SHADOWTCB_FAILURE; return SHADOWTCB_FAILURE;
} }
shadowgid = tcbdir_stat.st_gid; shadowgid = tcbdir_stat.st_gid;
@@ -565,39 +558,39 @@ shadowtcb_status shadowtcb_create (const char *name, uid_t uid)
if (mkdir (dir, 0700) != 0) { if (mkdir (dir, 0700) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: mkdir: %s: %s\n"), _("%s: mkdir: %s: %s\n"),
Prog, dir, strerror (errno)); shadow_progname, dir, strerror (errno));
goto out_free; goto out_free;
} }
fd = open (shadow, O_RDWR | O_CREAT | O_TRUNC, 0600); fd = open (shadow, O_RDWR | O_CREAT | O_TRUNC, 0600);
if (fd < 0) { if (fd < 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot open %s: %s\n"), _("%s: Cannot open %s: %s\n"),
Prog, shadow, strerror (errno)); shadow_progname, shadow, strerror (errno));
goto out_free; goto out_free;
} }
close (fd); close (fd);
if (chown (shadow, 0, authgid) != 0) { if (chown (shadow, 0, authgid) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change owner of %s: %s\n"), _("%s: Cannot change owner of %s: %s\n"),
Prog, shadow, strerror (errno)); shadow_progname, shadow, strerror (errno));
goto out_free; goto out_free;
} }
if (chmod (shadow, (mode_t) ((authgid == shadowgid) ? 0600 : 0640)) != 0) { if (chmod (shadow, (mode_t) ((authgid == shadowgid) ? 0600 : 0640)) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change mode of %s: %s\n"), _("%s: Cannot change mode of %s: %s\n"),
Prog, shadow, strerror (errno)); shadow_progname, shadow, strerror (errno));
goto out_free; goto out_free;
} }
if (chown (dir, 0, authgid) != 0) { if (chown (dir, 0, authgid) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change owner of %s: %s\n"), _("%s: Cannot change owner of %s: %s\n"),
Prog, dir, strerror (errno)); shadow_progname, dir, strerror (errno));
goto out_free; goto out_free;
} }
if (chmod (dir, (mode_t) ((authgid == shadowgid) ? 02700 : 02710)) != 0) { if (chmod (dir, (mode_t) ((authgid == shadowgid) ? 02700 : 02710)) != 0) {
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("%s: Cannot change mode of %s: %s\n"), _("%s: Cannot change mode of %s: %s\n"),
Prog, dir, strerror (errno)); shadow_progname, dir, strerror (errno));
goto out_free; goto out_free;
} }
if ( (shadowtcb_set_user (name) == SHADOWTCB_FAILURE) if ( (shadowtcb_set_user (name) == SHADOWTCB_FAILURE)
+4 -27
View File
@@ -1,32 +1,9 @@
/* /*
* Copyright (c) 1993 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1993 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+2 -1
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
@@ -19,6 +19,7 @@ libmisc_la_SOURCES = \
cleanup_user.c \ cleanup_user.c \
console.c \ console.c \
copydir.c \ copydir.c \
date_to_str.c \
entry.c \ entry.c \
env.c \ env.c \
failure.c \ failure.c \
+7 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1989 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2001 - 2006, Tomasz Kłoczko * SPDX-FileCopyrightText: 2001 - 2006, Tomasz Kłoczko
* Copyright (c) 2007 - 2009, Nicolas François * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -40,6 +17,7 @@
#include <stdio.h> #include <stdio.h>
#include <grp.h> #include <grp.h>
#include <errno.h> #include <errno.h>
#include "shadowlog.h"
#ident "$Id$" #ident "$Id$"
@@ -58,6 +36,7 @@ int add_groups (const char *list)
char *token; char *token;
char buf[1024]; char buf[1024];
int ret; int ret;
FILE *shadow_logfd = log_get_logfd();
if (strlen (list) >= sizeof (buf)) { if (strlen (list) >= sizeof (buf)) {
errno = EINVAL; errno = EINVAL;
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1989 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2001 - 2006, Tomasz Kłoczko * SPDX-FileCopyrightText: 2001 - 2006, Tomasz Kłoczko
* Copyright (c) 2008 - 2009, Nicolas François * SPDX-FileCopyrightText: 2008 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+6 -28
View File
@@ -1,32 +1,9 @@
/* /*
* Copyright (c) 2005 , Red Hat, Inc. * SPDX-FileCopyrightText: 2005 , Red Hat, Inc.
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* /*
@@ -45,6 +22,7 @@
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include "prototypes.h" #include "prototypes.h"
#include "shadowlog.h"
int audit_fd; int audit_fd;
void audit_help_open (void) void audit_help_open (void)
@@ -59,7 +37,7 @@ void audit_help_open (void)
return; return;
} }
(void) fputs (_("Cannot open audit interface - aborting.\n"), (void) fputs (_("Cannot open audit interface - aborting.\n"),
shadow_logfd); log_get_logfd());
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
} }
+4 -27
View File
@@ -1,32 +1,9 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1997, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* /*
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko
* Copyright (c) 2005 - 2008, Nicolas François * SPDX-FileCopyrightText: 2005 - 2008, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* /*
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1997 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1997 - 2000, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* $Id$ */ /* $Id$ */
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1992 - 1993, Julianne Frances Haugh * SPDX-FileCopyrightText: 1992 - 1993, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2010 - , Nicolas François * SPDX-FileCopyrightText: 2010 - , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+7 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1989 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2001, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2001, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2007 - 2009, Nicolas François * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -43,6 +20,7 @@
#include "defines.h" #include "defines.h"
#include <pwd.h> #include <pwd.h>
#include "getdef.h" #include "getdef.h"
#include "shadowlog.h"
/* /*
* chown_tty() sets the login tty to be owned by the new user ID * chown_tty() sets the login tty to be owned by the new user ID
@@ -75,6 +53,7 @@ void chown_tty (const struct passwd *info)
if ( (fchown (STDIN_FILENO, info->pw_uid, gid) != 0) if ( (fchown (STDIN_FILENO, info->pw_uid, gid) != 0)
|| (fchmod (STDIN_FILENO, (mode_t)getdef_num ("TTYPERM", 0600)) != 0)) { || (fchmod (STDIN_FILENO, (mode_t)getdef_num ("TTYPERM", 0600)) != 0)) {
int err = errno; int err = errno;
FILE *shadow_logfd = log_get_logfd();
fprintf (shadow_logfd, fprintf (shadow_logfd,
_("Unable to change owner or mode of tty stdin: %s"), _("Unable to change owner or mode of tty stdin: %s"),
+2 -25
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2008 - 2011, Nicolas François * SPDX-FileCopyrightText: 2008 - 2011, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+15 -37
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -36,6 +13,7 @@
#include "groupio.h" #include "groupio.h"
#include "sgroupio.h" #include "sgroupio.h"
#include "prototypes.h" #include "prototypes.h"
#include "shadowlog.h"
/* /*
* cleanup_report_add_group - Report failure to add a group to the system * cleanup_report_add_group - Report failure to add a group to the system
@@ -48,7 +26,7 @@ void cleanup_report_add_group (void *group_name)
SYSLOG ((LOG_ERR, "failed to add group %s", name)); SYSLOG ((LOG_ERR, "failed to add group %s", name));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_GROUP, Prog, audit_logger (AUDIT_ADD_GROUP, log_get_progname(),
"", "",
name, AUDIT_NO_ID, name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -66,7 +44,7 @@ void cleanup_report_del_group (void *group_name)
SYSLOG ((LOG_ERR, "failed to remove group %s", name)); SYSLOG ((LOG_ERR, "failed to remove group %s", name));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_GROUP, Prog, audit_logger (AUDIT_DEL_GROUP, log_get_progname(),
"", "",
name, AUDIT_NO_ID, name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -83,7 +61,7 @@ void cleanup_report_mod_group (void *cleanup_info)
gr_dbname (), gr_dbname (),
info->action)); info->action));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_USER_ACCT, Prog, audit_logger (AUDIT_USER_ACCT, log_get_progname(),
info->audit_msg, info->audit_msg,
info->name, AUDIT_NO_ID, info->name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -101,7 +79,7 @@ void cleanup_report_mod_gshadow (void *cleanup_info)
sgr_dbname (), sgr_dbname (),
info->action)); info->action));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_USER_ACCT, Prog, audit_logger (AUDIT_USER_ACCT, log_get_progname(),
info->audit_msg, info->audit_msg,
info->name, AUDIT_NO_ID, info->name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -121,7 +99,7 @@ void cleanup_report_add_group_group (void *group_name)
SYSLOG ((LOG_ERR, "failed to add group %s to %s", name, gr_dbname ())); SYSLOG ((LOG_ERR, "failed to add group %s to %s", name, gr_dbname ()));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_GROUP, Prog, audit_logger (AUDIT_ADD_GROUP, log_get_progname(),
"adding group to /etc/group", "adding group to /etc/group",
name, AUDIT_NO_ID, name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -141,7 +119,7 @@ void cleanup_report_add_group_gshadow (void *group_name)
SYSLOG ((LOG_ERR, "failed to add group %s to %s", name, sgr_dbname ())); SYSLOG ((LOG_ERR, "failed to add group %s to %s", name, sgr_dbname ()));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_GROUP, Prog, audit_logger (AUDIT_ADD_GROUP, log_get_progname(),
"adding group to /etc/gshadow", "adding group to /etc/gshadow",
name, AUDIT_NO_ID, name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -164,7 +142,7 @@ void cleanup_report_del_group_group (void *group_name)
"failed to remove group %s from %s", "failed to remove group %s from %s",
name, gr_dbname ())); name, gr_dbname ()));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_GROUP, Prog, audit_logger (AUDIT_ADD_GROUP, log_get_progname(),
"removing group from /etc/group", "removing group from /etc/group",
name, AUDIT_NO_ID, name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -187,7 +165,7 @@ void cleanup_report_del_group_gshadow (void *group_name)
"failed to remove group %s from %s", "failed to remove group %s from %s",
name, sgr_dbname ())); name, sgr_dbname ()));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_GROUP, Prog, audit_logger (AUDIT_ADD_GROUP, log_get_progname(),
"removing group from /etc/gshadow", "removing group from /etc/gshadow",
name, AUDIT_NO_ID, name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -203,9 +181,9 @@ void cleanup_report_del_group_gshadow (void *group_name)
void cleanup_unlock_group (unused void *arg) void cleanup_unlock_group (unused void *arg)
{ {
if (gr_unlock () == 0) { if (gr_unlock () == 0) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: failed to unlock %s\n"), _("%s: failed to unlock %s\n"),
Prog, gr_dbname ()); log_get_progname(), gr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ())); SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger_message ("unlocking group file", audit_logger_message ("unlocking group file",
@@ -223,9 +201,9 @@ void cleanup_unlock_group (unused void *arg)
void cleanup_unlock_gshadow (unused void *arg) void cleanup_unlock_gshadow (unused void *arg)
{ {
if (sgr_unlock () == 0) { if (sgr_unlock () == 0) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: failed to unlock %s\n"), _("%s: failed to unlock %s\n"),
Prog, sgr_dbname ()); log_get_progname(), sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ())); SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger_message ("unlocking gshadow file", audit_logger_message ("unlocking gshadow file",
+11 -33
View File
@@ -1,30 +1,7 @@
/* /*
* Copyright (c) 2008 , Nicolas François * SPDX-FileCopyrightText: 2008 , Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -36,6 +13,7 @@
#include "pwio.h" #include "pwio.h"
#include "shadowio.h" #include "shadowio.h"
#include "prototypes.h" #include "prototypes.h"
#include "shadowlog.h"
/* /*
* cleanup_report_add_user - Report failure to add an user to the system * cleanup_report_add_user - Report failure to add an user to the system
@@ -48,7 +26,7 @@ void cleanup_report_add_user (void *user_name)
SYSLOG ((LOG_ERR, "failed to add user %s", name)); SYSLOG ((LOG_ERR, "failed to add user %s", name));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER, Prog, audit_logger (AUDIT_ADD_USER, log_get_progname(),
"", "",
name, AUDIT_NO_ID, name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -65,7 +43,7 @@ void cleanup_report_mod_passwd (void *cleanup_info)
pw_dbname (), pw_dbname (),
info->action)); info->action));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_USER_ACCT, Prog, audit_logger (AUDIT_USER_ACCT, log_get_progname(),
info->audit_msg, info->audit_msg,
info->name, AUDIT_NO_ID, info->name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -85,7 +63,7 @@ void cleanup_report_add_user_passwd (void *user_name)
SYSLOG ((LOG_ERR, "failed to add user %s to %s", name, pw_dbname ())); SYSLOG ((LOG_ERR, "failed to add user %s to %s", name, pw_dbname ()));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER, Prog, audit_logger (AUDIT_ADD_USER, log_get_progname(),
"adding user to /etc/passwd", "adding user to /etc/passwd",
name, AUDIT_NO_ID, name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -105,7 +83,7 @@ void cleanup_report_add_user_shadow (void *user_name)
SYSLOG ((LOG_ERR, "failed to add user %s to %s", name, spw_dbname ())); SYSLOG ((LOG_ERR, "failed to add user %s to %s", name, spw_dbname ()));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER, Prog, audit_logger (AUDIT_ADD_USER, log_get_progname(),
"adding user to /etc/shadow", "adding user to /etc/shadow",
name, AUDIT_NO_ID, name, AUDIT_NO_ID,
SHADOW_AUDIT_FAILURE); SHADOW_AUDIT_FAILURE);
@@ -120,9 +98,9 @@ void cleanup_report_add_user_shadow (void *user_name)
void cleanup_unlock_passwd (unused void *arg) void cleanup_unlock_passwd (unused void *arg)
{ {
if (pw_unlock () == 0) { if (pw_unlock () == 0) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: failed to unlock %s\n"), _("%s: failed to unlock %s\n"),
Prog, pw_dbname ()); log_get_progname(), pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ())); SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger_message ("unlocking passwd file", audit_logger_message ("unlocking passwd file",
@@ -139,9 +117,9 @@ void cleanup_unlock_passwd (unused void *arg)
void cleanup_unlock_shadow (unused void *arg) void cleanup_unlock_shadow (unused void *arg)
{ {
if (spw_unlock () == 0) { if (spw_unlock () == 0) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: failed to unlock %s\n"), _("%s: failed to unlock %s\n"),
Prog, spw_dbname ()); log_get_progname(), spw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ())); SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger_message ("unlocking shadow file", audit_logger_message ("unlocking shadow file",
+6 -29
View File
@@ -1,34 +1,11 @@
/* /*
* Copyright (c) 1991 , Julianne Frances Haugh * SPDX-FileCopyrightText: 1991 , Julianne Frances Haugh
* Copyright (c) 1991 , Chip Rosenthal * SPDX-FileCopyrightText: 1991 , Chip Rosenthal
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2007 - 2010, Nicolas François * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+12 -33
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1991 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2001, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2001, Marek Michałkiewicz
* Copyright (c) 2003 - 2006, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2006, Tomasz Kłoczko
* Copyright (c) 2007 - 2010, Nicolas François * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -55,6 +32,7 @@
#ifdef WITH_ATTR #ifdef WITH_ATTR
#include <attr/libattr.h> #include <attr/libattr.h>
#endif /* WITH_ATTR */ #endif /* WITH_ATTR */
#include "shadowlog.h"
static /*@null@*/const char *src_orig; static /*@null@*/const char *src_orig;
@@ -116,6 +94,7 @@ static int fchown_if_needed (int fdst, const struct stat *statp,
static void error_acl (struct error_context *ctx, const char *fmt, ...) static void error_acl (struct error_context *ctx, const char *fmt, ...)
{ {
va_list ap; va_list ap;
FILE *shadow_logfd = log_get_logfd();
/* ignore the case when destination does not support ACLs /* ignore the case when destination does not support ACLs
* or extended attributes */ * or extended attributes */
@@ -125,7 +104,7 @@ static void error_acl (struct error_context *ctx, const char *fmt, ...)
} }
va_start (ap, fmt); va_start (ap, fmt);
(void) fprintf (shadow_logfd, _("%s: "), Prog); (void) fprintf (shadow_logfd, _("%s: "), log_get_progname());
if (vfprintf (shadow_logfd, fmt, ap) != 0) { if (vfprintf (shadow_logfd, fmt, ap) != 0) {
(void) fputs (_(": "), shadow_logfd); (void) fputs (_(": "), shadow_logfd);
} }
@@ -248,9 +227,9 @@ int copy_tree (const char *src_root, const char *dst_root,
} }
if (!S_ISDIR (sb.st_mode)) { if (!S_ISDIR (sb.st_mode)) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
"%s: %s is not a directory", "%s: %s is not a directory",
Prog, src_root); log_get_progname(), src_root);
return -1; return -1;
} }
@@ -739,7 +718,7 @@ static int copy_file (const char *src, const char *dst,
char buf[1024]; char buf[1024];
ssize_t cnt; ssize_t cnt;
ifd = open (src, O_RDONLY); ifd = open (src, O_RDONLY|O_NOFOLLOW);
if (ifd < 0) { if (ifd < 0) {
return -1; return -1;
} }
@@ -749,7 +728,7 @@ static int copy_file (const char *src, const char *dst,
return -1; return -1;
} }
#endif /* WITH_SELINUX */ #endif /* WITH_SELINUX */
ofd = open (dst, O_WRONLY | O_CREAT | O_TRUNC, statp->st_mode & 07777); ofd = open (dst, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW, statp->st_mode & 07777);
if ( (ofd < 0) if ( (ofd < 0)
|| (fchown_if_needed (ofd, statp, || (fchown_if_needed (ofd, statp,
old_uid, new_uid, old_gid, new_gid) != 0) old_uid, new_uid, old_gid, new_gid) != 0)
+46
View File
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2021, Alejandro Colomar <alx.manpages@gmail.com>
*
* 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.
*/
#include <string.h>
#include <time.h>
#ident "$Id$"
#include "prototypes.h"
void date_to_str (size_t size, char buf[size], long date)
{
time_t t;
t = date;
if (date < 0)
(void) strncpy (buf, "never", size);
else
(void) strftime (buf, size, "%Y-%m-%d", gmtime (&t));
buf[size - 1] = '\0';
}
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1989 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2007 - 2008, Nicolas François * SPDX-FileCopyrightText: 2007 - 2008, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
+7 -29
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1989 - 1992, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1992, Julianne Frances Haugh
* Copyright (c) 1996 - 1999, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1999, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2008 - 2009, Nicolas François * SPDX-FileCopyrightText: 2008 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -40,6 +17,7 @@
#include <string.h> #include <string.h>
#include "prototypes.h" #include "prototypes.h"
#include "defines.h" #include "defines.h"
#include "shadowlog.h"
/* /*
* NEWENVP_STEP must be a power of two. This is the number * NEWENVP_STEP must be a power of two. This is the number
* of (char *) pointers to allocate at a time, to avoid using * of (char *) pointers to allocate at a time, to avoid using
@@ -171,7 +149,7 @@ void addenv (const char *string, /*@null@*/const char *value)
} }
newenvp = __newenvp; newenvp = __newenvp;
} else { } else {
(void) fputs (_("Environment overflow\n"), shadow_logfd); (void) fputs (_("Environment overflow\n"), log_get_logfd());
newenvc--; newenvc--;
free (newenvp[newenvc]); free (newenvp[newenvc]);
} }
+5 -53
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1989 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 1998, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
* Copyright (c) 2002 - 2005, Tomasz Kłoczko * SPDX-FileCopyrightText: 2002 - 2005, Tomasz Kłoczko
* Copyright (c) 2008 - 2010, Nicolas François * SPDX-FileCopyrightText: 2008 - 2010, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -232,13 +209,8 @@ int failcheck (uid_t uid, struct faillog *fl, bool failed)
void failprint (const struct faillog *fail) void failprint (const struct faillog *fail)
{ {
struct tm *tp; struct tm *tp;
#if HAVE_STRFTIME
char lasttimeb[256]; char lasttimeb[256];
char *lasttime = lasttimeb; char *lasttime = lasttimeb;
#else
char *lasttime;
#endif
time_t NOW; time_t NOW;
if (0 == fail->fail_cnt) { if (0 == fail->fail_cnt) {
@@ -248,31 +220,11 @@ void failprint (const struct faillog *fail)
tp = localtime (&(fail->fail_time)); tp = localtime (&(fail->fail_time));
(void) time (&NOW); (void) time (&NOW);
#if HAVE_STRFTIME
/* /*
* Print all information we have. * Print all information we have.
*/ */
(void) strftime (lasttimeb, sizeof lasttimeb, "%c", tp); (void) strftime (lasttimeb, sizeof lasttimeb, "%c", tp);
#else
/*
* Do the same thing, but don't use strftime since it
* probably doesn't exist on this system
*/
lasttime = asctime (tp);
lasttime[24] = '\0';
if ((NOW - fail->fail_time) < YEAR) {
lasttime[19] = '\0';
}
if ((NOW - fail->fail_time) < DAY) {
lasttime = lasttime + 11;
}
if (' ' == *lasttime) {
lasttime++;
}
#endif
/*@-formatconst@*/ /*@-formatconst@*/
(void) printf (ngettext ("%d failure since last login.\n" (void) printf (ngettext ("%d failure since last login.\n"
"Last was %s on %s.\n", "Last was %s on %s.\n",
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1997 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1997 - 2000, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* Copyright (c) 2008 - 2009, Nicolas François * SPDX-FileCopyrightText: 2008 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
/* $Id$ */ /* $Id$ */
+23 -45
View File
@@ -1,32 +1,9 @@
/* /*
* Copyright (c) 1991 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh
* Copyright (c) 2008 - 2011, Nicolas François * SPDX-FileCopyrightText: 2008 - 2011, Nicolas François
* Copyright (c) 2014, Red Hat, Inc. * SPDX-FileCopyrightText: 2014, Red Hat, Inc.
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -38,6 +15,7 @@
#include "prototypes.h" #include "prototypes.h"
#include "groupio.h" #include "groupio.h"
#include "getdef.h" #include "getdef.h"
#include "shadowlog.h"
/* /*
* get_ranges - Get the minimum and maximum ID ranges for the search * get_ranges - Get the minimum and maximum ID ranges for the search
@@ -74,10 +52,10 @@ static int get_ranges (bool sys_group, gid_t *min_id, gid_t *max_id,
/* Check that the ranges make sense */ /* Check that the ranges make sense */
if (*max_id < *min_id) { if (*max_id < *min_id) {
(void) fprintf (shadow_logfd, (void) fprintf (log_get_logfd(),
_("%s: Invalid configuration: SYS_GID_MIN (%lu), " _("%s: Invalid configuration: SYS_GID_MIN (%lu), "
"GID_MIN (%lu), SYS_GID_MAX (%lu)\n"), "GID_MIN (%lu), SYS_GID_MAX (%lu)\n"),
Prog, (unsigned long) *min_id, log_get_progname(), (unsigned long) *min_id,
getdef_ulong ("GID_MIN", 1000UL), getdef_ulong ("GID_MIN", 1000UL),
(unsigned long) *max_id); (unsigned long) *max_id);
return EINVAL; return EINVAL;
@@ -97,10 +75,10 @@ static int get_ranges (bool sys_group, gid_t *min_id, gid_t *max_id,
/* Check that the ranges make sense */ /* Check that the ranges make sense */
if (*max_id < *min_id) { if (*max_id < *min_id) {
(void) fprintf (shadow_logfd, (void) fprintf (log_get_logfd(),
_("%s: Invalid configuration: GID_MIN (%lu), " _("%s: Invalid configuration: GID_MIN (%lu), "
"GID_MAX (%lu)\n"), "GID_MAX (%lu)\n"),
Prog, (unsigned long) *min_id, log_get_progname(), (unsigned long) *min_id,
(unsigned long) *max_id); (unsigned long) *max_id);
return EINVAL; return EINVAL;
} }
@@ -213,10 +191,10 @@ int find_new_gid (bool sys_group,
* more likely to want to stop and address the * more likely to want to stop and address the
* issue. * issue.
*/ */
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Encountered error attempting to use " _("%s: Encountered error attempting to use "
"preferred GID: %s\n"), "preferred GID: %s\n"),
Prog, strerror (result)); log_get_progname(), strerror (result));
return -1; return -1;
} }
} }
@@ -243,9 +221,9 @@ int find_new_gid (bool sys_group,
/* Create an array to hold all of the discovered GIDs */ /* Create an array to hold all of the discovered GIDs */
used_gids = malloc (sizeof (bool) * (gid_max +1)); used_gids = malloc (sizeof (bool) * (gid_max +1));
if (NULL == used_gids) { if (NULL == used_gids) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: failed to allocate memory: %s\n"), _("%s: failed to allocate memory: %s\n"),
Prog, strerror (errno)); log_get_progname(), strerror (errno));
return -1; return -1;
} }
memset (used_gids, false, sizeof (bool) * (gid_max + 1)); memset (used_gids, false, sizeof (bool) * (gid_max + 1));
@@ -323,10 +301,10 @@ int find_new_gid (bool sys_group,
* *
*/ */
if (!nospam) { if (!nospam) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique system GID (%s). " _("%s: Can't get unique system GID (%s). "
"Suppressing additional messages.\n"), "Suppressing additional messages.\n"),
Prog, strerror (result)); log_get_progname(), strerror (result));
SYSLOG ((LOG_ERR, SYSLOG ((LOG_ERR,
"Error checking available GIDs: %s", "Error checking available GIDs: %s",
strerror (result))); strerror (result)));
@@ -366,10 +344,10 @@ int find_new_gid (bool sys_group,
* *
*/ */
if (!nospam) { if (!nospam) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique system GID (%s). " _("%s: Can't get unique system GID (%s). "
"Suppressing additional messages.\n"), "Suppressing additional messages.\n"),
Prog, strerror (result)); log_get_progname(), strerror (result));
SYSLOG ((LOG_ERR, SYSLOG ((LOG_ERR,
"Error checking available GIDs: %s", "Error checking available GIDs: %s",
strerror (result))); strerror (result)));
@@ -426,10 +404,10 @@ int find_new_gid (bool sys_group,
* *
*/ */
if (!nospam) { if (!nospam) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique GID (%s). " _("%s: Can't get unique GID (%s). "
"Suppressing additional messages.\n"), "Suppressing additional messages.\n"),
Prog, strerror (result)); log_get_progname(), strerror (result));
SYSLOG ((LOG_ERR, SYSLOG ((LOG_ERR,
"Error checking available GIDs: %s", "Error checking available GIDs: %s",
strerror (result))); strerror (result)));
@@ -469,10 +447,10 @@ int find_new_gid (bool sys_group,
* *
*/ */
if (!nospam) { if (!nospam) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique GID (%s). " _("%s: Can't get unique GID (%s). "
"Suppressing additional messages.\n"), "Suppressing additional messages.\n"),
Prog, strerror (result)); log_get_progname(), strerror (result));
SYSLOG ((LOG_ERR, SYSLOG ((LOG_ERR,
"Error checking available GIDs: %s", "Error checking available GIDs: %s",
strerror (result))); strerror (result)));
@@ -488,9 +466,9 @@ int find_new_gid (bool sys_group,
} }
/* The code reached here and found no available IDs in the range */ /* The code reached here and found no available IDs in the range */
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique GID (no more available GIDs)\n"), _("%s: Can't get unique GID (no more available GIDs)\n"),
Prog); log_get_progname());
SYSLOG ((LOG_WARN, "no more available GIDs on the system")); SYSLOG ((LOG_WARN, "no more available GIDs on the system"));
free (used_gids); free (used_gids);
return -1; return -1;
+7 -28
View File
@@ -1,29 +1,7 @@
/* /*
* Copyright (c) 2012 Eric Biederman * SPDX-FileCopyrightText: 2012 Eric Biederman
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -37,6 +15,7 @@
#include "prototypes.h" #include "prototypes.h"
#include "subordinateio.h" #include "subordinateio.h"
#include "getdef.h" #include "getdef.h"
#include "shadowlog.h"
/* /*
* find_new_sub_gids - Find a new unused range of GIDs. * find_new_sub_gids - Find a new unused range of GIDs.
@@ -60,18 +39,18 @@ int find_new_sub_gids (gid_t *range_start, unsigned long *range_count)
count = getdef_ulong ("SUB_GID_COUNT", 65536); count = getdef_ulong ("SUB_GID_COUNT", 65536);
if (min > max || count >= max || (min + count - 1) > max) { if (min > max || count >= max || (min + count - 1) > max) {
(void) fprintf (shadow_logfd, (void) fprintf (log_get_logfd(),
_("%s: Invalid configuration: SUB_GID_MIN (%lu)," _("%s: Invalid configuration: SUB_GID_MIN (%lu),"
" SUB_GID_MAX (%lu), SUB_GID_COUNT (%lu)\n"), " SUB_GID_MAX (%lu), SUB_GID_COUNT (%lu)\n"),
Prog, min, max, count); log_get_progname(), min, max, count);
return -1; return -1;
} }
start = sub_gid_find_free_range(min, max, count); start = sub_gid_find_free_range(min, max, count);
if (start == (gid_t)-1) { if (start == (gid_t)-1) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique subordinate GID range\n"), _("%s: Can't get unique subordinate GID range\n"),
Prog); log_get_progname());
SYSLOG ((LOG_WARN, "no more available subordinate GIDs on the system")); SYSLOG ((LOG_WARN, "no more available subordinate GIDs on the system"));
return -1; return -1;
} }
+7 -28
View File
@@ -1,29 +1,7 @@
/* /*
* Copyright (c) 2012 Eric Biederman * SPDX-FileCopyrightText: 2012 Eric Biederman
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -37,6 +15,7 @@
#include "prototypes.h" #include "prototypes.h"
#include "subordinateio.h" #include "subordinateio.h"
#include "getdef.h" #include "getdef.h"
#include "shadowlog.h"
/* /*
* find_new_sub_uids - Find a new unused range of UIDs. * find_new_sub_uids - Find a new unused range of UIDs.
@@ -60,18 +39,18 @@ int find_new_sub_uids (uid_t *range_start, unsigned long *range_count)
count = getdef_ulong ("SUB_UID_COUNT", 65536); count = getdef_ulong ("SUB_UID_COUNT", 65536);
if (min > max || count >= max || (min + count - 1) > max) { if (min > max || count >= max || (min + count - 1) > max) {
(void) fprintf (shadow_logfd, (void) fprintf (log_get_logfd(),
_("%s: Invalid configuration: SUB_UID_MIN (%lu)," _("%s: Invalid configuration: SUB_UID_MIN (%lu),"
" SUB_UID_MAX (%lu), SUB_UID_COUNT (%lu)\n"), " SUB_UID_MAX (%lu), SUB_UID_COUNT (%lu)\n"),
Prog, min, max, count); log_get_progname(), min, max, count);
return -1; return -1;
} }
start = sub_uid_find_free_range(min, max, count); start = sub_uid_find_free_range(min, max, count);
if (start == (uid_t)-1) { if (start == (uid_t)-1) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique subordinate UID range\n"), _("%s: Can't get unique subordinate UID range\n"),
Prog); log_get_progname());
SYSLOG ((LOG_WARN, "no more available subordinate UIDs on the system")); SYSLOG ((LOG_WARN, "no more available subordinate UIDs on the system"));
return -1; return -1;
} }
+23 -45
View File
@@ -1,32 +1,9 @@
/* /*
* Copyright (c) 1991 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh
* Copyright (c) 2008 - 2011, Nicolas François * SPDX-FileCopyrightText: 2008 - 2011, Nicolas François
* Copyright (c) 2014, Red Hat, Inc. * SPDX-FileCopyrightText: 2014, Red Hat, Inc.
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>
@@ -38,6 +15,7 @@
#include "prototypes.h" #include "prototypes.h"
#include "pwio.h" #include "pwio.h"
#include "getdef.h" #include "getdef.h"
#include "shadowlog.h"
/* /*
* get_ranges - Get the minimum and maximum ID ranges for the search * get_ranges - Get the minimum and maximum ID ranges for the search
@@ -74,10 +52,10 @@ static int get_ranges (bool sys_user, uid_t *min_id, uid_t *max_id,
/* Check that the ranges make sense */ /* Check that the ranges make sense */
if (*max_id < *min_id) { if (*max_id < *min_id) {
(void) fprintf (shadow_logfd, (void) fprintf (log_get_logfd(),
_("%s: Invalid configuration: SYS_UID_MIN (%lu), " _("%s: Invalid configuration: SYS_UID_MIN (%lu), "
"UID_MIN (%lu), SYS_UID_MAX (%lu)\n"), "UID_MIN (%lu), SYS_UID_MAX (%lu)\n"),
Prog, (unsigned long) *min_id, log_get_progname(), (unsigned long) *min_id,
getdef_ulong ("UID_MIN", 1000UL), getdef_ulong ("UID_MIN", 1000UL),
(unsigned long) *max_id); (unsigned long) *max_id);
return EINVAL; return EINVAL;
@@ -97,10 +75,10 @@ static int get_ranges (bool sys_user, uid_t *min_id, uid_t *max_id,
/* Check that the ranges make sense */ /* Check that the ranges make sense */
if (*max_id < *min_id) { if (*max_id < *min_id) {
(void) fprintf (shadow_logfd, (void) fprintf (log_get_logfd(),
_("%s: Invalid configuration: UID_MIN (%lu), " _("%s: Invalid configuration: UID_MIN (%lu), "
"UID_MAX (%lu)\n"), "UID_MAX (%lu)\n"),
Prog, (unsigned long) *min_id, log_get_progname(), (unsigned long) *min_id,
(unsigned long) *max_id); (unsigned long) *max_id);
return EINVAL; return EINVAL;
} }
@@ -213,10 +191,10 @@ int find_new_uid(bool sys_user,
* more likely to want to stop and address the * more likely to want to stop and address the
* issue. * issue.
*/ */
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Encountered error attempting to use " _("%s: Encountered error attempting to use "
"preferred UID: %s\n"), "preferred UID: %s\n"),
Prog, strerror (result)); log_get_progname(), strerror (result));
return -1; return -1;
} }
} }
@@ -243,9 +221,9 @@ int find_new_uid(bool sys_user,
/* Create an array to hold all of the discovered UIDs */ /* Create an array to hold all of the discovered UIDs */
used_uids = malloc (sizeof (bool) * (uid_max +1)); used_uids = malloc (sizeof (bool) * (uid_max +1));
if (NULL == used_uids) { if (NULL == used_uids) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: failed to allocate memory: %s\n"), _("%s: failed to allocate memory: %s\n"),
Prog, strerror (errno)); log_get_progname(), strerror (errno));
return -1; return -1;
} }
memset (used_uids, false, sizeof (bool) * (uid_max + 1)); memset (used_uids, false, sizeof (bool) * (uid_max + 1));
@@ -323,10 +301,10 @@ int find_new_uid(bool sys_user,
* *
*/ */
if (!nospam) { if (!nospam) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique system UID (%s). " _("%s: Can't get unique system UID (%s). "
"Suppressing additional messages.\n"), "Suppressing additional messages.\n"),
Prog, strerror (result)); log_get_progname(), strerror (result));
SYSLOG ((LOG_ERR, SYSLOG ((LOG_ERR,
"Error checking available UIDs: %s", "Error checking available UIDs: %s",
strerror (result))); strerror (result)));
@@ -366,10 +344,10 @@ int find_new_uid(bool sys_user,
* *
*/ */
if (!nospam) { if (!nospam) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique system UID (%s). " _("%s: Can't get unique system UID (%s). "
"Suppressing additional messages.\n"), "Suppressing additional messages.\n"),
Prog, strerror (result)); log_get_progname(), strerror (result));
SYSLOG((LOG_ERR, SYSLOG((LOG_ERR,
"Error checking available UIDs: %s", "Error checking available UIDs: %s",
strerror (result))); strerror (result)));
@@ -426,10 +404,10 @@ int find_new_uid(bool sys_user,
* *
*/ */
if (!nospam) { if (!nospam) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique UID (%s). " _("%s: Can't get unique UID (%s). "
"Suppressing additional messages.\n"), "Suppressing additional messages.\n"),
Prog, strerror (result)); log_get_progname(), strerror (result));
SYSLOG ((LOG_ERR, SYSLOG ((LOG_ERR,
"Error checking available UIDs: %s", "Error checking available UIDs: %s",
strerror (result))); strerror (result)));
@@ -469,10 +447,10 @@ int find_new_uid(bool sys_user,
* *
*/ */
if (!nospam) { if (!nospam) {
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique UID (%s). " _("%s: Can't get unique UID (%s). "
"Suppressing additional messages.\n"), "Suppressing additional messages.\n"),
Prog, strerror (result)); log_get_progname(), strerror (result));
SYSLOG ((LOG_ERR, SYSLOG ((LOG_ERR,
"Error checking available UIDs: %s", "Error checking available UIDs: %s",
strerror (result))); strerror (result)));
@@ -488,9 +466,9 @@ int find_new_uid(bool sys_user,
} }
/* The code reached here and found no available IDs in the range */ /* The code reached here and found no available IDs in the range */
fprintf (shadow_logfd, fprintf (log_get_logfd(),
_("%s: Can't get unique UID (no more available UIDs)\n"), _("%s: Can't get unique UID (no more available UIDs)\n"),
Prog); log_get_progname());
SYSLOG ((LOG_WARN, "no more available UIDs on the system")); SYSLOG ((LOG_WARN, "no more available UIDs on the system"));
free (used_uids); free (used_uids);
return -1; return -1;
+4 -27
View File
@@ -1,32 +1,9 @@
/* /*
* Copyright (c) 1990 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* Copyright (c) 1997 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1997 - 2000, Marek Michałkiewicz
* Copyright (c) 2005 , Tomasz Kłoczko * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#ifndef _GETDATE_H_ #ifndef _GETDATE_H_
+1 -1
View File
@@ -61,7 +61,7 @@
/* Some old versions of bison generate parsers that use bcopy. /* Some old versions of bison generate parsers that use bcopy.
That loses on systems that don't provide the function, so we have That loses on systems that don't provide the function, so we have
to redefine it here. */ to redefine it here. */
#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy) #if !defined (HAVE_BCOPY) && !defined (bcopy)
# define bcopy(from, to, len) memcpy ((to), (from), (len)) # define bcopy(from, to, len) memcpy ((to), (from), (len))
#endif #endif
+5 -28
View File
@@ -1,33 +1,10 @@
/* /*
* Copyright (c) 1991 - 1994, Julianne Frances Haugh * SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh
* Copyright (c) 1996 - 2000, Marek Michałkiewicz * SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2000 - 2006, Tomasz Kłoczko * SPDX-FileCopyrightText: 2000 - 2006, Tomasz Kłoczko
* Copyright (c) 2007 - 2009, Nicolas François * SPDX-FileCopyrightText: 2007 - 2009, Nicolas François
* All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * SPDX-License-Identifier: BSD-3-Clause
* 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.
*/ */
#include <config.h> #include <config.h>

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