Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Simmphonie:yubico
pam-config
user_config.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File user_config.patch of Package pam-config
diff -uNr pam-config-0.88-orig/src/load_config.c pam-config-0.88-usr/src/load_config.c --- pam-config-0.88-orig/src/load_config.c 2014-08-04 10:46:25.000000000 +0200 +++ pam-config-0.88-usr/src/load_config.c 2015-09-01 11:07:04.000000000 +0200 @@ -120,8 +120,8 @@ printf ("**** [%s, %s, %s, %s]\n", type, control, module, arguments?arguments:""); - if (strcmp (type, wanted) == 0) - { + if (strcmp (type, wanted) == 0 && strcmp (control, "include") != 0) + { pam_module_t *mod = lookup (module_list, module); if (NULL != mod) diff -uNr pam-config-0.88-orig/src/write_config.c pam-config-0.88-usr/src/write_config.c --- pam-config-0.88-orig/src/write_config.c 2014-08-04 10:46:25.000000000 +0200 +++ pam-config-0.88-usr/src/write_config.c 2015-09-01 11:39:05.000000000 +0200 @@ -36,7 +36,7 @@ { const char *opc = type2string (op); struct stat f_stat; - char *tmpfname; + char *tmpfname, tmplocalname[strlen(file) + 15]; FILE *fp; int fd; int result = 0; @@ -80,6 +80,7 @@ return -1; } + strcpy (tmplocalname, file); fprintf (fp, "#%%PAM-1.0\n#\n"); fprintf (fp, "# This file is autogenerated by pam-config. All changes\n"); fprintf (fp, "# will be overwritten.\n#\n"); @@ -91,7 +92,12 @@ "# and should contain a list of the accountorization modules that define\n" "# the central access policy for use on the system. The default is to\n" "# only deny service to users whose accounts are expired.\n#\n"); - + strcat(tmplocalname, "-user-top"); + fprintf (fp, "# Create \"%s\" for user configuration\n", tmplocalname); + if (access(tmplocalname, F_OK) == 0) + fprintf (fp, "account\tinclude\t\t%s\n", tmplocalname); + else + fprintf (fp, "#account\tinclude\t\t%s\n", tmplocalname); break; case AUTH: fprintf (fp, "# Authentication-related modules common to all services\n#\n"); @@ -101,6 +107,12 @@ "# the central authentication scheme for use on the system\n" "# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the\n" "# traditional Unix authentication mechanisms.\n#\n"); + strcat(tmplocalname,"-user-top"); + fprintf (fp, "# Create \"%s\" for user configuration\n", tmplocalname); + if (access(tmplocalname, F_OK) == 0) + fprintf (fp, "auth\tinclude\t\t%s\n", tmplocalname); + else + fprintf (fp, "#auth\tinclude\t\t%s\n", tmplocalname); break; case PASSWORD: fprintf (fp, "# Password-related modules common to all services\n#\n"); @@ -108,6 +120,12 @@ "# This file is included from other service-specific PAM config files,\n" "# and should contain a list of modules that define the services to be\n" "# used to change user passwords.\n#\n"); + strcat(tmplocalname,"-user-top"); + fprintf (fp, "# Create \"%s\" for user configuration\n", tmplocalname); + if (access(tmplocalname, F_OK) == 0) + fprintf (fp, "password\tinclude\t\t%s\n", tmplocalname); + else + fprintf (fp, "#password\tinclude\t\t%s\n", tmplocalname); break; case SESSION: fprintf (fp, "# Session-related modules common to all services\n#\n"); @@ -116,6 +134,12 @@ "# and should contain a list of modules that define tasks to be performed\n" "# at the start and end of sessions of *any* kind (both interactive and\n" "# non-interactive\n#\n"); + strcat(tmplocalname,"-user-top"); + fprintf (fp, "# Create \"%s\" for user configuration\n", tmplocalname); + if (access(tmplocalname, F_OK) == 0) + fprintf (fp, "session\tinclude\t\t%s\n", tmplocalname); + else + fprintf (fp, "#session\tinclude\t\t%s\n", tmplocalname); break; } @@ -127,6 +151,42 @@ ++modptr; } + strcpy (tmplocalname, file); + switch (op) { + case ACCOUNT: + strcat(tmplocalname, "-user-bottom"); + fprintf (fp, "# Create \"%s\" for user configuration\n", tmplocalname); + if (access(tmplocalname, F_OK) == 0) + fprintf(fp, "account\tinclude\t\t%s\n", tmplocalname); + else + fprintf(fp, "#account\tinclude\t\t%s\n", tmplocalname); + break; + case AUTH: + strcat(tmplocalname, "-user-bottom"); + fprintf (fp, "# Create \"%s\" for user configuration\n", tmplocalname); + if (access(tmplocalname, F_OK) == 0) + fprintf(fp, "auth\tinclude\t\t%s\n", tmplocalname); + else + fprintf(fp, "#auth\tinclude\t\t%s\n", tmplocalname); + break; + case PASSWORD: + strcat(tmplocalname, "-user-bottom"); + fprintf (fp, "# Create \"%s\" for user configuration\n", tmplocalname); + if (access(tmplocalname, F_OK) == 0) + fprintf(fp, "password\tinclude\t\t%s\n", tmplocalname); + else + fprintf(fp, "#password\tinclude\t\t%s\n", tmplocalname); + break; + case SESSION: + strcat(tmplocalname, "-user-bottom"); + fprintf (fp, "# Create \"%s\" for user configuration\n", tmplocalname); + if (access(tmplocalname, F_OK) == 0) + fprintf(fp, "session\tinclude\t\t%s\n", tmplocalname); + else + fprintf(fp, "#session\tinclude\t\t%s\n", tmplocalname); + break; + } + fclose (fp); rename (tmpfname, file);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor