summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-10-02 11:11:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:52 -0500
commit9f9efc0d3bcf2ff58248a4de6a91710f5859c4ed (patch)
treedb3776857db95d456ad69ca7c71758b8b0ddd4d9 /source3/nsswitch
parent640f124ca24032446ec717c06f46fc82559653fb (diff)
downloadsamba-9f9efc0d3bcf2ff58248a4de6a91710f5859c4ed.tar.gz
samba-9f9efc0d3bcf2ff58248a4de6a91710f5859c4ed.tar.bz2
samba-9f9efc0d3bcf2ff58248a4de6a91710f5859c4ed.zip
r2779: Some fixes to pam_winbind.c.:
Allow 'require_membership_of' and 'require-membership-of'. Really use a different struct for the SID->Name lookup. Andrew Bartlett (This used to be commit 83dadcd089905aa8ff3392010177ffa1dc8237ba)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/pam_winbind.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index 9a00ac2886..9d4f0954ce 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -218,21 +218,21 @@ static int winbind_auth_request(const char *user, const char *pass, const char *
struct winbindd_request sid_request;
struct winbindd_response sid_response;
- ZERO_STRUCT(request);
- ZERO_STRUCT(response);
+ ZERO_STRUCT(sid_request);
+ ZERO_STRUCT(sid_response);
if (ctrl & WINBIND_DEBUG_ARG)
_pam_log(LOG_DEBUG, "no sid given, looking up: %s\n", member);
/* fortunatly winbindd can handle non-separated names */
- strcpy(request.data.name.name, member);
+ strcpy(sid_request.data.name.name, member);
- if (pam_winbind_request_log(WINBINDD_LOOKUPNAME, &request, &response, ctrl, user)) {
+ if (pam_winbind_request_log(WINBINDD_LOOKUPNAME, &sid_request, &sid_response, ctrl, user)) {
_pam_log(LOG_INFO, "could not lookup name: %s\n", member);
return PAM_AUTH_ERR;
}
- member = response.data.sid.sid;
+ member = sid_response.data.sid.sid;
}
strncpy(request.data.auth.require_membership_of_sid, member,
@@ -490,13 +490,14 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
/* Retrieve membership-string here */
for ( i=0; i<argc; i++ ) {
- if (!strncmp(argv[i], "require_membership_of", strlen("require_membership_of"))) {
+ if ((strncmp(argv[i], "require_membership_of", strlen("require_membership_of")) == 0)
+ || (strncmp(argv[i], "require-membership-of", strlen("require-membership-of")) == 0)) {
char *p;
char *parm = strdup(argv[i]);
if ( (p = strchr( parm, '=' )) == NULL) {
- _pam_log(LOG_INFO, "no \"=\" delimiter for \"required_membership\" found\n");
+ _pam_log(LOG_INFO, "no \"=\" delimiter for \"require_membership_of\" found\n");
break;
}