s4: use intermediate var, increase lisibility
authorMatthieu Patou <mat@matws.net>
Mon, 16 Apr 2012 04:58:49 +0000 (21:58 -0700)
committerMatthieu Patou <mat@matws.net>
Sun, 6 May 2012 00:26:11 +0000 (17:26 -0700)
source4/dsdb/samdb/ldb_modules/objectclass_attrs.c

index 1fd850ab90aa0324cb1969d116c3e2aa23a9487d..1fc2752016641eb2ecd9f0342ba46c8139e6f0e9 100644 (file)
@@ -329,12 +329,11 @@ static int attr_handler2(struct oc_context *ac)
         * 3.1.1.5. Unlike other objects in the DS, TDOs may not be created or
         *  manipulated by client machines over the LDAPv3 transport."
         */
-       if (ldb_req_is_untrusted(ac->req)) {
-               for (i = 0; i < oc_element->num_values; i++) {
-                       if ((strcmp((char *)oc_element->values[i].data,
-                                   "secret") == 0) ||
-                           (strcmp((char *)oc_element->values[i].data,
-                                   "trustedDomain") == 0)) {
+       for (i = 0; i < oc_element->num_values; i++) {
+               char * attname = (char *)oc_element->values[i].data;
+               if (ldb_req_is_untrusted(ac->req)) {
+                       if (strcmp(attname, "secret") == 0 ||
+                           strcmp(attname, "trustedDomain") == 0) {
                                ldb_asprintf_errstring(ldb, "objectclass_attrs: LSA objectclasses (entry '%s') cannot be created or changed over LDAP!",
                                                       ldb_dn_get_linearized(ac->search_res->message->dn));
                                return LDB_ERR_UNWILLING_TO_PERFORM;