From d7797744a0cc3bff5aaf3d738c6a0f881f221b4c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 21 2020 18:34:32 +0000 Subject: import passwd-0.80-3.el8 --- diff --git a/SOURCES/passwd-0.80-S-output.patch b/SOURCES/passwd-0.80-S-output.patch new file mode 100644 index 0000000..5294d5e --- /dev/null +++ b/SOURCES/passwd-0.80-S-output.patch @@ -0,0 +1,48 @@ +diff --git a/libuser.c b/libuser.c +index 7a36520..06c6200 100644 +--- a/libuser.c ++++ b/libuser.c +@@ -245,6 +245,7 @@ pwdb_display_status(const char *username) + struct lu_ent *ent; + struct lu_error *error = NULL; + char *current; ++ char *current_user; + char *realname; + const char *msg; + int shadow = 1; +@@ -268,9 +269,10 @@ pwdb_display_status(const char *username) + goto bail; + } + current = lu_ent_get_first_value_strdup(ent, LU_SHADOWPASSWORD); ++ current_user = lu_ent_get_first_value_strdup(ent, LU_USERPASSWORD); + if (current == NULL) { + shadow = 0; +- current = lu_ent_get_first_value_strdup(ent, LU_USERPASSWORD); ++ current = current_user; + } else { + sp_lstchg = (time_t) ent_value_int64(ent, LU_SHADOWLASTCHANGE); + sp_min = ent_value_int64(ent, LU_SHADOWMIN); +@@ -310,6 +312,13 @@ pwdb_display_status(const char *username) + msg = _("Password set, DES crypt."); + } + if (shadow) { ++ if (status[0] != 'N' && current_user && strlen(current_user) == 0) { ++ fprintf(stderr, "%s: %s\n", progname, ++ _("There is a password information set in /etc/shadow," ++ " but the password field in /etc/passwd is empty.")); ++ msg = _("Empty password."); ++ status = "NP"; ++ } + sp_lstchg = sp_lstchg * 24L * 3600L; + localtime_r(&sp_lstchg, &tm); + strftime(date, sizeof(date), "%Y-%m-%d", &tm); +@@ -319,6 +328,9 @@ pwdb_display_status(const char *username) + printf("%s %s (%s)\n", realname, status, msg); + } + g_free(current); ++ if (shadow && current_user) { ++ g_free(current_user); ++ } + } else { + printf(_("No password set.\n")); + } diff --git a/SOURCES/passwd-0.80-manpage.patch b/SOURCES/passwd-0.80-manpage.patch new file mode 100644 index 0000000..b14fd0d --- /dev/null +++ b/SOURCES/passwd-0.80-manpage.patch @@ -0,0 +1,48 @@ +diff --git a/man/passwd.1 b/man/passwd.1 +index 1bc2a6e..9727b88 100644 +--- a/man/passwd.1 ++++ b/man/passwd.1 +@@ -40,7 +40,7 @@ + passwd \- update user's authentication tokens + + .SH SYNOPSIS +-.B passwd [-k] [-l] [-u [-f]] [-d] [-e] [-n mindays] [-x maxdays] [-w warndays] [-i inactivedays] [-S] [--stdin] [username] ++.B passwd [-k] [-l] [-u [-f]] [-d] [-e] [-n mindays] [-x maxdays] [-w warndays] [-i inactivedays] [-S] [--stdin] [-?] [--usage] [username] + .sp 2 + .SH DESCRIPTION + The passwd utility is used to update user's authentication token(s). +@@ -82,7 +82,7 @@ function correctly. + .SH OPTIONS + + .TP +-\fB\-k\fR, \fB\-\-keep\fR ++\fB\-k\fR, \fB\-\-keep\-tokens\fR + The option + .B \-k + is used to indicate that the update should only be for expired +@@ -158,8 +158,8 @@ root only. + This will output a short information about the status of the password + for a given account. The status information consists of 7 fields. The + first field is the user's login name. The second field indicates if the +-user account has a locked password (L), has no password (NP), or has a +-usable password (P). The third field gives the date of the last password ++user account has a locked password (LK), has no password (NP), or has a ++usable password (PS). The third field gives the date of the last password + change. The next four fields are the minimum age, maximum age, warning + period, and inactivity period for the password. These ages are expressed + in days. +@@ -174,6 +174,14 @@ from the real date of the last password change by ±1 day. + .sp + This option is available to root only. + ++.TP ++\fB\-?\fR, \fB\-\-help\fR ++Print a help message and exit. ++ ++.TP ++\fB\-\-usage\fR ++Print a short usage message and exit. ++ + .SH "Remember the following two principles" + + .IP \fBProtect\ your\ password.\fR diff --git a/SPECS/passwd.spec b/SPECS/passwd.spec index dcf2d6e..8c2c973 100644 --- a/SPECS/passwd.spec +++ b/SPECS/passwd.spec @@ -7,11 +7,13 @@ Summary: An utility for setting or changing passwords using PAM Name: passwd Version: 0.80 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD or GPL+ Group: System Environment/Base URL: https://pagure.io/passwd Source: https://releases.pagure.org/passwd/passwd-%{version}.autotoolized.tar.bz2 +Patch0: passwd-0.80-manpage.patch +Patch1: passwd-0.80-S-output.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: pam >= 1.0.90, /etc/pam.d/system-auth %if %{WITH_SELINUX} @@ -34,6 +36,8 @@ Modules) library. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 -b .manpage +%patch1 -p1 -b .S-output %build %configure \ @@ -73,6 +77,11 @@ done %{_mandir}/man1/passwd.1* %changelog +* Fri Dec 13 2019 Jiri Kucera - 0.80-3 +- fix inconsistencies in manpage +- fix incorrect -S output + Resolves: #1612906, #1740168 + * Thu Apr 12 2018 Jiri Kucera - 0.80-2 - Removed autotools dependencies