Changeset 427 for vendor/current/source3/libads/ldap.c
- Timestamp:
- Apr 9, 2010, 3:20:58 PM (15 years ago)
- File:
-
- 1 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 }
Note:
See TracChangeset
for help on using the changeset viewer.