Ignore:
Timestamp:
Apr 9, 2010, 3:20:58 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.5.x: update to 3.5.2

Location:
vendor/current/source3/libads
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/libads/ldap.c

    r414 r427  
    38563856                           const char **account_ou)
    38573857{
    3858         struct ldb_dn *name_dn = NULL;
    3859         const char *name = NULL;
    3860         char *ou_string = NULL;
    3861         struct ldb_context *ldb = ldb_init(mem_ctx, NULL);
    3862 
    3863         name_dn = ldb_dn_new(mem_ctx, ldb, *account_ou);
    3864         if (name_dn && ldb_dn_validate(name_dn)) {
    3865                 talloc_free(ldb);
     3858        char **exploded_dn;
     3859        const char *name;
     3860        char *ou_string;
     3861
     3862        exploded_dn = ldap_explode_dn(*account_ou, 0);
     3863        if (exploded_dn) {
     3864                ldap_value_free(exploded_dn);
    38663865                return ADS_SUCCESS;
    38673866        }
     
    38693868        ou_string = ads_ou_string(ads, *account_ou);
    38703869        if (!ou_string) {
    3871                 talloc_free(ldb);
    38723870                return ADS_ERROR_LDAP(LDAP_INVALID_DN_SYNTAX);
    38733871        }
    38743872
    3875         name_dn = ldb_dn_new_fmt(mem_ctx, ldb, "%s,%s", ou_string,
    3876                                 ads->config.bind_path);
     3873        name = talloc_asprintf(mem_ctx, "%s,%s", ou_string,
     3874                              ads->config.bind_path);
    38773875        SAFE_FREE(ou_string);
    38783876
    3879         if (!name_dn || !ldb_dn_validate(name_dn)) {
    3880                 talloc_free(ldb);
     3877        if (!name) {
     3878                return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
     3879        }
     3880
     3881        exploded_dn = ldap_explode_dn(name, 0);
     3882        if (!exploded_dn) {
    38813883                return ADS_ERROR_LDAP(LDAP_INVALID_DN_SYNTAX);
    38823884        }
    3883 
    3884         *account_ou = talloc_strdup(mem_ctx, name);
    3885         if (!*account_ou) {
    3886                 talloc_free(ldb);
    3887                 return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
    3888         }
    3889 
    3890         talloc_free(ldb);
     3885        ldap_value_free(exploded_dn);
     3886
     3887        *account_ou = name;
    38913888        return ADS_SUCCESS;
    38923889}
  • vendor/current/source3/libads/ldap_printer.c

    r414 r427  
    347347                for (i=0; i < count; i++) {
    348348                        struct regval_blob v;
    349                         DATA_BLOB blob;
    350 
    351                         result = push_spoolss_PrinterData(mem_ctx, &blob,
    352                                                           info[i].type,
    353                                                           info[i].data);
    354                         if (W_ERROR_IS_OK(result)) {
    355                                 fstrcpy(v.valuename, info[i].value_name);
    356                                 v.type = info[i].type;
    357                                 v.data_p = blob.data;
    358                                 v.size = blob.length;
    359 
    360                                 map_regval_to_ads(mem_ctx, mods, &v);
    361                         }
     349
     350                        fstrcpy(v.valuename, info[i].value_name);
     351                        v.type = info[i].type;
     352                        v.data_p = info[i].data->data;
     353                        v.size = info[i].data->length;
     354
     355                        map_regval_to_ads(mem_ctx, mods, &v);
    362356                }
    363357        }
     
    374368                for (i=0; i < count; i++) {
    375369                        struct regval_blob v;
    376                         DATA_BLOB blob = data_blob_null;
    377 
    378                         result = push_spoolss_PrinterData(mem_ctx, &blob,
    379                                                           info[i].type,
    380                                                           info[i].data);
    381                         if (W_ERROR_IS_OK(result)) {
    382                                 fstrcpy(v.valuename, info[i].value_name);
    383                                 v.type = info[i].type;
    384                                 v.data_p = blob.data;
    385                                 v.size = blob.length;
    386 
    387                                 map_regval_to_ads(mem_ctx, mods, &v);
    388                         }
     370
     371                        fstrcpy(v.valuename, info[i].value_name);
     372                        v.type = info[i].type;
     373                        v.data_p = info[i].data->data;
     374                        v.size = info[i].data->length;
     375
     376                        map_regval_to_ads(mem_ctx, mods, &v);
    389377                }
    390378        }
Note: See TracChangeset for help on using the changeset viewer.