Ver código fonte

Bug(s) fixed: 179723
Bug Description: crash after succesful pwdchange via ldappasswd
Reviewed by: Pete, Nathan (Thanks!)
Fix Description: The passwd_extop code does an internal operation to
change the password. Some of this code is only intended to be called
for external operations where you have a conn structure. The one place
in particular which caused this bug is in update_pw_info, where it is
only triggered if you must change the password or password expiration is
in effect. The fix is to just check to see if the pb_conn is not null.
Platforms tested: Fedora Core 4
Flag Day: no
Doc impact: no

Rich Megginson 20 anos atrás
pai
commit
09f55c6069
2 arquivos alterados com 4 adições e 6 exclusões
  1. 0 4
      ldap/servers/slapd/passwd_extop.c
  2. 4 2
      ldap/servers/slapd/pw.c

+ 0 - 4
ldap/servers/slapd/passwd_extop.c

@@ -135,7 +135,6 @@ passwd_modify_getEntry( const char *dn, Slapi_Entry **e2 ) {
 static int passwd_apply_mods(const char *dn, Slapi_Mods *mods) 
 {
 	Slapi_PBlock pb;
-	Slapi_Operation *operation= NULL;
 	int ret=0;
 
 	LDAPDebug( LDAP_DEBUG_TRACE, "=> passwd_apply_mods\n", 0, 0, 0 );
@@ -150,9 +149,6 @@ static int passwd_apply_mods(const char *dn, Slapi_Mods *mods)
 		  pw_get_componentID(), /* PluginID */
 		  0); /* Flags */ 
 
-	 /* Plugin operations are INTERNAL by default, bypass it to enforce ACL checks */
-	 slapi_pblock_get (&pb, SLAPI_OPERATION, &operation);
-
 	 ret =slapi_modify_internal_pb (&pb);
   
 	 slapi_pblock_get(&pb, SLAPI_PLUGIN_INTOP_RESULT, &ret);

+ 4 - 2
ldap/servers/slapd/pw.c

@@ -647,8 +647,10 @@ update_pw_info ( Slapi_PBlock *pb , char *old_pw) {
 
 	pw_apply_mods(dn, &smods);
 	slapi_mods_done(&smods);
-	/* reset c_needpw to 0 */
-	pb->pb_conn->c_needpw = 0;
+    if (pb->pb_conn) { /* no conn for internal op */
+        /* reset c_needpw to 0 */
+        pb->pb_conn->c_needpw = 0;
+    }
     return 0;
 }