Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 148651 Details for
Bug 229755
pam_succeed_if fails when it should succeed
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Add upstream "in" and "notin" list matching feature
pam-0.77-inlist.patch (text/plain), 1.79 KB, created by
John Robinson
on 2007-02-23 08:03:10 UTC
(
hide
)
Description:
Add upstream "in" and "notin" list matching feature
Filename:
MIME Type:
Creator:
John Robinson
Created:
2007-02-23 08:03:10 UTC
Size:
1.79 KB
patch
obsolete
>--- modules/pam_succeed_if/pam_succeed_if.c.orig 2007-02-23 07:33:25.000000000 +0000 >+++ modules/pam_succeed_if/pam_succeed_if.c 2007-02-23 07:40:09.000000000 +0000 >@@ -196,6 +196,27 @@ > { > return (fnmatch(right, left, 0) != 0) ? PAM_SUCCESS : PAM_AUTH_ERR; > } >+/* Check for list match. */ >+static int >+evaluate_inlist(const char *left, const char *right) >+{ >+ char *p; >+ if ((p=strstr(right, left)) == NULL) >+ return PAM_AUTH_ERR; >+ if (p == right || *(p-1) == ':') { /* ':' is a list separator */ >+ p += strlen(left); >+ if (*p == '\0' || *p == ':') { >+ return PAM_SUCCESS; >+ } >+ } >+ return PAM_AUTH_ERR; >+} >+/* Check for list mismatch. */ >+static int >+evaluate_notinlist(const char *left, const char *right) >+{ >+ return evaluate_inlist(left, right) != PAM_SUCCESS ? PAM_SUCCESS : PAM_AUTH_ERR; >+} > /* Return PAM_SUCCESS if the user is in the group. */ > static int > evaluate_ingroup(pam_handle_t *pamh, const char *user, const char *group) >@@ -290,6 +311,13 @@ > snprintf(buf, sizeof(buf), "%s", pwd->pw_dir); > left = buf; > } >+ if (strcasecmp(left, "service") == 0) { >+ const void *svc; >+ if (pam_get_item(pamh, PAM_SERVICE, &svc) != PAM_SUCCESS) >+ svc = ""; >+ snprintf(buf, sizeof(buf), "%s", svc); >+ left = buf; >+ } > /* If we have no idea what's going on, return an error. */ > if (left != buf) { > log_error(LOG_CRIT, "unknown attribute \"%s\"", left); >@@ -344,6 +372,13 @@ > (strcasecmp(qual, "noglob") == 0)) { > return evaluate_noglob(left, right); > } >+ /* Attribute value matches item in list. */ >+ if (strcasecmp(qual, "in") == 0) { >+ return evaluate_inlist(left, right); >+ } >+ if (strcasecmp(qual, "notin") == 0) { >+ return evaluate_notinlist(left, right); >+ } > /* User is in this group. */ > if (strcasecmp(qual, "ingroup") == 0) { > return evaluate_ingroup(pamh, pwd->pw_name, right);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 229755
: 148651 |
148652