Compare commits

...

36 Commits

Author SHA1 Message Date
Serge Hallyn
ba43b49a52 configure.ac: Release 4.15.0
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-03-08 16:04:59 -06:00
Alejandro Colomar
89c4da43cb src/vipw.c: Use string literals to initialize 'Prog'
This avoids using argv[0], which is controlled by the user,
and might inject arbitrary text in stderr and the logs.

Link: <https://github.com/shadow-maint/shadow/issues/959>
Link: <https://github.com/shadow-maint/shadow/pull/960>
Cc: "Skyler Ferrante (RIT Student)" <sjf5462@rit.edu>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Karel Zak <kzak@redhat.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Christian Brauner <christian@brauner.io>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-08 10:24:15 -06:00
Alejandro Colomar
0ab893a734 src/vipw.c: Reverse logic and variable name
Since we're checking for "vigr", it makes more sense to name the
variable accordingly.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-08 10:24:15 -06:00
Skyler Ferrante
e6c2e43937 Hardcoding Prog to known value
See #959. We now set Prog (program name) based on hardcoded value instead
of argv[0]. This is to help prevent escape sequence injection.
2024-03-07 22:23:04 +01:00
Alejandro Colomar
d13844408c share/containers/: trap(1) to see the cmocka logs
Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-04 01:43:25 +01:00
Alejandro Colomar
e59a39663d share/containers/: Specify one argument per line
Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-04 01:43:25 +01:00
Alejandro Colomar
a14936cf2e .github/workflows/runner.yml: trap(1) to see the testsuite log
Otherwise, 'cat testsuite.log' isn't run, since 'set -e' aborts the
script earlier.

Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-04 01:43:25 +01:00
Serge Hallyn
959343fe79 configure.ac: release 4.15.0-rc3
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-02-29 19:51:37 -06:00
Alejandro Colomar
1af6b68cbe lib/utmp.c: Use the appropriate autotools macros for struct utmpx
Recently, we started using utmpx instead of utmp, and we updated
<./configure.ac> to do the checks for 'struct utmpx' instead of
'struct utmp'.  However, I forgot to update the preprocessor
conditionals accordingly.

Fixes: 64bcb54fa9 ("lib/, src/, configure.ac: Use utmpx instead of utmp")
Link: <https://github.com/shadow-maint/shadow/pull/954>
Cc: Firas Khalil Khana <firasuke@gmail.com>
Cc: "A. Wilfox" <https://github.com/awilfox>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-21 15:43:25 +01:00
Alejandro Colomar
2806b827d8 lib/utmp.c: Use defined() instead of #if[n]def
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-21 15:43:25 +01:00
Alejandro Colomar
7e94a2f484 lib/utmp.c: Remove #endif comments
Indentation makes it clear which is which.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-21 15:43:25 +01:00
Alejandro Colomar
e5815acf37 lib/utmp.c: Merge preprocessor conditionals
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-21 15:43:25 +01:00
Alejandro Colomar
f4ea04b728 lib/utmp.c: Indent nested preprocessor conditionals
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-21 15:43:25 +01:00
Alejandro Colomar
5ff6edf9f2 lib/utmp.c: Replace UT_LINESIZE by a NITEMS() calculation
A difference between 'struct utmp' and 'struct utmpx' is that
the former uses UT_LINESIZE for the size of its array members,
while the latter doesn't have a standard variable to get its
size.  Therefore, we need to get the number of elements in
the array with NITEMS().

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-20 18:53:53 +01:00
Alejandro Colomar
544709fad3 lib/sizeof.h: memberof(): Add macro
This macro is useful to get the size of a member of a structure
without having a variable of that type.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-20 18:53:53 +01:00
Alejandro Colomar
8d1f0bcf99 lib/utmp.c: get_session_host(): Reduce scope of variable
This silences a warning about an unused variable.

Tested-by: Firas Khalil Khana <firasuke@gmail.com>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-20 18:53:53 +01:00
Alejandro Colomar
64bcb54fa9 lib/, src/, configure.ac: Use utmpx instead of utmp
utmpx is specified by POSIX as an XSI extension.  That's more portable
than utmp, which is unavailable for example in musl libc.  The manual
page specifies that in Linux (but it probably means in glibc), utmp and
utmpx (and the functions that use them) are identical, so this commit
shouldn't affect glibc systems.

Assume utmpx is always present.

Also, if utmpx is present, POSIX guarantees that some members exist:

-  ut_user
-  ut_id
-  ut_line
-  ut_pid
-  ut_type
-  ut_tv

So, rely on them unconditionally.

Fixes: 170b76cdd1 ("Disable utmpx permanently")
Closes: <https://github.com/shadow-maint/shadow/issues/945>
Reported-by: Firas Khalil Khana <firasuke@gmail.com>
Reported-by: "A. Wilfox" <https://github.com/awilfox>
Tested-by: Firas Khalil Khana <firasuke@gmail.com>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-20 18:53:53 +01:00
Alejandro Colomar
4d139ca466 lib/getdate.y: get_date(): Fix calculation
Instead of adding 1, we should add the value the we stored previously in
the variable.

Fixes: 45c6603cc8 ("[svn-upgrade] Integrating new upstream version, shadow (19990709)")
Closes: <https://github.com/shadow-maint/shadow/issues/939>
Link: <https://github.com/shadow-maint/shadow/pull/942>
Reported-by: Michael Vetter <jubalh@iodoru.org>
Reported-by: Gus Kenion <https://github.com/kenion>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-16 19:58:43 -06:00
Tomas Halman
e15aa5a8a6 src/passwd.c: check password length upper limit
The passwd silently truncated the password length to PASS_MAX.
This patch introduces check that prints an error message
and exits the call.

Signed-off-by: Tomas Halman <tomas@halman.net>
2024-02-16 15:46:08 -06:00
Tomas Halman
dfb4d8fdf9 src/passwd.c: inconsistent password length limit
The passwd utility had hardcoded limit for password lenght set
to 200 characters. In the agetpass.c is used PASS_MAX for
this purpose.

This patch moves the PASS_MAX definition to common place
and uses it in both places.

Signed-off-by: Tomas Halman <tomas@halman.net>
2024-02-16 15:46:08 -06:00
Serge Hallyn
0259f84583 release 4.15.0-rc2
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-02-15 17:54:19 -06:00
NorwayFun
d72d99a810 Update Georgian translation 2024-02-14 15:20:14 -06:00
Alejandro Colomar
f22ca217cd lib/chkname.c: is_valid_user_name(): Avoid a cast
By using a temporary vairable, we can remove a cast.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Tobias Stoeckmann <tobias@stoeckmann.org>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-13 16:13:05 -06:00
Alejandro Colomar
ad307ee42a lib/chkname.c: is_valid_user_name(): Remove unnecessary check
If (maxsize == -1), then ((size_t)maxsize == SIZE_MAX).  And no size can
ever be >= SIZE_MAX, so it will never return false if sysconf(3) reports
an unlimited user-name size via returning -1.  Well, to be pedantic,
that disallows a user-name siz of precisely SIZE_MAX bytes when
sysconf(3) returns -1.  However, that's probably a good thing; such a
long user name might trigger Undefined Behavior somewhere else, so be
cautious and disallow it.  I hope nobody will be using the entire
address space for a user name.

The commit that introduced that check missed that this code had always
supported unlimited user-name sizes since it was introduced by Iker in
3b7cc05387 ("lib: replace `USER_NAME_MAX_LENGTH` macro"), and
6be85b0baf ("lib/chkname.c: Use tmp variable to avoid a -Wsign-compare
warning") even clarified this in the commit message.

So, while the code in 6a1f45d932 ("lib/chkname.c: Support unlimited
user name lengths") wasn't bad per se, the commit message was incorrect.
What that patch did was adding code for handling EINVAL (or any other
errors that a future kernel might add).

To be more pedantically correct, that commit also allowed (under certain
circumstances, user names of SIZE_MAX bytes, but those were originally
allowed (by accident), and only became disallowed in 403a2e3771
("lib/chkname.c: Take NUL byte into account").  But again, let's
disallow those, just to be cautious.

Link: <https://github.com/shadow-maint/shadow/pull/935>
Link: <https://github.com/shadow-maint/shadow/pull/935#discussion_r1477429492>
See-also: 6be85b0baf ("lib/chkname.c: Use tmp variable to avoid a -Wsign-compare warning")
Fixes: 6a1f45d932 ("lib/chkname.c: Support unlimited user name lengths")
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Tobias Stoeckmann <tobias@stoeckmann.org>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-13 16:13:05 -06:00
Alejandro Colomar
15882a5f90 src/login.c: Fix off-by-one bugss
These functions expect a size, not a length.  Don't subtract 1 to the
size.

Link: <https://github.com/shadow-maint/shadow/pull/935>
Link: <https://github.com/shadow-maint/shadow/issues/920#issuecomment-1926002209>
Link: <https://github.com/shadow-maint/shadow/pull/757>
Link: <https://github.com/shadow-maint/shadow/issues/674>
See-also: 0656a90bfd0d ("src/login.c: Fix off-by-one buggs")
See-also: 403a2e3771 ("lib/chkname.c: Take NUL byte into account")
Fixes: 3b7cc05387 ("lib: replace `USER_NAME_MAX_LENGTH` macro")
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Tobias Stoeckmann <tobias@stoeckmann.org>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-13 16:13:05 -06:00
Alejandro Colomar
51cd6aec02 lib/: Don't say 'len' where 'size' is meant
Fixes: 45c6603cc8 ("[svn-upgrade] Integrating new upstream version, shadow (19990709)")
Fixes: 3b7cc05387 ("lib: replace `USER_NAME_MAX_LENGTH` macro")
Fixes: 6be85b0baf ("lib/chkname.c: Use tmp variable to avoid a -Wsign-compare warning")
See-also: 403a2e3771 ("lib/chkname.c: Take NUL byte into account")
See-also: 6a1f45d932 ("lib/chkname.c: Support unlimited user name lengths")
Fixes: 95ea61009d ("lib/chkname.c: Use precise comment")
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Tobias Stoeckmann <tobias@stoeckmann.org>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-13 16:13:05 -06:00
Alejandro Colomar
6551709e96 src/login.c: Fix off-by-one buggs
Before 3b7cc05387 ("lib: replace `USER_NAME_MAX_LENGTH` macro"), this
code did use a length.  It used a utmp(5) fixed-width buffer, so the
length matches the buffer size (there was no terminating NUL byte).
However, sysconf(_SC_LOGIN_NAME_MAX) returns a buffer size that accounts
for the terminating null byte; see sysconf(3).  Thus, the commit that
introduced the call to sysconf(3), should have taken that detail into
account.

403a2e3771 ("lib/chkname.c: Take NUL byte into account"), by Tobias,
caught that bug in <lib/chkname.c>, but missed that the same commit that
introduced that bug, introduced the same bug in two other places.
This fixes all remaining calls to sysconf(_SC_LOGIN_NAME_MAX).

I still observe some suspicious code after this fix:

	if (do_rlogin(hostname, username, max_size - 1, term, sizeof(term)))

	...

	login_prompt(username, max_size - 1);

We're passing size-1 to functions that want a size.  But since the fix
to those will be different, let's do that in the following commits.

Link: <https://github.com/shadow-maint/shadow/pull/935>
Link: <https://github.com/shadow-maint/shadow/issues/920#issuecomment-1926002209>
Link: <https://github.com/shadow-maint/shadow/pull/757>
Link: <https://github.com/shadow-maint/shadow/issues/674>
See-also: 403a2e3771 ("lib/chkname.c: Take NUL byte into account")
Fixes: 3b7cc05387 ("lib: replace `USER_NAME_MAX_LENGTH` macro")
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Tobias Stoeckmann <tobias@stoeckmann.org>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-13 16:13:05 -06:00
Tycho Andersen
714b6a53d5 usermod: refuse invalid uidmaps during --add-sub{u,g}ids
It is slightly confusing to allow adding these only to later refuse them.

Here is a (lightly tested :) patch to also refuse them when adding.

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2024-02-13 16:06:23 -06:00
Alejandro Colomar
1175932c0c lib/strtoday.c: strtoday(): Fix calculation
Days officially roll over at 00:00 UTC, not at 12:00 UTC.  I see no
reason to add that half day.

Also, remove the comment.  It's likely to get stale.

So, get_date() gets the number of seconds since the Epoch.  I wonder how
that thing works, but I'll assume it's something similar to getdate(3)
+ mktime(3).  After that, we need to convert seconds since Epoch to days
since Epoch.  That should be a simple division, AFAICS, since Epoch is
"1970‐01‐01 00:00:00 +0000 (UTC)".  See mktime(3).

Fixes: 45c6603cc8 ("[svn-upgrade] Integrating new upstream version, shadow (19990709)")
Link: <https://github.com/shadow-maint/shadow/issues/939>
Reported-by: Michael Vetter <jubalh@iodoru.org>
Tested-by: Gus Kenion <https://github.com/kenion>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-13 16:05:12 -06:00
Tobias Stoeckmann
674409e226 lib/: Saturate addition to avoid overflow
Very large values in /etc/shadow could lead to overflows.  Make sure
that these calculations are saturated at LONG_MAX.  Since entries are
based on days and not seconds since epoch, saturating won't hurt anyone.

Co-developed-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Co-developed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-13 16:02:49 -06:00
Tobias Stoeckmann
20100e4b22 src/chage.c: Unify long overflow checks in print_day_as_date()
The conversion from day to seconds can be done in print_date
(renamed to print_day_as_date for clarification).  This has the nice
benefit that DAY multiplication and long to time_t conversion are done
at just one place.

Co-developed-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Co-developed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-13 16:02:49 -06:00
Alejandro Colomar
7eb10e6298 etc/pam.d/Makefile.am: Fix typo
The commit we're fixing mentions that it wanted to move 'chpasswd', but
it removed 'ch_g_passwd' from 'pamd_acct_tools_files' and added
'chpasswd' to 'pamd_files'.  It seems it removed the wrong thing by
accident.

Fixes: 341d80c2c7 ("Makefile: move chpasswd and newusers to pamd target")
Link: <https://github.com/shadow-maint/shadow/pull/928#discussion_r1487687347>
Link: <https://github.com/shadow-maint/shadow/issues/926#issuecomment-1941324761>
Reported-by: Dominique Leuenberger <dleuenberger@suse.com>
Reported-by: Michael Vetter <jubalh@iodoru.org>
Cc: David Runge <dvzrv@archlinux.org>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Tested-by: Michael Vetter <jubalh@iodoru.org>
Reviewed-by: Michael Vetter <jubalh@iodoru.org>
Reviewed-by: loqs <https://github.com/loqs>
Co-developed-by: Dominique Leuenberger <dleuenberger@suse.com>
Signed-off-by: Dominique Leuenberger <dleuenberger@suse.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-13 18:45:04 +01:00
Alejandro Colomar
3e59e9613e AUTHORS.md: Format list
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-06 16:16:32 +01:00
Tobias Stoeckmann
95ea61009d lib/chkname.c: Use precise comment
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-02-04 17:03:12 -06:00
Tobias Stoeckmann
6a1f45d932 lib/chkname.c: Support unlimited user name lengths
If the system does not have a user name length limit, support it
accordingly. If the system has no _SC_LOGIN_NAME_MAX, use
LOGIN_NAME_MAX constant instead.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-02-04 17:03:12 -06:00
Tobias Stoeckmann
403a2e3771 lib/chkname.c: Take NUL byte into account
The _SC_LOGIN_NAME_MAX value includes space for the NUL byte. The length
of name must smaller than this value to be valid.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-02-04 17:03:12 -06:00
60 changed files with 852 additions and 729 deletions

View File

@@ -49,8 +49,9 @@ jobs:
run: |
set -e
cd tests
trap 'cat testsuite.log' ERR
sudo ./run_some
cat testsuite.log
trap - ERR
# Make sure that 'make dist' makes a usable tarball with no missing files
dist-build:

View File

@@ -13,10 +13,10 @@ a lot of mail...
To verify signatures on releases, use the following keys under keys/ :
Serge Hallyn: keys/66D0387DB85D320F8408166DB175CFA98F192AF2.asc
Christian Brauner: keys/4880B8C9BD0E5106FC070F4F7B3C391EFEA93624.asc
Iker Pedrosa: keys/4E80EF49C7987B6DE2F81F5005079C6C3A653E57.asc
Alejandro Colomar: keys/A9348594CE31283A826FBDD8D57633D441E25BB5.asc
* Serge Hallyn: keys/66D0387DB85D320F8408166DB175CFA98F192AF2.asc
* Christian Brauner: keys/4880B8C9BD0E5106FC070F4F7B3C391EFEA93624.asc
* Iker Pedrosa: keys/4E80EF49C7987B6DE2F81F5005079C6C3A653E57.asc
* Alejandro Colomar: keys/A9348594CE31283A826FBDD8D57633D441E25BB5.asc
# Authors and contributors
* Adam Rudnicki <adam@v-lo.krakow.pl>

View File

@@ -4,7 +4,7 @@ m4_define([libsubid_abi_major], 4)
m4_define([libsubid_abi_minor], 0)
m4_define([libsubid_abi_micro], 0)
m4_define([libsubid_abi], [libsubid_abi_major.libsubid_abi_minor.libsubid_abi_micro])
AC_INIT([shadow], [4.15.0-rc1], [pkg-shadow-devel@lists.alioth.debian.org], [],
AC_INIT([shadow], [4.15.0], [pkg-shadow-devel@lists.alioth.debian.org], [],
[https://github.com/shadow-maint/shadow])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz subdir-objects])
AC_CONFIG_MACRO_DIRS([m4])
@@ -49,7 +49,7 @@ AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
AC_CHECK_FUNCS(arc4random_buf futimes \
getentropy getrandom getspnam getusershell \
initgroups lckpwdf lutimes \
setgroups updwtmp updwtmpx innetgr \
setgroups updwtmpx innetgr \
getspnam_r \
rpmatch \
memset_explicit explicit_bzero stpecpy stpeprintf)
@@ -57,17 +57,13 @@ AC_SYS_LARGEFILE
dnl Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_MEMBERS([struct utmp.ut_type,
struct utmp.ut_id,
struct utmp.ut_name,
struct utmp.ut_user,
struct utmp.ut_host,
struct utmp.ut_syslen,
struct utmp.ut_addr,
struct utmp.ut_addr_v6,
struct utmp.ut_time,
struct utmp.ut_xtime,
struct utmp.ut_tv],,,[[#include <utmp.h>]])
AC_CHECK_MEMBERS([struct utmpx.ut_name,
struct utmpx.ut_host,
struct utmpx.ut_syslen,
struct utmpx.ut_addr,
struct utmpx.ut_addr_v6,
struct utmpx.ut_time,
struct utmpx.ut_xtime],,,[[#include <utmpx.h>]])
dnl Checks for library functions.
AC_TYPE_GETGROUPS

View File

@@ -12,7 +12,7 @@ pamd_files = \
pamd_acct_tools_files = \
chage \
chpasswd \
chgpasswd \
groupadd \
groupdel \
groupmod \

View File

@@ -13,12 +13,15 @@
#include <stdio.h>
#include <time.h>
#include <errno.h>
#include "prototypes.h"
#include "defines.h"
#include "exitcodes.h"
#include <pwd.h>
#include <grp.h>
#include "adds.h"
#include "defines.h"
#include "exitcodes.h"
#include "prototypes.h"
#ident "$Id$"
#ifndef PASSWD_PROGRAM
@@ -162,7 +165,8 @@ void agecheck (/*@null@*/const struct spwd *sp)
return;
}
remain = sp->sp_lstchg + sp->sp_max - now;
remain = addsl(sp->sp_lstchg, sp->sp_max, -now);
if (remain <= sp->sp_warn) {
if (remain > 1) {
(void) printf (_("Your password will expire in %ld days.\n"),

View File

@@ -11,7 +11,6 @@
#include <limits.h>
#include <readpassphrase.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -24,11 +23,6 @@
#endif /* WITH_LIBBSD */
#if !defined(PASS_MAX)
#define PASS_MAX BUFSIZ - 1
#endif
/*
* SYNOPSIS
* [[gnu::malloc(erase_pass)]]

View File

@@ -1,11 +1,9 @@
/*
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* SPDX-FileCopyrightText: 2001 - 2005, Tomasz Kłoczko
* SPDX-FileCopyrightText: 2005 - 2008, Nicolas François
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
// SPDX-FileCopyrightText: 1996-2000, Marek Michałkiewicz
// SPDX-FileCopyrightText: 2001-2005, Tomasz Kłoczko
// SPDX-FileCopyrightText: 2005-2008, Nicolas François
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
// SPDX-License-Identifier: BSD-3-Clause
/*
* is_valid_user_name(), is_valid_group_name() - check the new user/group
@@ -20,6 +18,8 @@
#ident "$Id$"
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include "defines.h"
#include "chkname.h"
@@ -72,20 +72,28 @@ static bool is_valid_name (const char *name)
return !numeric;
}
bool is_valid_user_name (const char *name)
{
size_t maxlen;
/*
* User names length are limited by the kernel
*/
maxlen = sysconf(_SC_LOGIN_NAME_MAX);
if (strlen(name) > maxlen)
bool
is_valid_user_name(const char *name)
{
long conf;
size_t maxsize;
errno = 0;
conf = sysconf(_SC_LOGIN_NAME_MAX);
if (conf == -1 && errno != 0)
maxsize = LOGIN_NAME_MAX;
else
maxsize = conf;
if (strlen(name) >= maxsize)
return false;
return is_valid_name (name);
return is_valid_name(name);
}
bool is_valid_group_name (const char *name)
{
/*
@@ -99,4 +107,3 @@ bool is_valid_group_name (const char *name)
return is_valid_name (name);
}

View File

@@ -25,6 +25,7 @@
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -202,4 +203,14 @@
# define shadow_getenv(name) getenv(name)
#endif
/*
* Maximum password length
*
* Consider that there is also limit in PAM (PAM_MAX_RESP_SIZE)
* currently set to 512.
*/
#if !defined(PASS_MAX)
#define PASS_MAX BUFSIZ - 1
#endif
#endif /* _DEFINES_H_ */

View File

@@ -319,7 +319,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelYear += $1 * $2;
}
| tYEAR_UNIT {
yyRelYear++;
yyRelYear += $1;
}
| tUNUMBER tMONTH_UNIT {
yyRelMonth += $1 * $2;
@@ -328,7 +328,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelMonth += $1 * $2;
}
| tMONTH_UNIT {
yyRelMonth++;
yyRelMonth += $1;
}
| tUNUMBER tDAY_UNIT {
yyRelDay += $1 * $2;
@@ -337,7 +337,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelDay += $1 * $2;
}
| tDAY_UNIT {
yyRelDay++;
yyRelDay += $1;
}
| tUNUMBER tHOUR_UNIT {
yyRelHour += $1 * $2;
@@ -346,7 +346,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelHour += $1 * $2;
}
| tHOUR_UNIT {
yyRelHour++;
yyRelHour += $1;
}
| tUNUMBER tMINUTE_UNIT {
yyRelMinutes += $1 * $2;
@@ -355,7 +355,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelMinutes += $1 * $2;
}
| tMINUTE_UNIT {
yyRelMinutes++;
yyRelMinutes += $1;
}
| tUNUMBER tSEC_UNIT {
yyRelSeconds += $1 * $2;
@@ -364,7 +364,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelSeconds += $1 * $2;
}
| tSEC_UNIT {
yyRelSeconds++;
yyRelSeconds += $1;
}
;

View File

@@ -15,11 +15,13 @@
#include <config.h>
#include <sys/types.h>
#include "prototypes.h"
#include "defines.h"
#include <pwd.h>
#include <time.h>
#include "adds.h"
#include "defines.h"
#include "prototypes.h"
#ident "$Id$"
@@ -38,7 +40,7 @@
*/
int isexpired (const struct passwd *pw, /*@null@*/const struct spwd *sp)
{
long now;
long now;
now = time(NULL) / DAY;
@@ -72,7 +74,8 @@ int isexpired (const struct passwd *pw, /*@null@*/const struct spwd *sp)
if ( (sp->sp_lstchg > 0)
&& (sp->sp_max >= 0)
&& (sp->sp_inact >= 0)
&& (now >= (sp->sp_lstchg + sp->sp_max + sp->sp_inact))) {
&& (now >= addsl(sp->sp_lstchg, sp->sp_max, sp->sp_inact)))
{
return 2;
}
@@ -94,9 +97,9 @@ int isexpired (const struct passwd *pw, /*@null@*/const struct spwd *sp)
* the password has expired.
*/
if (now >= (sp->sp_lstchg + sp->sp_max)) {
if (now >= addsl(sp->sp_lstchg, sp->sp_max))
return 1;
}
return 0;
}

View File

@@ -28,7 +28,7 @@
*
* A "last login" entry is created for the user being logged in. The
* UID is extracted from the global (struct passwd) entry and the
* TTY information is gotten from the (struct utmp).
* TTY information is gotten from the (struct utmpx).
*/
void dolastlog (
struct lastlog *ll,

View File

@@ -365,8 +365,8 @@ unsigned long csrand_interval (unsigned long min, unsigned long max);
extern int remove_tree (const char *root, bool remove_root);
/* rlogin.c */
extern int do_rlogin (const char *remote_host, char *name, size_t namelen,
char *term, size_t termlen);
extern int do_rlogin(const char *remote_host, char *name, size_t namesize,
char *term, size_t termsize);
/* root_flag.c */
extern void process_root_flag (const char* short_opt, int argc, char **argv);

View File

@@ -41,7 +41,9 @@ static struct {
{ -1, -1}
};
static void get_remote_string (char *buf, size_t size)
static void
get_remote_string(char *buf, size_t size)
{
for (;;) {
if (read (0, buf, 1) != 1) {
@@ -55,11 +57,13 @@ static void get_remote_string (char *buf, size_t size)
++buf;
}
}
/*NOTREACHED*/}
/*NOTREACHED*/
}
int
do_rlogin (const char *remote_host, char *name, size_t namelen, char *term,
size_t termlen)
do_rlogin(const char *remote_host, char *name, size_t namesize, char *term,
size_t termsize)
{
struct passwd *pwd;
char remote_name[32];
@@ -69,9 +73,9 @@ do_rlogin (const char *remote_host, char *name, size_t namelen, char *term,
int i;
TERMIO termio;
get_remote_string (remote_name, sizeof remote_name);
get_remote_string (name, namelen);
get_remote_string (term, termlen);
get_remote_string(remote_name, sizeof(remote_name));
get_remote_string(name, namesize);
get_remote_string(term, termsize);
cp = strchr (term, '/');
if (NULL != cp) {
@@ -126,4 +130,3 @@ do_rlogin (const char *remote_host, char *name, size_t namelen, char *term,
#endif
}
#endif /* RLOGIN */

View File

@@ -15,10 +15,11 @@
#include "must_be.h"
#define WIDTHOF(x) (sizeof(x) * CHAR_BIT)
#define SIZEOF_ARRAY(a) (sizeof(a) + must_be_array(a))
#define NITEMS(a) (SIZEOF_ARRAY((a)) / sizeof((a)[0]))
#define STRLEN(s) (NITEMS(s) - 1)
#define memberof(T, member) ((T){}.member)
#define WIDTHOF(x) (sizeof(x) * CHAR_BIT)
#define SIZEOF_ARRAY(a) (sizeof(a) + must_be_array(a))
#define NITEMS(a) (SIZEOF_ARRAY((a)) / sizeof((a)[0]))
#define STRLEN(s) (NITEMS(s) - 1)
#endif // include guard

View File

@@ -68,10 +68,9 @@ long strtoday (const char *str)
return retdate;
}
t = get_date (str, NULL);
t = get_date(str, NULL);
if ((time_t) - 1 == t) {
return -2;
}
/* convert seconds to days since 1970-01-01 */
return (t + DAY / 2) / DAY;
return t / DAY;
}

View File

@@ -51,13 +51,15 @@ int user_busy (const char *name, uid_t uid)
#endif /* !__linux__ */
}
#ifndef __linux__
static int user_busy_utmp (const char *name)
{
struct utmp *utent;
setutent ();
while ((utent = getutent ()) != NULL)
#ifndef __linux__
static int
user_busy_utmp(const char *name)
{
struct utmpx *utent;
setutxent();
while ((utent = getutxent()) != NULL)
{
if (utent->ut_type != USER_PROCESS) {
continue;
@@ -79,6 +81,7 @@ static int user_busy_utmp (const char *name)
}
#endif /* !__linux__ */
#ifdef __linux__
#ifdef ENABLE_SUBIDS
#define in_parentuid_range(uid) ((uid) >= parentuid && (uid) < parentuid + range)

View File

@@ -13,7 +13,7 @@
#include "prototypes.h"
#include "getdef.h"
#include <utmp.h>
#include <utmpx.h>
#include <assert.h>
#include <sys/param.h>
#include <sys/types.h>
@@ -31,19 +31,23 @@
#ident "$Id$"
#define UTX_LINESIZE NITEMS(memberof(struct utmpx, ut_line))
/*
* is_my_tty -- determine if "tty" is the same TTY stdin is using
*/
static bool is_my_tty (const char tty[UT_LINESIZE])
static bool
is_my_tty(const char tty[UTX_LINESIZE])
{
char full_tty[STRLEN("/dev/") + UT_LINESIZE + 1];
char full_tty[STRLEN("/dev/") + UTX_LINESIZE + 1];
/* tmptty shall be bigger than full_tty */
static char tmptty[sizeof(full_tty) + 1];
full_tty[0] = '\0';
if (tty[0] != '/')
strcpy (full_tty, "/dev/");
strncat (full_tty, tty, UT_LINESIZE);
strncat(full_tty, tty, UTX_LINESIZE);
if ('\0' == tmptty[0]) {
const char *tname = ttyname (STDIN_FILENO);
@@ -59,13 +63,15 @@ static bool is_my_tty (const char tty[UT_LINESIZE])
return strcmp (full_tty, tmptty) == 0;
}
/*
* failtmp - update the cumulative failure log
*
* failtmp updates the (struct utmp) formatted failure log which
* failtmp updates the (struct utmpx) formatted failure log which
* maintains a record of all login failures.
*/
static void failtmp (const char *username, const struct utmp *failent)
static void
failtmp(const char *username, const struct utmpx *failent)
{
const char *ftmp;
int fd;
@@ -121,6 +127,7 @@ err_close:
username, ftmp));
}
/*
* get_current_utmp - return the most probable utmp entry for the current
* session
@@ -129,57 +136,57 @@ err_close:
* The line entered by the *getty / telnetd, etc. should also match
* the current terminal.
*
* When an entry is returned by get_current_utmp, and if the utmp
* When an entry is returned by get_current_utmp, and if the utmpx
* structure has a ut_id field, this field should be used to update
* the entry information.
*
* Return NULL if no entries exist in utmp for the current process.
*/
static
/*@null@*/ /*@only@*/struct utmp *get_current_utmp (void)
static /*@null@*/ /*@only@*/struct utmpx *
get_current_utmp(void)
{
struct utmp *ut;
struct utmp *ret = NULL;
struct utmpx *ut;
struct utmpx *ret = NULL;
setutent ();
setutxent();
/* First, try to find a valid utmp entry for this process. */
while ((ut = getutent ()) != NULL) {
while ((ut = getutxent()) != NULL) {
if ( (ut->ut_pid == getpid ())
#ifdef HAVE_STRUCT_UTMP_UT_ID
&& ('\0' != ut->ut_id[0])
#endif
#ifdef HAVE_STRUCT_UTMP_UT_TYPE
&& ( (LOGIN_PROCESS == ut->ut_type)
|| (USER_PROCESS == ut->ut_type))
#endif
/* A process may have failed to close an entry
* Check if this entry refers to the current tty */
&& is_my_tty (ut->ut_line)) {
&& is_my_tty(ut->ut_line))
{
break;
}
}
if (NULL != ut) {
ret = XMALLOC(1, struct utmp);
ret = XMALLOC(1, struct utmpx);
memcpy (ret, ut, sizeof (*ret));
}
endutent ();
endutxent();
return ret;
}
int get_session_host (char **out)
int
get_session_host(char **out)
{
char *hostname = NULL;
struct utmp *ut = NULL;
int ret = 0;
int ret = 0;
struct utmpx *ut;
ut = get_current_utmp();
#ifdef HAVE_STRUCT_UTMP_UT_HOST
#if defined(HAVE_STRUCT_UTMPX_UT_HOST)
if ((ut != NULL) && (ut->ut_host[0] != '\0')) {
char *hostname;
hostname = XMALLOC(sizeof(ut->ut_host) + 1, char);
ZUSTR2STP(hostname, ut->ut_host);
*out = hostname;
@@ -191,18 +198,19 @@ int get_session_host (char **out)
#else
*out = NULL;
ret = -2;
#endif /* HAVE_STRUCT_UTMP_UT_HOST */
#endif
return ret;
}
#ifndef USE_PAM
#if !defined(USE_PAM) && !defined(HAVE_UPDWTMPX)
/*
* Some systems already have updwtmp() and possibly updwtmpx(). Others
* Some systems already have updwtmpx(). Others
* don't, so we re-implement these functions if necessary.
*/
#ifndef HAVE_UPDWTMP
static void updwtmp (const char *filename, const struct utmp *ut)
static void
updwtmpx(const char *filename, const struct utmpx *ut)
{
int fd;
@@ -212,9 +220,7 @@ static void updwtmp (const char *filename, const struct utmp *ut)
close (fd);
}
}
#endif /* ! HAVE_UPDWTMP */
#endif /* ! USE_PAM */
#endif
/*
@@ -235,15 +241,13 @@ static void updwtmp (const char *filename, const struct utmp *ut)
*
* The returned structure shall be freed by the caller.
*/
static
/*@only@*/struct utmp *prepare_utmp (const char *name,
const char *line,
const char *host,
/*@null@*/const struct utmp *ut)
static /*@only@*/struct utmpx *
prepare_utmp(const char *name, const char *line, const char *host,
/*@null@*/const struct utmpx *ut)
{
struct timeval tv;
char *hostname = NULL;
struct utmp *utent;
char *hostname = NULL;
struct utmpx *utent;
struct timeval tv;
assert (NULL != name);
assert (NULL != line);
@@ -254,12 +258,12 @@ static
&& ('\0' != host[0])) {
hostname = XMALLOC(strlen(host) + 1, char);
strcpy (hostname, host);
#ifdef HAVE_STRUCT_UTMP_UT_HOST
#if defined(HAVE_STRUCT_UTMPX_UT_HOST)
} else if ( (NULL != ut)
&& ('\0' != ut->ut_host[0])) {
hostname = XMALLOC(NITEMS(ut->ut_host) + 1, char);
ZUSTR2STP(hostname, ut->ut_host);
#endif /* HAVE_STRUCT_UTMP_UT_HOST */
#endif
}
if (strncmp(line, "/dev/", 5) == 0) {
@@ -267,38 +271,32 @@ static
}
utent = XCALLOC (1, struct utmp);
utent = XCALLOC(1, struct utmpx);
#ifdef HAVE_STRUCT_UTMP_UT_TYPE
utent->ut_type = USER_PROCESS;
#endif /* HAVE_STRUCT_UTMP_UT_TYPE */
utent->ut_pid = getpid ();
STRNCPY(utent->ut_line, line);
#ifdef HAVE_STRUCT_UTMP_UT_ID
if (NULL != ut) {
STRNCPY(utent->ut_id, ut->ut_id);
} else {
/* XXX - assumes /dev/tty?? */
STRNCPY(utent->ut_id, line + 3);
}
#endif /* HAVE_STRUCT_UTMP_UT_ID */
#ifdef HAVE_STRUCT_UTMP_UT_NAME
#if defined(HAVE_STRUCT_UTMPX_UT_NAME)
STRNCPY(utent->ut_name, name);
#endif /* HAVE_STRUCT_UTMP_UT_NAME */
#ifdef HAVE_STRUCT_UTMP_UT_USER
#endif
STRNCPY(utent->ut_user, name);
#endif /* HAVE_STRUCT_UTMP_UT_USER */
if (NULL != hostname) {
struct addrinfo *info = NULL;
#ifdef HAVE_STRUCT_UTMP_UT_HOST
#if defined(HAVE_STRUCT_UTMPX_UT_HOST)
STRNCPY(utent->ut_host, hostname);
#endif /* HAVE_STRUCT_UTMP_UT_HOST */
#ifdef HAVE_STRUCT_UTMP_UT_SYSLEN
#endif
#if defined(HAVE_STRUCT_UTMPX_UT_SYSLEN)
utent->ut_syslen = MIN (strlen (hostname),
sizeof (utent->ut_host));
#endif /* HAVE_STRUCT_UTMP_UT_SYSLEN */
#if defined(HAVE_STRUCT_UTMP_UT_ADDR) || defined(HAVE_STRUCT_UTMP_UT_ADDR_V6)
#endif
#if defined(HAVE_STRUCT_UTMPX_UT_ADDR) || defined(HAVE_STRUCT_UTMPX_UT_ADDR_V6)
if (getaddrinfo (hostname, NULL, NULL, &info) == 0) {
/* getaddrinfo might not be reliable.
* Just try to log what may be useful.
@@ -306,13 +304,13 @@ static
if (info->ai_family == AF_INET) {
struct sockaddr_in *sa =
(struct sockaddr_in *) info->ai_addr;
#ifdef HAVE_STRUCT_UTMP_UT_ADDR
# if defined(HAVE_STRUCT_UTMPX_UT_ADDR)
memcpy (&(utent->ut_addr),
&(sa->sin_addr),
MIN (sizeof (utent->ut_addr),
sizeof (sa->sin_addr)));
#endif /* HAVE_STRUCT_UTMP_UT_ADDR */
#ifdef HAVE_STRUCT_UTMP_UT_ADDR_V6
# endif
# if defined(HAVE_STRUCT_UTMPX_UT_ADDR_V6)
memcpy (utent->ut_addr_v6,
&(sa->sin_addr),
MIN (sizeof (utent->ut_addr_v6),
@@ -324,61 +322,61 @@ static
&(sa->sin6_addr),
MIN (sizeof (utent->ut_addr_v6),
sizeof (sa->sin6_addr)));
#endif /* HAVE_STRUCT_UTMP_UT_ADDR_V6 */
# endif
}
freeaddrinfo (info);
}
#endif /* HAVE_STRUCT_UTMP_UT_ADDR || HAVE_STRUCT_UTMP_UT_ADDR_V6 */
#endif
free (hostname);
}
/* ut_exit is only for DEAD_PROCESS */
utent->ut_session = getsid (0);
if (gettimeofday (&tv, NULL) == 0) {
#ifdef HAVE_STRUCT_UTMP_UT_TIME
#if defined(HAVE_STRUCT_UTMPX_UT_TIME)
utent->ut_time = tv.tv_sec;
#endif /* HAVE_STRUCT_UTMP_UT_TIME */
#ifdef HAVE_STRUCT_UTMP_UT_XTIME
#endif
#if defined(HAVE_STRUCT_UTMPX_UT_XTIME)
utent->ut_xtime = tv.tv_usec;
#endif /* HAVE_STRUCT_UTMP_UT_XTIME */
#ifdef HAVE_STRUCT_UTMP_UT_TV
#endif
utent->ut_tv.tv_sec = tv.tv_sec;
utent->ut_tv.tv_usec = tv.tv_usec;
#endif /* HAVE_STRUCT_UTMP_UT_TV */
}
return utent;
}
/*
* setutmp - Update an entry in utmp and log an entry in wtmp
*
* Return 1 on failure and 0 on success.
*/
static int setutmp (struct utmp *ut)
static int
setutmp(struct utmpx *ut)
{
int err = 0;
assert (NULL != ut);
setutent ();
if (pututline (ut) == NULL) {
setutxent();
if (pututxline(ut) == NULL) {
err = 1;
}
endutent ();
endutxent();
#ifndef USE_PAM
#if !defined(USE_PAM)
/* This is done by pam_lastlog */
updwtmp (_WTMP_FILE, ut);
#endif /* ! USE_PAM */
updwtmpx(_WTMP_FILE, ut);
#endif
return err;
}
int update_utmp (const char *user,
const char *tty,
const char *host)
int
update_utmp(const char *user, const char *tty, const char *host)
{
struct utmp *utent, *ut;
struct utmpx *utent, *ut;
utent = get_current_utmp ();
ut = prepare_utmp (user, tty, host, utent);
@@ -391,11 +389,11 @@ int update_utmp (const char *user,
return 0;
}
void record_failure(const char *failent_user,
const char *tty,
const char *hostname)
void
record_failure(const char *failent_user, const char *tty, const char *hostname)
{
struct utmp *utent, *failent;
struct utmpx *utent, *failent;
if (getdef_str ("FTMP_FILE") != NULL) {
utent = get_current_utmp ();
@@ -406,13 +404,15 @@ void record_failure(const char *failent_user,
}
}
unsigned long active_sessions_count(const char *name, unsigned long limit)
{
struct utmp *ut;
unsigned long count = 0;
setutent ();
while ((ut = getutent ()))
unsigned long
active_sessions_count(const char *name, unsigned long limit)
{
struct utmpx *ut;
unsigned long count = 0;
setutxent();
while ((ut = getutxent()))
{
if (USER_PROCESS != ut->ut_type) {
continue;
@@ -428,7 +428,7 @@ unsigned long active_sessions_count(const char *name, unsigned long limit)
break;
}
}
endutent ();
endutxent();
return count;
}

689
po/ka.po
View File

@@ -1,14 +1,14 @@
# Shadow-utils translation to Georgian.
# Copyright (C) YEAR Free Software Foundation, Inc.
# Copyright (C) 2024 Free Software Foundation, Inc.
# This file is distributed under the same license as the shadow-utils package.
# Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2022.
# Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2022-2024.
#
msgid ""
msgstr ""
"Project-Id-Version: shadow-utils\n"
"Report-Msgid-Bugs-To: pkg-shadow-devel@lists.alioth.debian.org\n"
"POT-Creation-Date: 2022-07-27 22:49+0800\n"
"PO-Revision-Date: 2022-08-22 02:33+0200\n"
"POT-Creation-Date: 2024-02-08 05:49+0100\n"
"PO-Revision-Date: 2024-02-08 06:13+0100\n"
"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>\n"
"Language-Team: Georgian <(nothing)>\n"
"Language: ka\n"
@@ -16,226 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.1.1\n"
#, c-format
msgid ""
"Multiple entries named '%s' in %s. Please fix this with pwck or grpck.\n"
msgstr "%s ბევრჯერაა ნახსენები %s-ში. ჩაასწორეთ pwck-ით ან grpck-ით.\n"
#, c-format
msgid "crypt method not supported by libcrypt? (%s)\n"
msgstr "crypt-ის მეთოდი არაა მხარდაჭერილი libcrypt-ის მიერ? (%s)\n"
#, c-format
msgid "configuration error - cannot parse %s value: '%s'"
msgstr ""
"კონფიგურაციის შეცდომა - %s-ის მნიშვნელობის დამუშავება შეუძლებელია: '%s'"
msgid "Could not allocate space for config info.\n"
msgstr "კონფიგურაციის ინფორმაციისთვის სივრცის გამოყოფა შეუძლებელია.\n"
#, c-format
msgid "configuration error - unknown item '%s' (notify administrator)\n"
msgstr ""
"კონფიგურაციის შეცდომა - უცნობი ჩანაწერი '%s' (შეატყობინეთ ადმინისტრატორს)\n"
#, c-format
msgid "%s: nscd did not terminate normally (signal %d)\n"
msgstr "%s: nscd ნორმალურად არ დასრულებულა (სიგნალი %d)\n"
#, c-format
msgid "%s: nscd exited with status %d\n"
msgstr "%s: nscd გამოვიდა სტატუსით %d\n"
msgid "Password: "
msgstr "პაროლი: "
#, c-format
msgid "%s's Password: "
msgstr "%s-ის პაროლი: "
msgid "Cannot open audit interface.\n"
msgstr "აუდიტის ინტერფეისის გახსნის შეცდომა.\n"
#, c-format
msgid "%s: can not get previous SELinux process context: %s\n"
msgstr "%s: SELinux-ის პროცესის წინა კონტექსტის მიღების შეცდომა: %s\n"
#, c-format
msgid "[libsemanage]: %s\n"
msgstr "[libsemanage]: %s\n"
#, c-format
msgid "Cannot create SELinux management handle\n"
msgstr "SELinux-ის მართვის დამმუშავებლის შექმნა შეუძლებელია\n"
#, c-format
msgid "SELinux policy not managed\n"
msgstr "SELinux-ის პოლიტიკა მართული არაა\n"
#, c-format
msgid "Cannot read SELinux policy store\n"
msgstr "SELinux-ის პოლიტიკის საცავის წაკითხვა შეუძლებელია\n"
#, c-format
msgid "Cannot establish SELinux management connection\n"
msgstr "SELinux-ის მართვის შეერთების შექმნა შეუძლებელია\n"
#, c-format
msgid "Cannot begin SELinux transaction\n"
msgstr "SELinux-ის ტრანზაქციის დაწყების შეცდომა\n"
#, c-format
msgid "Could not query seuser for %s\n"
msgstr "%s-ის გამოთხოვა seuser-დან შეუძლებელია\n"
#, c-format
msgid "Could not set serange for %s\n"
msgstr "%s-სთვის serange-ის დაყენება შეუძლებელია\n"
#, c-format
msgid "Could not set sename for %s\n"
msgstr "%s-სთვის sename-ის დაყენება შეუძლებელია\n"
#, c-format
msgid "Could not modify login mapping for %s\n"
msgstr "მომხმარებლის სახელის ბმების ჩასწორება %s-სთვის შეუძლებელია\n"
#, c-format
msgid "Cannot create SELinux login mapping for %s\n"
msgstr "%s-ზე SELinux-ის მომხმარებლის სახელის ბმის შექმნა შეუძლებელია\n"
#, c-format
msgid "Could not set name for %s\n"
msgstr "%s-სთვის სახელის დაყენების შეცდომა\n"
#, c-format
msgid "Could not set SELinux user for %s\n"
msgstr "%s-სთვის SELinux-ის მომხმარებლის დაყენების შეცდომა\n"
#, c-format
msgid "Could not add login mapping for %s\n"
msgstr "%s-სთვის მომხმარებლის სახელის ბმის შექმნის შეცდომა\n"
#, c-format
msgid "Cannot init SELinux management\n"
msgstr "SELinux-ის მართვის ინიციალიზაციის შეცდომა\n"
#, c-format
msgid "Cannot create SELinux user key\n"
msgstr "SELinux-ის მომხმარებლის გასაღების შექმნის შეცდომა\n"
#, c-format
msgid "Cannot verify the SELinux user\n"
msgstr "SELinux-ის მომხმარებლის შემოწმების შეცდომა\n"
#, c-format
msgid "Cannot modify SELinux user mapping\n"
msgstr "SELinux-ის მოხმარებლების ბმების შეცვლს შეცდომა\n"
#, c-format
msgid "Cannot add SELinux user mapping\n"
msgstr "SELinux-ის მომხმარებლის ბმის დამატების შეცდომა\n"
#, c-format
msgid "Cannot commit SELinux transaction\n"
msgstr "SELinux-ის ტრანზაქციის გადაცემის შეცდომა\n"
#, c-format
msgid "Login mapping for %s is not defined, OK if default mapping was used\n"
msgstr ""
"მომხმარებლის სახელის ბმა %s-თვის განსაზღვრული არაა. OK, თუ ნაგულისხმები ბმა "
"იქნა გამოყენებული\n"
#, c-format
msgid "Login mapping for %s is defined in policy, cannot be deleted\n"
msgstr "მომხმარებლის სახელი %s პოლიტიკაშია გაწერილი. მისი წაშლა შეუძლებელია\n"
#, c-format
msgid "Could not delete login mapping for %s"
msgstr "მომხმარებლის სახელის ბმის წაშლა %s-სთვის შეუძლებელია"
#, c-format
msgid "%s: out of memory\n"
msgstr "%s: არასაკმარისი მეხსიერება\n"
#, c-format
msgid "%s: Cannot stat %s: %s\n"
msgstr "%s: %s-ის აღმოჩენის შეცდომა: %s\n"
#, c-format
msgid "%s: %s is neither a directory, nor a symlink.\n"
msgstr "%s: %s არც საქაღალდეა, არც სიმბმული.\n"
#, c-format
msgid "%s: Cannot read symbolic link %s: %s\n"
msgstr "%s: სიმბმულის წაკითხვის შეცდომა %s: %s\n"
#, c-format
msgid "%s: Suspiciously long symlink: %s\n"
msgstr "%s: საეჭვოდ გრძელი სიმბმული %s\n"
#, c-format
msgid "%s: Cannot create directory %s: %s\n"
msgstr "%s საქაღალდის (%s) შექმნის შეცდომა: %s\n"
#, c-format
msgid "%s: Cannot change owner of %s: %s\n"
msgstr "%s: %s-ის მფლობელის შეცვლის შეცდომა: %s\n"
#, c-format
msgid "%s: Cannot change mode of %s: %s\n"
msgstr "%s: %s-ის რეჟიმის შეცვლის შეცდომა: %s\n"
#, c-format
msgid "%s: unlink: %s: %s\n"
msgstr "%s: წაშლა: %s: %s\n"
#, c-format
msgid "%s: Cannot remove directory %s: %s\n"
msgstr "%s: საქაღალდის (%s) წაშლის შეცდომა: %s\n"
#, c-format
msgid "%s: Cannot rename %s to %s: %s\n"
msgstr "%s: %s-ის სახელის %s-მდე გადარქმევა შეუძლებელია: %s\n"
#, c-format
msgid "%s: Cannot remove %s: %s\n"
msgstr "%s: %s-ის წაშლა შეუძლებელია: %s\n"
#, c-format
msgid "%s: Cannot create symbolic link %s: %s\n"
msgstr "%s: სიმბმულის (%s) შექმნის შეცდომა: %s\n"
#, c-format
msgid "%s: Cannot change owners of %s: %s\n"
msgstr "%s: %s-ის მფლობელების შეცვლის შეცდომა: %s\n"
#, c-format
msgid "%s: Cannot lstat %s: %s\n"
msgstr "%s: %s-ის lstat-ის შეცდომა: %s\n"
#, c-format
msgid "%s: Warning, user %s has no tcb shadow file.\n"
msgstr "%s: გაფრთხილება: მომხმარებელს (%s) tcb shadow ფაილი არ გააჩნია.\n"
#, c-format
msgid ""
"%s: Emergency: %s's tcb shadow is not a regular file with st_nlink=1.\n"
"The account is left locked.\n"
msgstr ""
"%s: გადაუდებელი შემთხვევა: %s tcb ჩრდილი არ არის რეგულარული ფაილი st_nlink=1-"
"ით.\n"
"ანგარიში ჩაკეტილია.\n"
#, c-format
msgid "%s: mkdir: %s: %s\n"
msgstr "%s: mkdir: %s: %s\n"
#, c-format
msgid "%s: Cannot open %s: %s\n"
msgstr "%s: %s-ის გახსნის შეცდომა: %s\n"
"X-Generator: Poedit 3.3.2\n"
#, c-format
msgid "Warning: unknown group %s\n"
@@ -283,6 +64,11 @@ msgstr "TTY-იდან stdin-ის მფლობელისა და რ
msgid "%s: failed to unlock %s\n"
msgstr "%s: %s-ის განბლოკვის შეცდომა\n"
#, c-format
msgid ""
"Multiple entries named '%s' in %s. Please fix this with pwck or grpck.\n"
msgstr "%s ბევრჯერაა ნახსენები %s-ში. ჩაასწორეთ pwck-ით ან grpck-ით.\n"
#, c-format
msgid "%s: "
msgstr "%s: "
@@ -290,6 +76,10 @@ msgstr "%s: "
msgid ": "
msgstr ": "
#, c-format
msgid "crypt method not supported by libcrypt? (%s)\n"
msgstr "crypt-ის მეთოდი არაა მხარდაჭერილი libcrypt-ის მიერ? (%s)\n"
msgid "Environment overflow\n"
msgstr "გარემო გადავსებულია\n"
@@ -405,6 +195,19 @@ msgstr ""
msgid "%s: Can't get unique UID (no more available UIDs)\n"
msgstr "%s: უნიკალური UID-ის მიღების შეცდომა (ხელმისაწვდომი UID-ების გარეშე)\n"
#, c-format
msgid "configuration error - cannot parse %s value: '%s'"
msgstr ""
"კონფიგურაციის შეცდომა - %s-ის მნიშვნელობის დამუშავება შეუძლებელია: '%s'"
msgid "Could not allocate space for config info.\n"
msgstr "კონფიგურაციის ინფორმაციისთვის სივრცის გამოყოფა შეუძლებელია.\n"
#, c-format
msgid "configuration error - unknown item '%s' (notify administrator)\n"
msgstr ""
"კონფიგურაციის შეცდომა - უცნობი ჩანაწერი '%s' (შეატყობინეთ ადმინისტრატორს)\n"
#, c-format
msgid "%s: Not enough arguments to form %u mappings\n"
msgstr "%s: არასაკმარისი არგუმენტები %u ბმის ჩამოსაყალიბებლად\n"
@@ -434,8 +237,9 @@ msgid "%s: Could not set caps\n"
msgstr "%s: caps-ების დაყენების შედომა\n"
#, c-format
msgid "%s: snprintf failed!\n"
msgstr "%s: snprintf -ის შეცდომა!\n"
#| msgid "%s: snprintf failed!\n"
msgid "%s: stpeprintf failed!\n"
msgstr "%s: stpeprintf ჩავარდა!\n"
#, c-format
msgid "%s: open of %s failed: %s\n"
@@ -445,9 +249,21 @@ msgstr "%s: %s -ის გახსნის შეცდომა: %s\n"
msgid "%s: write to %s failed: %s\n"
msgstr "%s: %s-ში ჩაწერის შეცდომა: %s\n"
#, c-format
msgid "%s: closing %s failed: %s\n"
msgstr "%s: %s-ის დახურვა ჩავარდა: %s\n"
msgid "Too many logins.\n"
msgstr "მეტისმეტად ბევრი შესვლა.\n"
#, c-format
msgid ""
"\n"
"%s login: "
msgstr ""
"\n"
"%s მომხმარებლის სახელი: "
msgid "You have new mail."
msgstr "თქვენთვის წერილია."
@@ -457,6 +273,14 @@ msgstr "ახალი ელფოსტის გარეშე."
msgid "You have mail."
msgstr "თქვენ გაქვთ ფოსტა."
#, c-format
msgid "%s: nscd did not terminate normally (signal %d)\n"
msgstr "%s: nscd ნორმალურად არ დასრულებულა (სიგნალი %d)\n"
#, c-format
msgid "%s: nscd exited with status %d\n"
msgstr "%s: nscd გამოვიდა სტატუსით %d\n"
msgid "no change"
msgstr "ცვლილებების გარეშე"
@@ -469,9 +293,6 @@ msgstr "მხოლოდ სიმბოლოების ზომა"
msgid "too similar"
msgstr "ძალიან ჰგავს"
msgid "too simple"
msgstr "ძალიან მარტივია"
msgid "rotated"
msgstr "შემობრუნებული"
@@ -517,6 +338,13 @@ msgstr ""
"%s: (მომხმარებელი %s) pam_chauthtok() -ის შეცდომა:\n"
"%s\n"
msgid "Password: "
msgstr "პაროლი: "
#, c-format
msgid "%s's Password: "
msgstr "%s-ის პაროლი: "
#, c-format
msgid "Incorrect password for %s.\n"
msgstr "არასწორი პაროლი %s-სთვის.\n"
@@ -542,17 +370,13 @@ msgstr ""
msgid "%s: cannot access chroot directory %s: %s\n"
msgstr "%s: chroot საქაღალდის (%s) წვდომის შეცდომა: %s\n"
#, c-format
msgid "%s: cannot chdir to chroot directory %s: %s\n"
msgstr "%s: chroot საქაღალდეზე (%s) chdir-ის შეცდომა: %s\n"
#, c-format
msgid "%s: unable to chroot to directory %s: %s\n"
msgstr "%s: საქაღალდეზე (%s) chroot-ი შეუძლებელია: %s\n"
#, c-format
msgid "Unable to obtain random bytes.\n"
msgstr "შემთხვევითი ბაიტების მიღების შეცდომა.\n"
msgid "%s: cannot chdir in chroot directory %s: %s\n"
msgstr "%s: chroot საქაღალდეში (%s) chdir-ის შეცდომა: %s\n"
#, c-format
msgid ""
@@ -572,6 +396,107 @@ msgstr ""
"პარამეტრები ENCRYPT_METHOD-ში და შესაბამის კონფიგურაციაში თქვენს მიერ "
"არჩეული ჰეშის მეთოდისთვის.\n"
msgid "Cannot open audit interface.\n"
msgstr "აუდიტის ინტერფეისის გახსნის შეცდომა.\n"
#, c-format
msgid "%s: can not get previous SELinux process context: %s\n"
msgstr "%s: SELinux-ის პროცესის წინა კონტექსტის მიღების შეცდომა: %s\n"
#, c-format
msgid "[libsemanage]: %s\n"
msgstr "[libsemanage]: %s\n"
#, c-format
msgid "Cannot create SELinux management handle\n"
msgstr "SELinux-ის მართვის დამმუშავებლის შექმნა შეუძლებელია\n"
#, c-format
msgid "SELinux policy not managed\n"
msgstr "SELinux-ის პოლიტიკა მართული არაა\n"
#, c-format
msgid "Cannot read SELinux policy store\n"
msgstr "SELinux-ის პოლიტიკის საცავის წაკითხვა შეუძლებელია\n"
#, c-format
msgid "Cannot establish SELinux management connection\n"
msgstr "SELinux-ის მართვის შეერთების შექმნა შეუძლებელია\n"
#, c-format
msgid "Cannot begin SELinux transaction\n"
msgstr "SELinux-ის ტრანზაქციის დაწყების შეცდომა\n"
#, c-format
msgid "Could not query seuser for %s\n"
msgstr "%s-ის გამოთხოვა seuser-დან შეუძლებელია\n"
#, c-format
msgid "Could not set serange for %s to %s\n"
msgstr "%s-სთვის serange-ის %s-ზე დაყენება შეუძლებელია\n"
#, c-format
msgid "Could not set sename for %s\n"
msgstr "%s-სთვის sename-ის დაყენება შეუძლებელია\n"
#, c-format
msgid "Could not modify login mapping for %s\n"
msgstr "მომხმარებლის სახელის ბმების ჩასწორება %s-სთვის შეუძლებელია\n"
#, c-format
msgid "Cannot create SELinux login mapping for %s\n"
msgstr "%s-ზე SELinux-ის მომხმარებლის სახელის ბმის შექმნა შეუძლებელია\n"
#, c-format
msgid "Could not set name for %s\n"
msgstr "%s-სთვის სახელის დაყენების შეცდომა\n"
#, c-format
msgid "Could not set SELinux user for %s\n"
msgstr "%s-სთვის SELinux-ის მომხმარებლის დაყენების შეცდომა\n"
#, c-format
msgid "Could not add login mapping for %s\n"
msgstr "%s-სთვის მომხმარებლის სახელის ბმის შექმნის შეცდომა\n"
#, c-format
msgid "Cannot init SELinux management\n"
msgstr "SELinux-ის მართვის ინიციალიზაციის შეცდომა\n"
#, c-format
msgid "Cannot create SELinux user key\n"
msgstr "SELinux-ის მომხმარებლის გასაღების შექმნის შეცდომა\n"
#, c-format
msgid "Cannot verify the SELinux user\n"
msgstr "SELinux-ის მომხმარებლის შემოწმების შეცდომა\n"
#, c-format
msgid "Cannot modify SELinux user mapping\n"
msgstr "SELinux-ის მოხმარებლების ბმების შეცვლს შეცდომა\n"
#, c-format
msgid "Cannot add SELinux user mapping\n"
msgstr "SELinux-ის მომხმარებლის ბმის დამატების შეცდომა\n"
#, c-format
msgid "Cannot commit SELinux transaction\n"
msgstr "SELinux-ის ტრანზაქციის გადაცემის შეცდომა\n"
#, c-format
msgid "Login mapping for %s is not defined, OK if default mapping was used\n"
msgstr ""
"მომხმარებლის სახელის ბმა %s-თვის განსაზღვრული არაა. OK, თუ ნაგულისხმები ბმა "
"იქნა გამოყენებული\n"
#, c-format
msgid "Login mapping for %s is defined in policy, cannot be deleted\n"
msgstr "მომხმარებლის სახელი %s პოლიტიკაშია გაწერილი. მისი წაშლა შეუძლებელია\n"
#, c-format
msgid "Could not delete login mapping for %s"
msgstr "მომხმარებლის სახელის ბმის წაშლა %s-სთვის შეუძლებელია"
#, c-format
msgid "Unable to cd to '%s'\n"
msgstr "საქაღალდის %s-ზე შეცვლა შეუძლებელია\n"
@@ -583,6 +508,10 @@ msgstr "საქაღალდე არ არსებობს. შევ
msgid "Cannot execute %s"
msgstr "%s-ის შესრულების შეცდომა"
#, c-format
msgid "Maximum subsystem depth reached\n"
msgstr "მიღწეულია ქვესისტემის მაქსიმალური სიღრმე\n"
#, c-format
msgid "Invalid root directory '%s'\n"
msgstr "%s არასწორი root საქაღალდეა\n"
@@ -591,6 +520,87 @@ msgstr "%s არასწორი root საქაღალდეა\n"
msgid "Can't change root directory to '%s'\n"
msgstr "Root საქაღალდის %s-ზე შეცვლა შეუძლებელია\n"
#, c-format
msgid "%s: out of memory\n"
msgstr "%s: არასაკმარისი მეხსიერება\n"
#, c-format
msgid "%s: Cannot stat %s: %s\n"
msgstr "%s: %s-ის აღმოჩენის შეცდომა: %s\n"
#, c-format
msgid "%s: %s is neither a directory, nor a symlink.\n"
msgstr "%s: %s არც საქაღალდეა, არც სიმბმული.\n"
#, c-format
msgid "%s: Cannot read symbolic link %s: %s\n"
msgstr "%s: სიმბმულის წაკითხვის შეცდომა %s: %s\n"
#, c-format
msgid "%s: Suspiciously long symlink: %s\n"
msgstr "%s: საეჭვოდ გრძელი სიმბმული %s\n"
#, c-format
msgid "%s: Cannot create directory %s: %s\n"
msgstr "%s საქაღალდის (%s) შექმნის შეცდომა: %s\n"
#, c-format
msgid "%s: Cannot change owner of %s: %s\n"
msgstr "%s: %s-ის მფლობელის შეცვლის შეცდომა: %s\n"
#, c-format
msgid "%s: Cannot change mode of %s: %s\n"
msgstr "%s: %s-ის რეჟიმის შეცვლის შეცდომა: %s\n"
#, c-format
msgid "%s: unlink: %s: %s\n"
msgstr "%s: წაშლა: %s: %s\n"
#, c-format
msgid "%s: Cannot remove directory %s: %s\n"
msgstr "%s: საქაღალდის (%s) წაშლის შეცდომა: %s\n"
#, c-format
msgid "%s: Cannot rename %s to %s: %s\n"
msgstr "%s: %s-ის სახელის %s-მდე გადარქმევა შეუძლებელია: %s\n"
#, c-format
msgid "%s: Cannot remove %s: %s\n"
msgstr "%s: %s-ის წაშლა შეუძლებელია: %s\n"
#, c-format
msgid "%s: Cannot create symbolic link %s: %s\n"
msgstr "%s: სიმბმულის (%s) შექმნის შეცდომა: %s\n"
#, c-format
msgid "%s: Cannot change owners of %s: %s\n"
msgstr "%s: %s-ის მფლობელების შეცვლის შეცდომა: %s\n"
#, c-format
msgid "%s: Cannot lstat %s: %s\n"
msgstr "%s: %s-ის lstat-ის შეცდომა: %s\n"
#, c-format
msgid "%s: Warning, user %s has no tcb shadow file.\n"
msgstr "%s: გაფრთხილება: მომხმარებელს (%s) tcb shadow ფაილი არ გააჩნია.\n"
#, c-format
msgid ""
"%s: Emergency: %s's tcb shadow is not a regular file with st_nlink=1.\n"
"The account is left locked.\n"
msgstr ""
"%s: გადაუდებელი შემთხვევა: %s tcb ჩრდილი არ არის რეგულარული ფაილი st_nlink=1-"
"ით.\n"
"ანგარიში ჩაკეტილია.\n"
#, c-format
msgid "%s: mkdir: %s: %s\n"
msgstr "%s: mkdir: %s: %s\n"
#, c-format
msgid "%s: Cannot open %s: %s\n"
msgstr "%s: %s-ის გახსნის შეცდომა: %s\n"
#, c-format
msgid "%s: user %s is currently logged in\n"
msgstr "%s: მომხმარებელი %s ამჟამად შემოსულია\n"
@@ -661,6 +671,9 @@ msgstr ""
msgid " -R, --root CHROOT_DIR directory to chroot into\n"
msgstr " -R, --root CHROOT_DIR საქაღალდე chroot-ისთვის\n"
msgid " -P, --prefix PREFIX_DIR directory prefix\n"
msgstr " -P, --prefix PREFIX_DIR პრეფიქსი საქაღალდე\n"
msgid ""
" -W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS\n"
msgstr ""
@@ -913,6 +926,10 @@ msgstr ""
" -s, --sha-rounds წრეების რიცხვი SHA, BCRYPT\n"
" და YESCRYPT დაშიფვრის ალგორითმებისთვის\n"
#, c-format
msgid "%s: no crypt method defined\n"
msgstr "%s: დაშიფვრის მეთოდი აღწერილი არაა\n"
#, c-format
msgid "%s: %s flag is only allowed with the %s flag\n"
msgstr "%s: ალამი %s მხოლოდ ალამ %s -სთან ერთადაა ნებადართული\n"
@@ -965,6 +982,15 @@ msgstr ""
msgid "Login Shell"
msgstr "შესვლს გარსი"
#, c-format
#| msgid "%s: Cannot get the size of %s: %s\n"
msgid "Cannot parse shell files: %s"
msgstr "ვერ დავამუშავე გარსის ფაილები: %s"
#, c-format
msgid "Cannot evaluate entries in shell files: %s"
msgstr "გარსის ფაილების ჩანაწერების შეფასება შეუძლებელია: %s"
#, c-format
msgid "You may not change the shell for '%s'.\n"
msgstr "%s-ის გარსის შეცვლა არ შეგიძლიათ.\n"
@@ -977,6 +1003,10 @@ msgstr "%s-ის გარსის შეცვლა\n"
msgid "%s: Invalid entry: %s\n"
msgstr "%s: არასწორი ჩანაწერი: %s\n"
#, c-format
msgid "%s: Warning: %s is an invalid shell\n"
msgstr "%s: გაფრთხილება: %s არასწორი გარსია\n"
#, c-format
msgid "%s: %s is an invalid shell\n"
msgstr "%s: %s არასწორი გარსია\n"
@@ -1222,9 +1252,6 @@ msgstr ""
msgid " -r, --system create a system account\n"
msgstr " -r, --system სისტემური ანგარიშის შექმნა\n"
msgid " -P, --prefix PREFIX_DI directory prefix\n"
msgstr " -P, --prefix PREFIX_DI პრეფიქსი საქაღალდე\n"
msgid " -U, --users USERS list of user members of this group\n"
msgstr " -U, --users USERS ამ ჯგუფის წევრების სია\n"
@@ -1236,6 +1263,10 @@ msgstr "წევრის არასწორი მომხმარებ
msgid "%s: '%s' is not a valid group name\n"
msgstr "%s: %s ჯგუფის სწორ სახელს არ წარმოადგენს\n"
#, c-format
msgid "%s: cannot open %s: %s\n"
msgstr "%s: %s-ის გახსნის შეცდომა: %s\n"
#, c-format
msgid "%s: invalid group ID '%s'\n"
msgstr "%s: ჯგუფის არასწორი ID '%s'\n"
@@ -1516,7 +1547,7 @@ msgstr ""
"ჩანაწერების ჩვენება\n"
msgid ""
" -C, --clear clear lastlog record of an user (usable only "
" -C, --clear clear lastlog record of a user (usable only "
"with -u)\n"
msgstr ""
" -C, --clear მომხმარებლის lastlog ჩანაწერის გასუფთავება "
@@ -1622,11 +1653,6 @@ msgstr ""
msgid "%s: Cannot possibly work without effective root\n"
msgstr "%s: root-ის უფლებებით ალბათ ვერ ვიმუშავებ\n"
msgid "No utmp entry. You must exec \"login\" from the lowest level \"sh\""
msgstr ""
"\"utmp\"-ის ჩანაწერი არ არსებობს. \"login\"-ი \"sh\"-ის უმდაბლესი დონიდან "
"უნდა გაუშვათ"
#, c-format
msgid ""
"\n"
@@ -1660,14 +1686,6 @@ msgstr "მომხმარებლის სახელი არასწ
msgid "Cannot find user (%s)\n"
msgstr "მომხმარებლის (%s) პოვნა შეუძლებელია\n"
#, c-format
msgid ""
"\n"
"%s login: "
msgstr ""
"\n"
"%s მომხმარებლის სახელი: "
#, c-format
msgid "%s: failure forking: %s"
msgstr "%s: განტოტვის შეცდომა: %s"
@@ -1703,11 +1721,15 @@ msgid "%s: gid range [%lu-%lu) -> [%lu-%lu) not allowed\n"
msgstr "%s: gid -ის დიაპაზონი [%lu-%lu) -> [%lu-%lu) დაუშვებელია\n"
#, c-format
#| msgid ""
#| "usage: %s <pid> <gid> <lowergid> <count> [ <gid> <lowergid> "
#| "<count> ] ... \n"
msgid ""
"usage: %s <pid> <gid> <lowergid> <count> [ <gid> <lowergid> <count> ] ... \n"
"usage: %s [<pid|fd:<pidfd>] <gid> <lowergid> <count> [ <gid> <lowergid> "
"<count> ] ... \n"
msgstr ""
"გამოყენება: %s <pid> <gid> <lowergid> <რაოდენობა> [ <gid> <lowergid> "
"<რაოდენობა> ] ... \n"
"გამოყენება: %s [<pid|fd:<pidfd>] <gid> <lowergid> <რაოდენობა> [ <gid> "
"<lowergid> <რაოდენობა> ] ... \n"
#, c-format
msgid "%s: kernel doesn't support setgroups restrictions\n"
@@ -1730,20 +1752,16 @@ msgid "%s: failed to setgroups %s policy: %s\n"
msgstr "%s: setgroups-ის შეცდომა %s პოლიტიკა: %s\n"
#, c-format
msgid "%s: Could not open proc directory for target %u\n"
msgstr "%s: proc საქაღალდის გახსნის შეცდომა სამიზნისთვის %u\n"
#, c-format
msgid "%s: Could not stat directory for target %u\n"
msgstr "%s: საქაღალდის აღმოჩენის შეცდომა სამიზნისთვის: %u\n"
msgid "%s: Could not stat directory for process\n"
msgstr "%s: საქაღალდის აღმოჩენის შეცდომა პროცესისთვის\n"
#, c-format
msgid ""
"%s: Target %u is owned by a different user: uid:%lu pw_uid:%lu st_uid:%lu, "
"gid:%lu pw_gid:%lu st_gid:%lu\n"
"%s: Target process is owned by a different user: uid:%lu pw_uid:%lu st_uid:"
"%lu, gid:%lu pw_gid:%lu st_gid:%lu\n"
msgstr ""
"%s: სამიზნე %u სხვა მომხმარებლისაა: uid:%lu pw_uid:%lu st_uid:%lu, gid:%lu "
"pw_gid:%lu st_gid:%lu\n"
"%s: სამიზნე პროცესის მფლობელი სხვა მომხმარებლია: uid:%lu pw_uid:%lu st_uid:"
"%lu, gid:%lu pw_gid:%lu st_gid:%lu\n"
msgid "Usage: newgrp [-] [group]\n"
msgstr "გამოყენება: newgrp [-] [ჯგუფი]\n"
@@ -1774,19 +1792,19 @@ msgid "%s: uid range [%lu-%lu) -> [%lu-%lu) not allowed\n"
msgstr "%s: uid -ის დიაპაზონი [%lu-%lu) -> [%lu-%lu) დაუშვებელია\n"
#, c-format
#| msgid ""
#| "usage: %s <pid> <uid> <loweruid> <count> [ <uid> <loweruid> "
#| "<count> ] ... \n"
msgid ""
"usage: %s <pid> <uid> <loweruid> <count> [ <uid> <loweruid> <count> ] ... \n"
"usage: %s [<pid>|fd:<pidfd>] <uid> <loweruid> <count> [ <uid> <loweruid> "
"<count> ] ... \n"
msgstr ""
"გამოყენება: %s <pid> <uid> <loweruid> <რაოდენობა> [ <uid> <loweruid> "
"<რაოდენობა> ] ... \n"
"გამოყენება: %s [<pid>|fd:<pidfd>] <uid> <loweruid> <რაოდენობა> [ <uid> "
"<loweruid> <რაოდენობა> ] ... \n"
#, c-format
msgid ""
"%s: Target process %u is owned by a different user: uid:%lu pw_uid:%lu "
"st_uid:%lu, gid:%lu pw_gid:%lu st_gid:%lu\n"
msgstr ""
"%s: სამიზნე პროცესი %u სხვა მომხმარებლითაა გაშვებული: uid:%lu pw_uid:%lu "
"st_uid:%lu, gid:%lu pw_gid:%lu st_gid:%lu\n"
msgid "%s: Could not stat directory for target process\n"
msgstr "%s: საქაღალდის აღმოჩენის შეცდომა სამიზნე პროცესისთვის\n"
msgid " -b, --badname allow bad names\n"
msgstr " -b, --badname სახელების სისწორე არ შემოწმდება\n"
@@ -1807,6 +1825,10 @@ msgid "%s: invalid user name '%s': use --badname to ignore\n"
msgstr ""
"%s: მომხმარებლის არასწორი სახელი '%s': დასაიგნორებლად გამოიყენეთ --badname\n"
#, c-format
msgid "%s: Provide '--crypt-method' before number of rounds\n"
msgstr "%s: მიაწოდეთ '--crypt-method', წრეების რაოდენობამდე\n"
#, c-format
msgid "%s: line %d: invalid line\n"
msgstr "%s: ხაზი %d: არასწორი ხაზი\n"
@@ -1829,6 +1851,11 @@ msgstr "%s: ხაზი %d: ჯგუფის შექმნა შეუძ
msgid "%s: line %d: user '%s' does not exist in %s\n"
msgstr "%s: ხაზი %d: მომხმარებელი '%s' %s-ში არ არსებობს\n"
#, c-format
#| msgid "%s: unlink: %s: %s\n"
msgid "%s: line %d: %s\n"
msgstr "%s: ხაზი %d: %s\n"
#, c-format
msgid "%s: line %d: can't update password\n"
msgstr "%s: ხაზი %d: პაროლის განახლება შეუძლებელია\n"
@@ -1849,14 +1876,14 @@ msgstr "%s: ხაზი %d: chown %s -ის შეცდომა: %s\n"
msgid "%s: line %d: can't update entry\n"
msgstr "%s: ხაზი %d: ჩანაწერის განახლების შეცდომა\n"
#, c-format
msgid "%s: failed to prepare new %s entry\n"
msgstr "%s: ახალი %s ჩანაწერის მომზადების შეცდომა\n"
#, c-format
msgid "%s: can't find subordinate user range\n"
msgstr "%s: დაქვემდებარებული მომხმარებლის დიაპაზონის პოვნა შეუძლებელია\n"
#, c-format
msgid "%s: failed to prepare new %s entry\n"
msgstr "%s: ახალი %s ჩანაწერის მომზადების შეცდომა\n"
#, c-format
msgid "%s: can't find subordinate group range\n"
msgstr "%s: დაქვემდებარებული ჯგუფის დიაპაზონის პოვნა შეუძლებელია\n"
@@ -1934,6 +1961,9 @@ msgstr ""
"რაოდენობის \n"
" MAX_DAYS-ზე დაყენება\n"
msgid " -s, --stdin read new token from stdin\n"
msgstr " -s, --stdin ახალი კოდების stdin-დან წაკითხვა\n"
msgid "Old password: "
msgstr "ძველი პაროლი: "
@@ -1995,6 +2025,11 @@ msgstr ""
msgid "%s: repository %s not supported\n"
msgstr "%s: მხარდაუჭერელი რეპოზიტორია: %s\n"
#, c-format
msgid "%s: only root can use --stdin/-s option\n"
msgstr ""
"%s: --stdin/-s პარამეტრის გამოყენება, მხოლოდ, root მომხმარებელს შეუძლია\n"
#, c-format
msgid "%s: root is not authorized by SELinux to change the password of %s\n"
msgstr ""
@@ -2148,11 +2183,9 @@ msgstr "%s: სიგნალის გაუმართაობა\n"
msgid "Session terminated, terminating shell..."
msgstr "სესია გაწყდა. გარსის დასრულება...."
#, c-format
msgid " ...killed.\n"
msgstr " ...მოკლულია.\n"
#, c-format
msgid " ...waiting for child to terminate.\n"
msgstr " ... ველოდები შვილი პროცესების დასრულებას.\n"
@@ -2229,6 +2262,11 @@ msgstr "%s: su-ის ავტორიზაცია ამჟამად
msgid "No passwd entry for user '%s'\n"
msgstr "Passwd ფაილში მომხმარებლისთვის \"%s\" ჩანაწერი არ არსებობს\n"
#, c-format
#| msgid "Invalid member username %s\n"
msgid "Overlong user name '%s'\n"
msgstr "მეტისმეტად გრძელი მომხმარებლის სახელი '%s'\n"
#, c-format
msgid "%s: must be run from a terminal\n"
msgstr "%s: ტერმინალიდან გაშვება აუცილებელია\n"
@@ -2274,6 +2312,15 @@ msgstr "%s: %s შეიქმნა, მაგრამ ვერ ვშლი\
msgid "%s: the %s configuration in %s will be ignored\n"
msgstr "%s: %s-ის კონფიგურაცია %s-ში იგნორირებული იქნება\n"
#, c-format
msgid ""
"%s: the '%s' configuration in %s has an invalid group, ignoring the bad "
"group\n"
msgstr ""
"%s: '%s'-ის კონფიგურაციას %s-ში არასწორი ჯგუფი აქვს. არასწორი ჯგუფების "
"გამოტოვება\n"
"\n"
#, c-format
msgid "%s: cannot create new defaults file: %s\n"
msgstr "%s: ნაგულისხმები მნიშვნელობების შემცველი ფაილის შექმნის შეცდომა; %s\n"
@@ -2370,6 +2417,13 @@ msgstr ""
" -f, --inactive INACTIVE ახალი ანგარიშის პაროლის არააქტიურობის "
"პერიოდი\n"
msgid ""
" -F, --add-subids-for-system add entries to sub[ud]id even when adding a "
"system user\n"
msgstr ""
" -F, --add-subids-for-system ჩანაწერების დამატება sub[ud]id-ში სისტემური "
"მომხმარებლის დამატების დროსაც კი\n"
msgid ""
" -g, --gid GROUP name or ID of the primary group of the new\n"
" account\n"
@@ -2437,8 +2491,15 @@ msgid ""
" -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user "
"mapping\n"
msgstr ""
" -Z, --selinux-user SEUSER SELinux -ის მომხმარებელთან ბმისთვის "
"მითითებლი SEUSER -ის გამოყენება\n"
" -Z, --selinux-user SEUSER მითითებული SEUSER -ის გამოყენება SELinux-ის "
"მომხმარებლის ასახვისთვის\n"
msgid ""
" --selinux-range SERANGE use a specific MLS range for the SELinux "
"user mapping\n"
msgstr ""
" --selinux-user SERANGE მითითებული MLS შუალედის გამოყენება SELinux-ის "
"მომხმარებლის ასახვისთვის\n"
#, c-format
msgid "%s: invalid base directory '%s'\n"
@@ -2571,6 +2632,12 @@ msgstr ""
msgid "Setting mailbox file permissions"
msgstr "საფოსტო ყუთის ფაილის წვდომების დაყენება"
msgid "Synchronize mailbox file"
msgstr "საფოსტო ყუთის ფაილის სინქრონიზაცია"
msgid "Closing mailbox file"
msgstr "საფოსტო ყუთის ფაილის დახურვა"
#, c-format
msgid "%s warning: %s's uid %d is greater than SYS_UID_MAX %d\n"
msgstr ""
@@ -2836,6 +2903,12 @@ msgstr ""
" -Z, --selinux-user SEUSER ანგარიშის SELinux -ის მითითებულ "
"მომხმარებელზე მიბმა\n"
msgid ""
" --selinux-range SERANGE new SELinux MLS range for the user account\n"
msgstr ""
" --selinux-range SERANGE ახალი SELinux MLS შუალედი მომხმარებლის "
"ანგარიშისთვის\n"
#, c-format
msgid ""
"%s: unlocking the user's password would result in a passwordless account.\n"
@@ -2914,18 +2987,38 @@ msgstr "%s: ძველი საწყისი საქაღალდის
msgid "%s: cannot rename directory %s to %s\n"
msgstr "%s: საქაღალდის სახელის %s-დან %s-ზე გადარქმევის შეცდომა\n"
#, c-format
msgid ""
"%s: The previous home directory (%s) does not exist or is inaccessible. Move "
"cannot be completed.\n"
msgstr ""
"%s: წინა საწყისი საქაღალდე (%s) არ არსებობს ან ხელმისაწვდომი არაა. გადატანის "
"დასრულება შეუძლებელია.\n"
#, c-format
msgid "%s: failed to copy the lastlog entry of user %lu to user %lu: %s\n"
msgstr ""
"%s: lastlog-ის ჩანაწერის ერთი მომხმარებლიდან (%lu) მეორეზე (%lu) კოპირების "
"შეცდომა: %s\n"
#, c-format
msgid "%s: failed to copy the lastlog entry of user %ju to user %ju: %s\n"
msgstr ""
"%s: lastlog-ის ჩანაწერის ერთი მომხმარებლიდან (%ju) მეორეზე (%ju) კოპირების "
"შეცდომა: %s\n"
#, c-format
msgid "%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"
msgstr ""
"%s: faillog -ის ჩანაწერის ერთი მომხმარებლიდან (%lu) მეორეზე (%lu) კოპირების "
"შეცდომა: %s\n"
#, c-format
msgid "%s: failed to copy the faillog entry of user %ju to user %ju: %s\n"
msgstr ""
"%s: faillog -ის ჩანაწერის ერთი მომხმარებლიდან (%ju) მეორეზე (%ju) კოპირების "
"შეცდომა: %s\n"
#, c-format
msgid "%s: warning: %s not owned by %s\n"
msgstr "%s: გაფრთხილება: %s-ის მფლობელი %s არაა\n"
@@ -3026,8 +3119,9 @@ msgstr "მონახაზის ფაილის წაშლის შე
msgid "failed to stat edited file"
msgstr "რედაქტირებული ფაილის აღმოჩენა შეუძლებელია"
msgid "failed to allocate memory"
msgstr "მეხსიერების გამოყოფის შეცდომა"
#| msgid "%s: snprintf failed!\n"
msgid "asprintf(3) failed"
msgstr "asprintf(3) ჩავარდა"
msgid "failed to create backup file"
msgstr "მარქაფის ფაილის შექმნის შეცდომა"
@@ -3039,3 +3133,30 @@ msgstr "%s: %s-ის აღდგენის შეცდომა: %s (თქ
#, c-format
msgid "%s: failed to find tcb directory for %s\n"
msgstr "%s: %s-სთვის tcb საქაღალდის პოვნის შეცდომა\n"
#~ msgid "too simple"
#~ msgstr "ძალიან მარტივია"
#, c-format
#~ msgid "Unable to obtain random bytes.\n"
#~ msgstr "შემთხვევითი ბაიტების მიღების შეცდომა.\n"
#~ msgid "No utmp entry. You must exec \"login\" from the lowest level \"sh\""
#~ msgstr ""
#~ "\"utmp\"-ის ჩანაწერი არ არსებობს. \"login\"-ი \"sh\"-ის უმდაბლესი "
#~ "დონიდან უნდა გაუშვათ"
#, c-format
#~ msgid "%s: Could not open proc directory for target %u\n"
#~ msgstr "%s: proc საქაღალდის გახსნის შეცდომა სამიზნისთვის %u\n"
#, c-format
#~ msgid ""
#~ "%s: Target %u is owned by a different user: uid:%lu pw_uid:%lu st_uid:"
#~ "%lu, gid:%lu pw_gid:%lu st_gid:%lu\n"
#~ msgstr ""
#~ "%s: სამიზნე %u სხვა მომხმარებლისაა: uid:%lu pw_uid:%lu st_uid:%lu, gid:"
#~ "%lu pw_gid:%lu st_gid:%lu\n"
#~ msgid "failed to allocate memory"
#~ msgstr "მეხსიერების გამოყოფის შეცდომა"

View File

@@ -2,16 +2,33 @@ ARG OS_IMAGE="alpine:latest"
FROM "${OS_IMAGE}" AS build
RUN apk add autoconf automake build-base byacc cmocka-dev expect gettext-dev \
git libbsd-dev libeconf-dev libtool libxslt pkgconf
RUN apk add \
autoconf \
automake \
bash \
build-base \
byacc \
cmocka-dev \
expect \
gettext-dev \
git \
libbsd-dev \
libeconf-dev \
libtool \
libxslt \
pkgconf
COPY ./ /usr/local/src/shadow/
WORKDIR /usr/local/src/shadow/
RUN ./autogen.sh --without-selinux --disable-man --disable-nls --with-yescrypt
RUN ./autogen.sh \
--without-selinux \
--disable-man \
--disable-nls \
--with-yescrypt
RUN make -kj4 || true
RUN make
RUN make check
RUN bash -c "trap 'cat <tests/unit/test-suite.log >&2' ERR; make check;"
RUN make install
FROM scratch AS export

View File

@@ -9,15 +9,23 @@ RUN export DEBIAN_PRIORITY=critical \
RUN apt-get update -y \
&& apt-get dist-upgrade -y
RUN apt-get build-dep shadow -y
RUN apt-get install libltdl-dev libbsd-dev libcmocka-dev pkgconf -y
RUN apt-get install \
libltdl-dev \
libbsd-dev \
libcmocka-dev \
pkgconf \
-y
COPY ./ /usr/local/src/shadow/
WORKDIR /usr/local/src/shadow/
RUN ./autogen.sh --without-selinux --enable-man --with-yescrypt
RUN ./autogen.sh \
--without-selinux \
--enable-man \
--with-yescrypt
RUN make -kj4 || true
RUN make
RUN make check
RUN bash -c "trap 'cat <tests/unit/test-suite.log >&2' ERR; make check;"
RUN make install
FROM scratch AS export

View File

@@ -2,19 +2,32 @@ ARG OS_IMAGE="fedora:latest"
FROM "${OS_IMAGE}" AS build
RUN dnf install -y dnf-plugins-core libcmocka-devel systemd-devel
RUN dnf install -y \
dnf-plugins-core \
libcmocka-devel \
systemd-devel
RUN dnf builddep -y shadow-utils
COPY ./ /usr/local/src/shadow/
WORKDIR /usr/local/src/shadow/
RUN ./autogen.sh --enable-shadowgrp --enable-man --with-audit \
--with-sha-crypt --with-bcrypt --with-yescrypt --with-selinux \
--without-libpam --enable-shared --without-libbsd \
--with-group-name-max-length=32 --enable-lastlog --enable-logind=no
RUN ./autogen.sh \
--enable-shadowgrp \
--enable-man \
--with-audit \
--with-sha-crypt \
--with-bcrypt \
--with-yescrypt \
--with-selinux \
--without-libpam \
--enable-shared \
--without-libbsd \
--with-group-name-max-length=32 \
--enable-lastlog \
--enable-logind=no
RUN make -kj4 || true
RUN make
RUN make check
RUN bash -c "trap 'cat <tests/unit/test-suite.log >&2' ERR; make check;"
RUN make install
FROM scratch AS export

View File

@@ -45,7 +45,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "chage";
static bool
dflg = false, /* set last password change date */
@@ -76,7 +76,7 @@ static long expdate;
/* local function prototypes */
NORETURN static void usage (int status);
static int new_fields (void);
static void print_date (time_t date);
static void print_day_as_date (long day);
static void list_fields (void);
static void process_flags (int argc, char **argv);
static void check_flags (int argc, int opt_index);
@@ -231,10 +231,22 @@ static int new_fields (void)
return 1;
}
static void print_date (time_t date)
static void
print_day_as_date(long day)
{
struct tm *tp;
char buf[80];
char buf[80];
time_t date;
struct tm *tp;
if (day < 0) {
puts(_("never"));
return;
}
if (__builtin_mul_overflow(day, DAY, &date)) {
puts(_("future"));
return;
}
tp = gmtime (&date);
if (NULL == tp) {
@@ -245,6 +257,7 @@ static void print_date (time_t date)
}
}
/*
* list_fields - display the current values of the expiration fields
*
@@ -254,21 +267,15 @@ static void print_date (time_t date)
*/
static void list_fields (void)
{
long changed = 0;
long expires;
/*
* The "last change" date is either "never" or the date the password
* was last modified. The date is the number of days since 1/1/1970.
*/
(void) fputs (_("Last password change\t\t\t\t\t: "), stdout);
if (lstchgdate < 0 || lstchgdate > LONG_MAX / DAY) {
(void) puts (_("never"));
} else if (lstchgdate == 0) {
if (lstchgdate == 0) {
(void) puts (_("password must be changed"));
} else {
changed = lstchgdate * DAY;
print_date (changed);
print_day_as_date(lstchgdate);
}
/*
@@ -281,11 +288,11 @@ static void list_fields (void)
} else if ( (lstchgdate < 0)
|| (maxdays >= 10000)
|| (maxdays < 0)
|| ((LONG_MAX - changed) / DAY < maxdays)) {
|| (LONG_MAX - lstchgdate < maxdays))
{
(void) puts (_("never"));
} else {
expires = changed + maxdays * DAY;
print_date (expires);
print_day_as_date(lstchgdate + maxdays);
}
/*
@@ -301,12 +308,12 @@ static void list_fields (void)
|| (inactdays < 0)
|| (maxdays >= 10000)
|| (maxdays < 0)
|| (maxdays > LONG_MAX - inactdays)
|| ((LONG_MAX - changed) / DAY < maxdays + inactdays)) {
|| (LONG_MAX - inactdays < maxdays)
|| (LONG_MAX - lstchgdate < maxdays + inactdays))
{
(void) puts (_("never"));
} else {
expires = changed + (maxdays + inactdays) * DAY;
print_date (expires);
print_day_as_date(lstchgdate + maxdays + inactdays);
}
/*
@@ -314,12 +321,7 @@ static void list_fields (void)
* password expiring or not.
*/
(void) fputs (_("Account expires\t\t\t\t\t\t: "), stdout);
if (expdate < 0 || LONG_MAX / DAY < expdate) {
(void) puts (_("never"));
} else {
expires = expdate * DAY;
print_date (expires);
}
print_day_as_date(expdate);
/*
* Start with the easy numbers - the number of days before the
@@ -515,7 +517,7 @@ static void check_perms (void)
exit (E_NOPERM);
}
retval = pam_start ("chage", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
if (PAM_SUCCESS == retval) {
retval = pam_authenticate (pamh, 0);
@@ -769,7 +771,6 @@ int main (int argc, char **argv)
/*
* Get the program name so that error messages can use it.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -784,7 +785,7 @@ int main (int argc, char **argv)
#ifdef WITH_AUDIT
audit_help_open ();
#endif
OPENLOG ("chage");
OPENLOG (Prog);
ruid = getuid ();
rgid = getgid ();

View File

@@ -20,14 +20,13 @@
#include "idmapping.h"
#include "shadowlog.h"
const char *Prog;
static const char Prog[] = "check_subid_range";
int main(int argc, char **argv)
{
char *owner;
unsigned long start, count;
bool check_uids;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);

View File

@@ -39,7 +39,7 @@
/*
* Global variables.
*/
const char *Prog;
static const char Prog[] = "chfn";
static char fullnm[BUFSIZ];
static char roomno[BUFSIZ];
static char workph[BUFSIZ];
@@ -365,7 +365,7 @@ static void check_perms (const struct passwd *pw)
* check if the change is allowed by SELinux policy.
*/
if ((pw->pw_uid != getuid ())
&& (check_selinux_permit ("chfn") != 0)) {
&& (check_selinux_permit (Prog) != 0)) {
fprintf (stderr, _("%s: Permission denied.\n"), Prog);
closelog ();
exit (E_NOPERM);
@@ -380,7 +380,7 @@ static void check_perms (const struct passwd *pw)
* --marekm
*/
if (!amroot && getdef_bool ("CHFN_AUTH")) {
passwd_check (pw->pw_name, pw->pw_passwd, "chfn");
passwd_check (pw->pw_name, pw->pw_passwd, Prog);
}
#else /* !USE_PAM */
@@ -392,7 +392,7 @@ static void check_perms (const struct passwd *pw)
exit (E_NOPERM);
}
retval = pam_start ("chfn", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
if (PAM_SUCCESS == retval) {
retval = pam_authenticate (pamh, 0);
@@ -620,11 +620,6 @@ int main (int argc, char **argv)
char *user;
const struct passwd *pw;
/*
* Get the program name. The program name is used as a
* prefix to most error messages.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -641,7 +636,7 @@ int main (int argc, char **argv)
*/
amroot = (getuid () == 0);
OPENLOG ("chfn");
OPENLOG (Prog);
/* parse the command line options */
process_flags (argc, argv);

View File

@@ -36,7 +36,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "chgpasswd";
static bool eflg = false;
static bool md5flg = false;
#if defined(USE_SHA_CRYPT) || defined(USE_BCRYPT) || defined(USE_YESCRYPT)
@@ -303,7 +303,7 @@ static void check_perms (void)
exit (1);
}
retval = pam_start ("chgpasswd", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
if (PAM_SUCCESS == retval) {
retval = pam_authenticate (pamh, 0);
@@ -423,7 +423,6 @@ int main (int argc, char **argv)
int errors = 0;
int line = 0;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -441,7 +440,7 @@ int main (int argc, char **argv)
process_flags (argc, argv);
OPENLOG ("chgpasswd");
OPENLOG (Prog);
check_perms ();

View File

@@ -35,7 +35,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "chpasswd";
static bool eflg = false;
static bool md5flg = false;
#if defined(USE_SHA_CRYPT) || defined(USE_BCRYPT) || defined(USE_YESCRYPT)
@@ -302,7 +302,7 @@ static void check_perms (void)
exit (1);
}
retval = pam_start ("chpasswd", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
if (PAM_SUCCESS == retval) {
retval = pam_authenticate (pamh, 0);
@@ -450,7 +450,6 @@ int main (int argc, char **argv)
int errors = 0;
int line = 0;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -476,7 +475,7 @@ int main (int argc, char **argv)
}
#endif /* USE_PAM */
OPENLOG ("chpasswd");
OPENLOG (Prog);
check_perms ();
@@ -546,7 +545,7 @@ int main (int argc, char **argv)
#ifdef USE_PAM
if (use_pam) {
if (do_pam_passwd_non_interactive ("chpasswd", name, newpwd) != 0) {
if (do_pam_passwd_non_interactive (Prog, name, newpwd) != 0) {
fprintf (stderr,
_("%s: (line %d, user %s) password not changed\n"),
Prog, line, name);

View File

@@ -46,7 +46,7 @@
/*
* Global variables
*/
const char *Prog; /* Program name */
static const char Prog[] = "chsh"; /* Program name */
static bool amroot; /* Real UID is root */
static char loginsh[BUFSIZ]; /* Name of new login shell */
/* command line options */
@@ -319,7 +319,7 @@ static void check_perms (const struct passwd *pw)
* check if the change is allowed by SELinux policy.
*/
if ((pw->pw_uid != getuid ())
&& (check_selinux_permit("chsh") != 0)) {
&& (check_selinux_permit(Prog) != 0)) {
SYSLOG ((LOG_WARN, "can't change shell for '%s'", pw->pw_name));
fprintf (stderr,
_("You may not change the shell for '%s'.\n"),
@@ -336,7 +336,7 @@ static void check_perms (const struct passwd *pw)
* chfn/chsh. --marekm
*/
if (!amroot && getdef_bool ("CHSH_AUTH")) {
passwd_check (pw->pw_name, pw->pw_passwd, "chsh");
passwd_check (pw->pw_name, pw->pw_passwd, Prog);
}
#else /* !USE_PAM */
@@ -348,7 +348,7 @@ static void check_perms (const struct passwd *pw)
exit (E_NOPERM);
}
retval = pam_start ("chsh", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
if (PAM_SUCCESS == retval) {
retval = pam_authenticate (pamh, 0);
@@ -473,11 +473,6 @@ int main (int argc, char **argv)
sanitize_env ();
/*
* Get the program name. The program name is used as a prefix to
* most error messages.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -492,7 +487,7 @@ int main (int argc, char **argv)
*/
amroot = (getuid () == 0);
OPENLOG ("chsh");
OPENLOG (Prog);
/* parse the command line options */
process_flags (argc, argv);

View File

@@ -25,7 +25,7 @@
#include "shadowlog.h"
/* Global variables */
const char *Prog;
static const char Prog[] = "expiry";
static bool cflg = false;
/* local function prototypes */
@@ -125,7 +125,6 @@ int main (int argc, char **argv)
struct passwd *pwd;
struct spwd *spwd;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -147,7 +146,7 @@ int main (int argc, char **argv)
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
OPENLOG ("expiry");
OPENLOG (Prog);
process_flags (argc, argv);

View File

@@ -40,7 +40,7 @@ static void reset (void);
/*
* Global variables
*/
const char *Prog; /* Program name */
static const char Prog[] = "faillog"; /* Program name */
static FILE *fail; /* failure file stream */
static time_t seconds; /* that number of days in seconds */
static unsigned long umin; /* if uflg and has_umin, only display users with uid >= umin */
@@ -510,11 +510,6 @@ int main (int argc, char **argv)
short fail_max = 0; // initialize to silence compiler warning
long days = 0;
/*
* Get the program name. The program name is used as a prefix to
* most error messages.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);

View File

@@ -9,7 +9,7 @@
/* Test program for the subid freeing routine */
const char *Prog;
static const char Prog[] = "free_subid_range";
static void usage(void)
{
@@ -25,7 +25,6 @@ int main(int argc, char *argv[])
struct subordinate_range range;
bool group = false; // get subuids by default
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
while ((c = getopt(argc, argv, "g")) != EOF) {

View File

@@ -6,7 +6,7 @@
#include "prototypes.h"
#include "shadowlog.h"
const char *Prog;
static const char Prog[] = "get_subid_owners";
static void usage(void)
{
@@ -21,7 +21,6 @@ int main(int argc, char *argv[])
int i, n;
uid_t *uids;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
if (argc < 2) {

View File

@@ -7,7 +7,7 @@
#include "prototypes.h"
#include "shadowlog.h"
const char *Prog;
static const char Prog[] = "getsubids";
static void usage(void)
{
@@ -23,7 +23,6 @@ int main(int argc, char *argv[])
struct subid_range *ranges;
const char *owner;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
if (argc < 2)

View File

@@ -43,7 +43,7 @@
* Global variables
*/
/* The name of this command, as it is invoked */
const char *Prog;
static const char Prog[] = "gpasswd";
#ifdef SHADOWGRP
/* Indicate if shadow groups are enabled on the system
@@ -942,11 +942,10 @@ int main (int argc, char **argv)
* with this command.
*/
bywho = getuid ();
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
OPENLOG ("gpasswd");
OPENLOG (Prog);
setbuf (stdout, NULL);
setbuf (stderr, NULL);

View File

@@ -51,7 +51,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "groupadd";
static /*@null@*/char *group_name;
static gid_t group_id;
@@ -543,7 +543,7 @@ static void check_perms (void)
exit (1);
}
retval = pam_start ("groupadd", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
if (PAM_SUCCESS == retval) {
retval = pam_authenticate (pamh, 0);
@@ -572,10 +572,6 @@ static void check_perms (void)
*/
int main (int argc, char **argv)
{
/*
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -586,7 +582,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
prefix = process_prefix_flag ("-P", argc, argv);
OPENLOG ("groupadd");
OPENLOG (Prog);
#ifdef WITH_AUDIT
audit_help_open ();
#endif
@@ -606,7 +602,7 @@ int main (int argc, char **argv)
check_perms ();
if (run_parts ("/etc/shadow-maint/groupadd-pre.d", group_name,
"groupadd")) {
Prog)) {
exit(1);
}
@@ -629,7 +625,7 @@ int main (int argc, char **argv)
grp_update ();
close_files ();
if (run_parts ("/etc/shadow-maint/groupadd-post.d", group_name,
"groupadd")) {
Prog)) {
exit(1);
}

View File

@@ -36,7 +36,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "groupdel";
static char *group_name;
static gid_t group_id = -1;
@@ -349,10 +349,6 @@ int main (int argc, char **argv)
#endif /* USE_PAM */
#endif /* ACCT_TOOLS_SETUID */
/*
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -363,7 +359,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
prefix = process_prefix_flag ("-P", argc, argv);
OPENLOG ("groupdel");
OPENLOG (Prog);
#ifdef WITH_AUDIT
audit_help_open ();
#endif
@@ -389,7 +385,7 @@ int main (int argc, char **argv)
exit (1);
}
retval = pam_start ("groupdel", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
}
if (PAM_SUCCESS == retval) {
@@ -463,7 +459,7 @@ int main (int argc, char **argv)
}
if (run_parts ("/etc/shadow-maint/groupdel-pre.d", group_name,
"groupdel")) {
Prog)) {
exit(1);
}
@@ -478,7 +474,7 @@ int main (int argc, char **argv)
close_files ();
if (run_parts ("/etc/shadow-maint/groupdel-post.d", group_name,
"groupdel")) {
Prog)) {
exit(1);
}

View File

@@ -44,7 +44,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "groupmems";
static char *adduser = NULL;
static char *deluser = NULL;
@@ -443,7 +443,7 @@ static void check_perms (void)
fail_exit (1);
}
retval = pam_start ("groupmems", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
if (PAM_SUCCESS == retval) {
retval = pam_authenticate (pamh, 0);
@@ -573,10 +573,6 @@ int main (int argc, char **argv)
char *name;
const struct group *grp;
/*
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -586,7 +582,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
OPENLOG ("groupmems");
OPENLOG (Prog);
#ifdef SHADOWGRP
is_shadowgrp = sgr_file_present ();

View File

@@ -59,7 +59,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "groupmod";
#ifdef SHADOWGRP
static bool is_shadow_grp;
@@ -751,10 +751,6 @@ int main (int argc, char **argv)
#endif /* USE_PAM */
#endif /* ACCT_TOOLS_SETUID */
/*
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -765,7 +761,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
prefix = process_prefix_flag ("-P", argc, argv);
OPENLOG ("groupmod");
OPENLOG (Prog);
#ifdef WITH_AUDIT
audit_help_open ();
#endif
@@ -791,7 +787,7 @@ int main (int argc, char **argv)
exit (E_PAM_USERNAME);
}
retval = pam_start ("groupmod", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
}
if (PAM_SUCCESS == retval) {

View File

@@ -23,7 +23,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "groups";
/* local function prototypes */
static void print_groups (const char *member);
@@ -97,10 +97,6 @@ int main (int argc, char **argv)
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
/*
* Get the program name so that error messages can use it.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);

View File

@@ -43,7 +43,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "grpck";
static const char *grp_file = GROUP_FILE;
static bool use_system_grp_file = true;
@@ -816,10 +816,6 @@ int main (int argc, char **argv)
int errors = 0;
bool changed = false;
/*
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -829,7 +825,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
OPENLOG ("grpck");
OPENLOG (Prog);
/* Parse the command line arguments */
process_flags (argc, argv);

View File

@@ -39,7 +39,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "grpconv";
static bool gr_locked = false;
static bool sgr_locked = false;
@@ -126,7 +126,6 @@ int main (int argc, char **argv)
const struct sgrp *sg;
struct sgrp sgent;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -136,7 +135,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
OPENLOG ("grpconv");
OPENLOG (Prog);
process_flags (argc, argv);

View File

@@ -38,7 +38,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "grpunconv";
static bool gr_locked = false;
static bool sgr_locked = false;
@@ -124,7 +124,6 @@ int main (int argc, char **argv)
struct group grent;
const struct sgrp *sg;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -134,7 +133,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
OPENLOG ("grpunconv");
OPENLOG (Prog);
process_flags (argc, argv);

View File

@@ -40,7 +40,7 @@
/*
* Global variables
*/
const char *Prog; /* Program name */
static const char Prog[] = "lastlog"; /* Program name */
static FILE *lastlogfile; /* lastlog file stream */
static unsigned long umin; /* if uflg and has_umin, only display users with uid >= umin */
static bool has_umin = false;
@@ -291,7 +291,6 @@ int main (int argc, char **argv)
* Get the program name. The program name is used as a prefix to
* most error messages.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);

View File

@@ -68,7 +68,7 @@ static pam_handle_t *pamh = NULL;
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "login";
static const char *hostname = "";
static /*@null@*/ /*@only@*/char *username = NULL;
@@ -520,7 +520,6 @@ int main (int argc, char **argv)
initenv ();
amroot = (getuid () == 0);
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -572,11 +571,13 @@ int main (int argc, char **argv)
}
#ifdef RLOGIN
if (rflg) {
size_t max_size = sysconf(_SC_LOGIN_NAME_MAX);
size_t max_size = sysconf(_SC_LOGIN_NAME_MAX);
assert (NULL == username);
username = XMALLOC(max_size + 1, char);
username[max_size] = '\0';
if (do_rlogin (hostname, username, max_size, term, sizeof term)) {
username = XMALLOC(max_size, char);
username[max_size - 1] = '\0';
if (do_rlogin(hostname, username, max_size, term, sizeof(term)))
{
preauth_flag = true;
} else {
free (username);
@@ -585,7 +586,7 @@ int main (int argc, char **argv)
}
#endif /* RLOGIN */
OPENLOG ("login");
OPENLOG (Prog);
setup_tty ();
@@ -668,7 +669,7 @@ int main (int argc, char **argv)
retries = getdef_unum ("LOGIN_RETRIES", RETRIES);
#ifdef USE_PAM
retcode = pam_start ("login", username, &conv, &pamh);
retcode = pam_start (Prog, username, &conv, &pamh);
if (retcode != PAM_SUCCESS) {
fprintf (stderr,
_("login: PAM Failure, aborting: %s\n"),
@@ -879,15 +880,16 @@ int main (int argc, char **argv)
failed = false; /* haven't failed authentication yet */
if (NULL == username) { /* need to get a login id */
size_t max_size = sysconf(_SC_LOGIN_NAME_MAX);
size_t max_size = sysconf(_SC_LOGIN_NAME_MAX);
if (subroot) {
closelog ();
exit (1);
}
preauth_flag = false;
username = XMALLOC(max_size + 1, char);
username[max_size] = '\0';
login_prompt (username, max_size);
username = XMALLOC(max_size, char);
username[max_size - 1] = '\0';
login_prompt(username, max_size);
if ('\0' == username[0]) {
/* Prompt for a new login */

View File

@@ -15,7 +15,7 @@
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <utmp.h>
#include <utmpx.h>
#include "defines.h"
#include "prototypes.h"
#include "shadowlog.h"
@@ -24,7 +24,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "logoutd";
#ifndef DEFAULT_HUP_MESG
#define DEFAULT_HUP_MESG _("login time exceeded\n\n")
@@ -34,14 +34,17 @@ const char *Prog;
#define HUP_MESG_FILE "/etc/logoutd.mesg"
#endif
/* local function prototypes */
static int check_login (const struct utmp *ut);
static int check_login (const struct utmpx *ut);
static void send_mesg_to_tty (int tty_fd);
/*
* check_login - check if user (struct utmp) allowed to stay logged in
* check_login - check if user (struct utmpx) allowed to stay logged in
*/
static int check_login (const struct utmp *ut)
static int
check_login(const struct utmpx *ut)
{
char user[sizeof(ut->ut_user) + 1];
char line[sizeof(ut->ut_line) + 1];
@@ -112,16 +115,17 @@ static void send_mesg_to_tty (int tty_fd)
* utmp file is periodically scanned and offending users are logged
* off from the system.
*/
int main (int argc, char **argv)
int
main(int argc, char **argv)
{
int i;
int status;
pid_t pid;
int i;
int status;
pid_t pid;
struct utmp *ut;
char user[sizeof (ut->ut_user) + 1]; /* terminating NUL */
char tty_name[sizeof (ut->ut_line) + 6]; /* /dev/ + NUL */
int tty_fd;
struct utmpx *ut;
char user[sizeof (ut->ut_user) + 1]; /* terminating NUL */
char tty_name[sizeof (ut->ut_line) + 6]; /* /dev/ + NUL */
int tty_fd;
if (1 != argc) {
(void) fputs (_("Usage: logoutd\n"), stderr);
@@ -153,11 +157,10 @@ int main (int argc, char **argv)
/*
* Start syslogging everything
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
OPENLOG ("logoutd");
OPENLOG (Prog);
/*
* Scan the utmp file once per minute looking for users that
@@ -169,14 +172,14 @@ int main (int argc, char **argv)
* Attempt to re-open the utmp file. The file is only
* open while it is being used.
*/
setutent ();
setutxent();
/*
* Read all of the entries in the utmp file. The entries
* for login sessions will be checked to see if the user
* is permitted to be signed on at this time.
*/
while ((ut = getutent ()) != NULL) {
while ((ut = getutxent()) != NULL) {
if (ut->ut_type != USER_PROCESS) {
continue;
}
@@ -208,7 +211,7 @@ int main (int argc, char **argv)
tty_name[0] = '\0';
}
strncat (tty_name, ut->ut_line, UT_LINESIZE);
strncat(tty_name, ut->ut_line, NITEMS(ut->ut_line));
#ifndef O_NOCTTY
#define O_NOCTTY 0
#endif
@@ -238,7 +241,7 @@ int main (int argc, char **argv)
exit (EXIT_SUCCESS);
}
endutent ();
endutxent();
#ifndef DEBUG
sleep (60);

View File

@@ -9,7 +9,7 @@
/* Test program for the subid creation routine */
const char *Prog;
static const char Prog[] = "new_subid_range";
static void usage(void)
{
@@ -28,7 +28,6 @@ int main(int argc, char *argv[])
bool group = false; // get subuids by default
bool ok;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
while ((c = getopt(argc, argv, "gn")) != EOF) {

View File

@@ -23,7 +23,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "newgidmap";
static bool verify_range(struct passwd *pw, struct map_range *range, bool *allow_setgroups)
@@ -151,7 +151,6 @@ int main(int argc, char **argv)
struct passwd *pw;
bool allow_setgroups = false;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);

View File

@@ -31,7 +31,7 @@
/*
* Global variables
*/
const char *Prog;
static const char *Prog;
extern char **newenvp;

View File

@@ -23,7 +23,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "newuidmap";
static bool verify_range(struct passwd *pw, struct map_range *range)
{
@@ -80,7 +80,6 @@ int main(int argc, char **argv)
struct stat st;
struct passwd *pw;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);

View File

@@ -56,7 +56,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "newusers";
static bool rflg = false; /* create a system account */
#ifndef USE_PAM
@@ -1059,7 +1059,6 @@ int main (int argc, char **argv)
unsigned int nusers = 0;
#endif /* USE_PAM */
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);

View File

@@ -48,7 +48,7 @@
/*
* Global variables
*/
const char *Prog; /* Program name */
static const char Prog[] = "passwd"; /* Program name */
static char *name; /* The name of user whose password is being changed */
static char *myname; /* The current user's name */
@@ -175,9 +175,10 @@ static int new_password (const struct passwd *pw)
char *cipher; /* Pointer to cipher text */
const char *salt; /* Pointer to new salt */
char *cp; /* Pointer to agetpass() response */
char orig[200]; /* Original password */
char pass[200]; /* New password */
char orig[PASS_MAX + 1]; /* Original password */
char pass[PASS_MAX + 1]; /* New password */
int i; /* Counter for retries */
int ret;
bool warned;
int pass_max_len = -1;
const char *method;
@@ -276,8 +277,13 @@ static int new_password (const struct passwd *pw)
if (NULL == cp) {
return -1;
}
STRTCPY (pass, cp);
ret = STRTCPY (pass, cp);
erase_pass (cp);
if (ret == -1) {
(void) fputs (_("Password is too long.\n"), stderr);
MEMZERO(pass);
return -1;
}
} else {
warned = false;
for (i = getdef_num ("PASS_CHANGE_TRIES", 5); i > 0; i--) {
@@ -290,8 +296,14 @@ static int new_password (const struct passwd *pw)
if (warned && (strcmp (pass, cp) != 0)) {
warned = false;
}
STRTCPY(pass, cp);
ret = STRTCPY (pass, cp);
erase_pass (cp);
if (ret == -1) {
(void) fputs (_("Password is too long.\n"), stderr);
MEMZERO(orig);
MEMZERO(pass);
return -1;
}
if (!amroot && !obscure(orig, pass, pw)) {
(void) puts (_("Try again."));
@@ -717,11 +729,6 @@ int main (int argc, char **argv)
sanitize_env ();
/*
* Get the program name. The program name is used as a prefix to
* most error messages.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -743,7 +750,7 @@ int main (int argc, char **argv)
*/
amroot = (getuid () == 0);
OPENLOG ("passwd");
OPENLOG (Prog);
{
/*
@@ -972,7 +979,7 @@ int main (int argc, char **argv)
#ifdef WITH_SELINUX
/* only do this check when getuid()==0 because it's a pre-condition for
changing a password without entering the old one */
if (amroot && (check_selinux_permit ("passwd") != 0)) {
if (amroot && (check_selinux_permit (Prog) != 0)) {
SYSLOG ((LOG_ALERT,
"root is not authorized by SELinux to change the password of %s",
name));

View File

@@ -47,7 +47,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "pwck";
static bool use_system_pw_file = true;
static bool use_system_spw_file = true;
@@ -833,10 +833,6 @@ int main (int argc, char **argv)
int errors = 0;
bool changed = false;
/*
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -846,7 +842,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
OPENLOG ("pwck");
OPENLOG (Prog);
/* Parse the command line arguments */
process_flags (argc, argv);

View File

@@ -68,7 +68,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "pwconv";
static bool spw_locked = false;
static bool pw_locked = false;
@@ -155,7 +155,6 @@ int main (int argc, char **argv)
const struct spwd *sp;
struct spwd spent;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -165,7 +164,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
OPENLOG ("pwconv");
OPENLOG (Prog);
process_flags (argc, argv);

View File

@@ -31,7 +31,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "pwunconv";
static bool spw_locked = false;
static bool pw_locked = false;
@@ -115,7 +115,6 @@ int main (int argc, char **argv)
struct passwd pwent;
const struct spwd *spwd;
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -125,7 +124,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
OPENLOG ("pwunconv");
OPENLOG (Prog);
process_flags (argc, argv);

View File

@@ -66,7 +66,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "su";
static /*@observer@*/const char *caller_tty = NULL; /* Name of tty SU is run from */
static bool caller_is_root = false;
static uid_t caller_uid;
@@ -738,11 +738,6 @@ static void save_caller_context (char **argv)
const char *password = NULL;
#endif /* SU_ACCESS */
#endif /* !USE_PAM */
/*
* Get the program name. The program name is used as a prefix to
* most error messages.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -1018,14 +1013,14 @@ int main (int argc, char **argv)
save_caller_context (argv);
OPENLOG ("su");
OPENLOG (Prog);
process_flags (argc, argv);
initenv ();
#ifdef USE_PAM
ret = pam_start ("su", name, &conv, &pamh);
ret = pam_start (Prog, name, &conv, &pamh);
if (PAM_SUCCESS != ret) {
SYSLOG ((LOG_ERR, "pam_start: error %d", ret);
fprintf (stderr,

View File

@@ -33,7 +33,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "sulogin";
extern char **newenvp;
@@ -72,7 +72,6 @@ main(int argc, char **argv)
termio.c_lflag |= (ECHO | ECHOE | ECHOK | ICANON | ISIG);
tcsetattr (0, TCSANOW, &termio);
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");

View File

@@ -85,7 +85,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "useradd";
/*
* These defaults are used if there is no defaults file.
@@ -2485,10 +2485,6 @@ int main (int argc, char **argv)
unsigned long subuid_count = 0;
unsigned long subgid_count = 0;
/*
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -2500,7 +2496,7 @@ int main (int argc, char **argv)
prefix = process_prefix_flag("-P", argc, argv);
OPENLOG ("useradd");
OPENLOG (Prog);
#ifdef WITH_AUDIT
audit_help_open ();
#endif
@@ -2552,7 +2548,7 @@ int main (int argc, char **argv)
fail_exit (1);
}
retval = pam_start ("useradd", pampw?pampw->pw_name:"root", &conv, &pamh);
retval = pam_start (Prog, pampw?pampw->pw_name:"root", &conv, &pamh);
}
if (PAM_SUCCESS == retval) {

View File

@@ -72,7 +72,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "userdel";
static char *user_name;
static uid_t user_id;
@@ -959,10 +959,6 @@ int main (int argc, char **argv)
#endif /* USE_PAM */
#endif /* ACCT_TOOLS_SETUID */
/*
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
@@ -972,7 +968,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
prefix = process_prefix_flag ("-P", argc, argv);
OPENLOG ("userdel");
OPENLOG (Prog);
#ifdef WITH_AUDIT
audit_help_open ();
#endif /* WITH_AUDIT */
@@ -1056,7 +1052,7 @@ int main (int argc, char **argv)
exit (E_PW_UPDATE);
}
retval = pam_start ("userdel", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
}
if (PAM_SUCCESS == retval) {

View File

@@ -90,7 +90,7 @@
/*
* Global variables
*/
const char *Prog;
static const char Prog[] = "usermod";
static char *user_name;
static char *user_newname;
@@ -331,6 +331,13 @@ static struct ulong_range getulong_range(const char *str)
if (first > last)
goto out;
/*
* uid_t in linux is an unsigned int, anything over this is an invalid
* range will be later refused anyway by get_map_ranges().
*/
if (first > UINT_MAX || last > UINT_MAX)
goto out;
result.first = (unsigned long)first;
result.last = (unsigned long)last;
out:
@@ -2151,10 +2158,6 @@ int main (int argc, char **argv)
#endif /* USE_PAM */
#endif /* ACCT_TOOLS_SETUID */
/*
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -2165,7 +2168,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
prefix = process_prefix_flag ("-P", argc, argv);
OPENLOG ("usermod");
OPENLOG (Prog);
#ifdef WITH_AUDIT
audit_help_open ();
#endif
@@ -2211,7 +2214,7 @@ int main (int argc, char **argv)
exit (1);
}
retval = pam_start ("usermod", pampw->pw_name, &conv, &pamh);
retval = pam_start (Prog, pampw->pw_name, &conv, &pamh);
}
if (PAM_SUCCESS == retval) {

View File

@@ -55,7 +55,7 @@
/*
* Global variables
*/
const char *Prog;
static const char *Prog;
static const char *filename, *fileeditname;
static bool filelocked = false;
@@ -468,10 +468,12 @@ vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (void))
int main (int argc, char **argv)
{
bool editshadow = false;
bool do_vipw;
bool editshadow = false;
bool do_vigr;
Prog = Basename (argv[0]);
do_vigr = (strcmp(Basename(argv[0]), "vigr") == 0);
Prog = do_vigr ? "vigr" : "vipw";
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -481,9 +483,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
do_vipw = (strcmp (Prog, "vigr") != 0);
OPENLOG (do_vipw ? "vipw" : "vigr");
OPENLOG(Prog);
{
/*
@@ -511,13 +511,13 @@ int main (int argc, char **argv)
long_options, NULL)) != -1) {
switch (c) {
case 'g':
do_vipw = false;
do_vigr = true;
break;
case 'h':
usage (E_SUCCESS);
break;
case 'p':
do_vipw = true;
do_vigr = false;
break;
case 'q':
quiet = true;
@@ -542,7 +542,27 @@ int main (int argc, char **argv)
}
}
if (do_vipw) {
if (do_vigr) {
#ifdef SHADOWGRP
if (editshadow) {
vipwedit (sgr_dbname (), sgr_lock, sgr_unlock);
printf (MSG_WARN_EDIT_OTHER_FILE,
sgr_dbname (),
gr_dbname (),
"vigr");
} else {
#endif /* SHADOWGRP */
vipwedit (gr_dbname (), gr_lock, gr_unlock);
#ifdef SHADOWGRP
if (sgr_file_present ()) {
printf (MSG_WARN_EDIT_OTHER_FILE,
gr_dbname (),
sgr_dbname (),
"vigr -s");
}
}
#endif /* SHADOWGRP */
} else {
if (editshadow) {
#ifdef WITH_TCB
if (getdef_bool ("USE_TCB") && (NULL != user)) {
@@ -569,26 +589,6 @@ int main (int argc, char **argv)
"vipw -s");
}
}
} else {
#ifdef SHADOWGRP
if (editshadow) {
vipwedit (sgr_dbname (), sgr_lock, sgr_unlock);
printf (MSG_WARN_EDIT_OTHER_FILE,
sgr_dbname (),
gr_dbname (),
"vigr");
} else {
#endif /* SHADOWGRP */
vipwedit (gr_dbname (), gr_lock, gr_unlock);
#ifdef SHADOWGRP
if (sgr_file_present ()) {
printf (MSG_WARN_EDIT_OTHER_FILE,
gr_dbname (),
sgr_dbname (),
"vigr -s");
}
}
#endif /* SHADOWGRP */
}
nscd_flush_cache ("passwd");

View File

@@ -134,15 +134,15 @@ test_is_valid_user_name_long(void **state)
char *name;
max = sysconf(_SC_LOGIN_NAME_MAX);
name = MALLOC(max + 2, char);
name = MALLOC(max + 1, char);
assert_true(name != NULL);
memset(name, '_', max + 1);
name[max + 1] = '\0';
assert_true(false == is_valid_user_name(name));
memset(name, '_', max);
name[max] = '\0';
assert_true(false == is_valid_user_name(name));
name[max - 1] = '\0';
assert_true(is_valid_user_name(name));
free(name);