- Update to version 1.4

- Fix support for mulitple locations for configuration files
  - Drop pam-config-fix-pam_keyinit-options.patch
  - Drop pam-config-remove-bad-access-call.patch

OBS-URL: https://build.opensuse.org/package/show/Linux-PAM/pam-config?expand=0&rev=100
This commit is contained in:
Thorsten Kukuk 2021-09-07 14:19:56 +00:00 committed by Git OBS Bridge
parent feefdc5717
commit 6377d64a53
6 changed files with 12 additions and 104 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0d14da33ded8b68db5f0a22cfc6ffd32f9bf7e03d1394fc44c10cf5c3a4e9ba1
size 267476

3
pam-config-1.4.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:845cfcc57077a9c1b9aefcccedcfcb8072ecc2539433e6ef665d9caf577caae9
size 264796

View File

@ -1,42 +0,0 @@
Index: pam-config-1.3/src/mod_pam_keyinit.c
===================================================================
--- pam-config-1.3.orig/src/mod_pam_keyinit.c
+++ pam-config-1.3/src/mod_pam_keyinit.c
@@ -47,20 +47,15 @@ write_config_keyinit (pam_module_t *this
fp = create_service_file (gl_service);
if (!fp) return 0;
- fprintf(stderr, "writeit=%d, is_written=%d\n", writeit, is_written);
while (cfg_content != NULL)
{
- fprintf(stderr, "cfg_content->line = >>%s", cfg_content->line);
if (writeit)
{
- fprintf(stderr, "writeit=%d\n", writeit);
if (!is_written)
{
- fprintf(stderr, "is_written=%d\n", is_written);
/* write this entry as the first in the session part */
if (strstr(cfg_content->line, "session") != NULL)
{
- fprintf(stderr, "strstr(cfg_content->line, \"session\") != NULL\n");
write_entry(fp, opt_set);
is_written = 1;
}
@@ -97,7 +92,6 @@ write_config_keyinit (pam_module_t *this
static void
write_entry(FILE *fp, option_set_t *opt_set)
{
- fprintf(stderr, "write_entry(fp, opt_set)\n");
fprintf (fp, "session optional\tpam_keyinit.so revoke ");
if (opt_set->is_enabled (opt_set, "force"))
fprintf (fp, "force ");
@@ -121,7 +115,7 @@ PRINT_ARGS("keyinit")
PRINT_XMLHELP("keyinit")
/* ---- contruct module object ---- */
-DECLARE_BOOL_OPTS_3 (is_enabled, debug, force);
+DECLARE_BOOL_OPTS_4 (is_enabled, debug, force, revoke);
DECLARE_STRING_OPTS_0;
DECLARE_OPT_SETS;

View File

@ -1,54 +0,0 @@
Index: pam-config-1.3/src/pam-config.c
===================================================================
--- pam-config-1.3.orig/src/pam-config.c
+++ pam-config-1.3/src/pam-config.c
@@ -1075,19 +1075,10 @@ main (int argc, char *argv[])
if (debug)
printf ("*** write_config (%s/pam.d/%s)\n", confdir, gl_service);
- /* Check if service file exists */
- char *conffile;
- if (asprintf (&conffile, "%s/pam.d/%s", confdir, gl_service) < 0)
- return 1;
-
- if (access (conffile, R_OK) != 0)
- {
- fprintf (stderr, _("Cannot access '%s': %m\n"), conffile);
- free (conffile);
- return 1;
- }
- free (conffile);
-
+ /*
+ * Note that the modules in service_module_list[]
+ * do not use the "op" and the "fp" parameters.
+ */
while (*modptr != NULL)
{
retval |= (*modptr)->write_config (*modptr, -1, NULL);
Index: pam-config-1.3/src/single_config.c
===================================================================
--- pam-config-1.3.orig/src/single_config.c
+++ pam-config-1.3/src/single_config.c
@@ -245,12 +245,15 @@ create_service_file (const char *service
return NULL;
if (stat (conffile, &f_stat) != 0)
- {
- fprintf (stderr, _("Cannot stat '%s': %m\n"), conffile);
- free (tmp_file);
- free (conffile);
- return NULL;
- }
+ {
+ /* Make them owned by root and writable only by root */
+ fprintf (stderr, _("Cannot stat '%s': %m\n"), conffile);
+
+ memset(&f_stat, 0, sizeof(struct stat)); /* To be on the safe side ... */
+ f_stat.st_mode = 0644;
+ f_stat.st_uid = 0;
+ f_stat.st_gid = 0;
+ }
free (conffile);
fd = mkstemp (tmp_file);

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Sep 7 14:15:42 UTC 2021 - Thorsten Kukuk <kukuk@suse.com>
- Update to version 1.4
- Fix support for mulitple locations for configuration files
- Drop pam-config-fix-pam_keyinit-options.patch
- Drop pam-config-remove-bad-access-call.patch
-------------------------------------------------------------------
Tue Jun 8 12:46:00 UTC 2021 - Josef Möllers <josef.moellers@suse.com>

View File

@ -17,15 +17,13 @@
Name: pam-config
Version: 1.3
Version: 1.4
Release: 0
Summary: Utility to modify common PAM configuration files
License: GPL-2.0-only
Group: System/Management
URL: https://github.com/SUSE/pam-config
Source: %{name}-%{version}.tar.xz
Patch1: pam-config-remove-bad-access-call.patch
Patch2: pam-config-fix-pam_keyinit-options.patch
PreReq: pam >= 1.3.0
Recommends: pam_pwquality
@ -38,8 +36,6 @@ add/adjust/remove other PAM modules and their options.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%build
%configure