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 150138 Details for
Bug 232377
PAM passthru ENTRY method not working
[?]
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]
diffs
cvsdiffs (text/plain), 9.93 KB, created by
Rich Megginson
on 2007-03-15 16:40:39 UTC
(
hide
)
Description:
diffs
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2007-03-15 16:40:39 UTC
Size:
9.93 KB
patch
obsolete
>Index: ldapserver/ldap/servers/plugins/pam_passthru/README >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pam_passthru/README,v >retrieving revision 1.5 >diff -u -8 -r1.5 README >--- ldapserver/ldap/servers/plugins/pam_passthru/README 15 Sep 2006 21:20:36 -0000 1.5 >+++ ldapserver/ldap/servers/plugins/pam_passthru/README 15 Mar 2007 16:33:19 -0000 >@@ -205,12 +205,21 @@ > pamFallback: FALSE > pamSecure: TRUE > pamService: ldapserver > > Make sure there is a blank line at the end. The line with > o=NetscapeRoot may be omitted if this is not a configuration DS. Then > restart slapd. > >+Testing >+ >+I find it convenient to just test against regular /etc/passwd accounts. >+0) Create a server instance with suffix dc=example,dc=com and load the Example.ldif file >+1) cd /etc/pam.d >+2) cp system-auth ldapserver (make sure ldapserver is readable by nobody or whatever your ldap server account is) >+3) useradd scarter (or any uid from Example.ldif) >+4) Make sure /etc/shadow is readable by nobody or whatever your ldap server account is >+ > See Also > PAM API for Linux http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam_appl.html > PAM API for Solaris Writing PAM Applications and Services from the Solaris Security for Developers Guide http://docs.sun.com/app/docs/doc/816-4863/6mb20lvfh?a=view > PAM API for HP-UX http://docs.hp.com/en/B2355-60103/pam.3.html >Index: ldapserver/ldap/servers/plugins/pam_passthru/pam_ptconfig.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pam_passthru/pam_ptconfig.c,v >retrieving revision 1.8 >diff -u -8 -r1.8 pam_ptconfig.c >--- ldapserver/ldap/servers/plugins/pam_passthru/pam_ptconfig.c 10 Nov 2006 23:45:03 -0000 1.8 >+++ ldapserver/ldap/servers/plugins/pam_passthru/pam_ptconfig.c 15 Mar 2007 16:33:19 -0000 >@@ -261,17 +261,33 @@ > PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, > "Invalid extra text [%s] after last map method", > ((ptr && *ptr) ? *ptr : "(null)")); > return LDAP_UNWILLING_TO_PERFORM; > } > > return err; > } >- >+ >+static void >+print_suffixes() >+{ >+ void *cookie = NULL; >+ Slapi_DN *sdn = NULL; >+ slapi_log_error(SLAPI_LOG_FATAL, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, >+ "The following is the list of valid suffixes to use with " >+ PAMPT_EXCLUDES_ATTR " and " PAMPT_INCLUDES_ATTR ":\n"); >+ for (sdn = slapi_get_first_suffix(&cookie, 1); >+ sdn && cookie; >+ sdn = slapi_get_next_suffix(&cookie, 1)) { >+ slapi_log_error(SLAPI_LOG_FATAL, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, >+ "\t%s\n", slapi_sdn_get_dn(sdn)); >+ } >+} >+ > /* > Validate the pending changes in the e entry. > */ > static int > pam_passthru_validate_config (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, > int *returncode, char *returntext, void *arg) > { > char *missing_suffix_str = NULL; >@@ -290,54 +306,52 @@ > PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, > "Error: valid values for %s are %s", > PAMPT_MISSING_SUFFIX_ATTR, get_missing_suffix_values()); > goto done; > } > > if (missing_suffix != PAMPT_MISSING_SUFFIX_IGNORE) { > char **missing_list = NULL; >- Slapi_DN *comp_dn = slapi_sdn_new(); > > /* get the list of excluded suffixes */ > excludes = slapi_entry_attr_get_charray(e, PAMPT_EXCLUDES_ATTR); > for (ii = 0; excludes && excludes[ii]; ++ii) { >- slapi_sdn_init_dn_byref(comp_dn, excludes[ii]); >+ Slapi_DN *comp_dn = slapi_sdn_new_dn_byref(excludes[ii]); > if (!slapi_be_exist(comp_dn)) { > charray_add(&missing_list, slapi_ch_strdup(excludes[ii])); > } >- slapi_sdn_done(comp_dn); >+ slapi_sdn_free(&comp_dn); > } > > /* get the list of included suffixes */ > includes = slapi_entry_attr_get_charray(e, PAMPT_INCLUDES_ATTR); > for (ii = 0; includes && includes[ii]; ++ii) { >- slapi_sdn_init_dn_byref(comp_dn, includes[ii]); >+ Slapi_DN *comp_dn = slapi_sdn_new_dn_byref(includes[ii]); > if (!slapi_be_exist(comp_dn)) { > charray_add(&missing_list, slapi_ch_strdup(includes[ii])); > } >- slapi_sdn_done(comp_dn); >+ slapi_sdn_free(&comp_dn); > } > >- slapi_sdn_free(&comp_dn); >- > if (missing_list) { > PRUint32 size = > PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, > "The following suffixes listed in %s or %s are not present in this " > "server: ", PAMPT_EXCLUDES_ATTR, PAMPT_INCLUDES_ATTR); > for (ii = 0; missing_list[ii]; ++ii) { > if (size < SLAPI_DSE_RETURNTEXT_SIZE) { > size += PR_snprintf(returntext+size, SLAPI_DSE_RETURNTEXT_SIZE-size, > "%s%s", (ii > 0) ? "; " : "", > missing_list[ii]); > } > } > slapi_ch_array_free(missing_list); > missing_list = NULL; >+ print_suffixes(); > if (missing_suffix != PAMPT_MISSING_SUFFIX_ERROR) { > slapi_log_error(SLAPI_LOG_FATAL, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, > "Warning: %s\n", returntext); > *returntext = 0; /* log error, don't report back to user */ > } else { > goto done; > } > } >@@ -393,18 +407,17 @@ > } > > static Pam_PassthruSuffix * > New_Pam_PassthruSuffix(char *suffix) > { > Pam_PassthruSuffix *newone = NULL; > if (suffix) { > newone = (Pam_PassthruSuffix *)slapi_ch_malloc(sizeof(Pam_PassthruSuffix)); >- newone->pamptsuffix_dn = slapi_sdn_new(); >- slapi_sdn_init_dn_byval(newone->pamptsuffix_dn, suffix); >+ newone->pamptsuffix_dn = slapi_sdn_new_dn_byval(suffix); > newone->pamptsuffix_next = NULL; > } > return newone; > } > > static Pam_PassthruSuffix * > pam_ptconfig_add_suffixes(char **str_list) > { >@@ -527,18 +540,17 @@ > > int > pam_passthru_check_suffix(Pam_PassthruConfig *cfg, char *binddn) > { > Slapi_DN *comp_dn; > Pam_PassthruSuffix *try; > int ret = LDAP_SUCCESS; > >- comp_dn = slapi_sdn_new(); >- slapi_sdn_init_dn_byref(comp_dn, binddn); >+ comp_dn = slapi_sdn_new_dn_byref(binddn); > > slapi_lock_mutex(cfg->lock); > if (!cfg->pamptconfig_includes && !cfg->pamptconfig_excludes) { > goto done; /* NULL means allow */ > } > > /* exclude trumps include - if suffix is on exclude list, then > deny */ >Index: ldapserver/ldap/servers/plugins/pam_passthru/pam_ptpreop.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pam_passthru/pam_ptpreop.c,v >retrieving revision 1.6 >diff -u -8 -r1.6 pam_ptpreop.c >--- ldapserver/ldap/servers/plugins/pam_passthru/pam_ptpreop.c 10 Nov 2006 23:45:03 -0000 1.6 >+++ ldapserver/ldap/servers/plugins/pam_passthru/pam_ptpreop.c 15 Mar 2007 16:33:20 -0000 >@@ -80,16 +80,19 @@ > int > pam_passthruauth_init( Slapi_PBlock *pb ) > { > PAM_PASSTHRU_ASSERT( pb != NULL ); > > slapi_log_error( SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, > "=> pam_passthruauth_init\n" ); > >+ slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &pam_passthruauth_plugin_identity); >+ PR_ASSERT (pam_passthruauth_plugin_identity); >+ > if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, > (void *)SLAPI_PLUGIN_VERSION_01 ) != 0 > || slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, > (void *)&pdesc ) != 0 > || slapi_pblock_set( pb, SLAPI_PLUGIN_START_FN, > (void *)pam_passthru_bindpreop_start ) != 0 > || slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_BIND_FN, > (void *)pam_passthru_bindpreop ) != 0 >Index: ldapserver/ldap/servers/slapd/backend_manager.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/backend_manager.c,v >retrieving revision 1.7 >diff -u -8 -r1.7 backend_manager.c >--- ldapserver/ldap/servers/slapd/backend_manager.c 10 Nov 2006 23:45:40 -0000 1.7 >+++ ldapserver/ldap/servers/slapd/backend_manager.c 15 Mar 2007 16:33:20 -0000 >@@ -75,16 +75,20 @@ > PR_ASSERT(i<maxbackends); > > be = (Slapi_Backend *) slapi_ch_calloc(1, sizeof(Slapi_Backend)); > be->be_lock = PR_NewRWLock(PR_RWLOCK_RANK_NONE, name ); > be_init( be, type, name, isprivate, logchanges, defsize, deftime ); > > backends[i] = be; > nbackends++; >+ >+ slapi_log_error(SLAPI_LOG_TRACE, "slapi_be_new", >+ "Added new backend name [%s] type [%s] nbackends [%d]\n", >+ name, type, nbackends); > return( be ); > } > > void > slapi_be_stopping (Slapi_Backend *be) > { > int i; > >Index: ldapserver/ldap/servers/slapd/mapping_tree.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/mapping_tree.c,v >retrieving revision 1.8 >diff -u -8 -r1.8 mapping_tree.c >--- ldapserver/ldap/servers/slapd/mapping_tree.c 14 Dec 2006 23:16:54 -0000 1.8 >+++ ldapserver/ldap/servers/slapd/mapping_tree.c 15 Mar 2007 16:33:23 -0000 >@@ -319,16 +319,22 @@ > /* We use this count of the rdn components in the mapping tree to help > * when selecting a mapping tree node for a dn. */ > slapi_rdn_init_sdn(&rdn,dn); > slapi_rdn_done(&rdn); > node->mtn_dstr_plg_lib = plg_lib; > node->mtn_dstr_plg_name = plg_fct; > node->mtn_dstr_plg = plg; > >+ slapi_log_error(SLAPI_LOG_TRACE, "mapping_tree", >+ "Created new mapping tree node for suffix [%s] backend [%s] [%p]\n", >+ slapi_sdn_get_dn(dn), >+ backend_names && backend_names[0] ? backend_names[0] : "null", >+ be ? be[0] : NULL); >+ > return node; > } > > /* > * Description: > * Adds a mapping tree node to the child list of another mapping tree node. > * > * Arguments: >Index: ldapserver/ldap/servers/slapd/back-ldbm/instance.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/instance.c,v >retrieving revision 1.6 >diff -u -8 -r1.6 instance.c >--- ldapserver/ldap/servers/slapd/back-ldbm/instance.c 7 Mar 2007 21:54:03 -0000 1.6 >+++ ldapserver/ldap/servers/slapd/back-ldbm/instance.c 15 Mar 2007 16:33:23 -0000 >@@ -273,16 +273,17 @@ > while (inst_obj != NULL) { > int rc1; > inst = (ldbm_instance *) object_get_data(inst_obj); > rc1 = ldbm_instance_start(inst->inst_be); > if (rc1 != 0) { > rc = rc1; > } else { > vlv_init(inst); >+ slapi_mtn_be_started(inst->inst_be); > } > inst_obj = objset_next_obj(li->li_instance_set, inst_obj); > } > > return rc; > } > >
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 232377
: 150138 |
150148