Changeset 427 for vendor/current/source3/libads
- Timestamp:
- Apr 9, 2010, 3:20:58 PM (15 years ago)
- Location:
- vendor/current/source3/libads
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/libads/ldap.c
r414 r427 3856 3856 const char **account_ou) 3857 3857 { 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); 3866 3865 return ADS_SUCCESS; 3867 3866 } … … 3869 3868 ou_string = ads_ou_string(ads, *account_ou); 3870 3869 if (!ou_string) { 3871 talloc_free(ldb);3872 3870 return ADS_ERROR_LDAP(LDAP_INVALID_DN_SYNTAX); 3873 3871 } 3874 3872 3875 name _dn = ldb_dn_new_fmt(mem_ctx, ldb, "%s,%s", ou_string,3876 3873 name = talloc_asprintf(mem_ctx, "%s,%s", ou_string, 3874 ads->config.bind_path); 3877 3875 SAFE_FREE(ou_string); 3878 3876 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) { 3881 3883 return ADS_ERROR_LDAP(LDAP_INVALID_DN_SYNTAX); 3882 3884 } 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; 3891 3888 return ADS_SUCCESS; 3892 3889 } -
vendor/current/source3/libads/ldap_printer.c
r414 r427 347 347 for (i=0; i < count; i++) { 348 348 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); 362 356 } 363 357 } … … 374 368 for (i=0; i < count; i++) { 375 369 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); 389 377 } 390 378 }
Note:
See TracChangeset
for help on using the changeset viewer.