summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2003-03-22 20:49:26 +0000
committerVolker Lendecke <vlendec@samba.org>2003-03-22 20:49:26 +0000
commit25fc7699d5a5d4391d082a8a217987aa9f1be91c (patch)
treed2e365f39997dec89c4f208110da417043e0d954 /source3
parent49c0726fca900e0b368bb25788b2a2880b093ea2 (diff)
downloadsamba-25fc7699d5a5d4391d082a8a217987aa9f1be91c.tar.gz
samba-25fc7699d5a5d4391d082a8a217987aa9f1be91c.tar.bz2
samba-25fc7699d5a5d4391d082a8a217987aa9f1be91c.zip
Never touch complicated if/else/elsif structures :-)
This repairs domain join with fully existing wks-account which I broke with my last patch... Volker (This used to be commit bc59912aa10e5000225110e48ad548f19756bed5)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_ldap.c50
1 files changed, 27 insertions, 23 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 1a5e558d7b..f02812be46 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -1365,23 +1365,25 @@ static BOOL init_ldap_from_sam (struct ldapsam_privates *ldap_state,
rid = pdb_get_user_rid(sampass);
- if ( (rid==0) && (!IS_SAM_DEFAULT(sampass, PDB_UID)) ) {
- rid = fallback_pdb_uid_to_user_rid(pdb_get_uid(sampass));
- } else if (ldap_state->permit_non_unix_accounts) {
- rid = ldapsam_get_next_available_nua_rid(ldap_state);
- if (rid == 0) {
- DEBUG(0, ("NO user RID specified on account %s, and "
- "findining next available NUA RID failed, "
- "cannot store!\n",
- pdb_get_username(sampass)));
+ if (rid == 0) {
+ if (!IS_SAM_DEFAULT(sampass, PDB_UID)) {
+ rid = fallback_pdb_uid_to_user_rid(pdb_get_uid(sampass));
+ } else if (ldap_state->permit_non_unix_accounts) {
+ rid = ldapsam_get_next_available_nua_rid(ldap_state);
+ if (rid == 0) {
+ DEBUG(0, ("NO user RID specified on account %s, and "
+ "findining next available NUA RID failed, "
+ "cannot store!\n",
+ pdb_get_username(sampass)));
+ ldap_mods_free(*mods, 1);
+ return False;
+ }
+ } else {
+ DEBUG(0, ("NO user RID specified on account %s, "
+ "cannot store!\n", pdb_get_username(sampass)));
ldap_mods_free(*mods, 1);
return False;
}
- } else {
- DEBUG(0, ("NO user RID specified on account %s, "
- "cannot store!\n", pdb_get_username(sampass)));
- ldap_mods_free(*mods, 1);
- return False;
}
slprintf(temp, sizeof(temp) - 1, "%i", rid);
@@ -1391,15 +1393,17 @@ static BOOL init_ldap_from_sam (struct ldapsam_privates *ldap_state,
rid = pdb_get_group_rid(sampass);
- if ( (rid==0) && (!IS_SAM_DEFAULT(sampass, PDB_GID)) ) {
- rid = pdb_gid_to_group_rid(pdb_get_gid(sampass));
- } else if (ldap_state->permit_non_unix_accounts) {
- rid = DOMAIN_GROUP_RID_USERS;
- } else {
- DEBUG(0, ("NO group RID specified on account %s, "
- "cannot store!\n", pdb_get_username(sampass)));
- ldap_mods_free(*mods, 1);
- return False;
+ if (rid == 0) {
+ if (!IS_SAM_DEFAULT(sampass, PDB_GID)) {
+ rid = pdb_gid_to_group_rid(pdb_get_gid(sampass));
+ } else if (ldap_state->permit_non_unix_accounts) {
+ rid = DOMAIN_GROUP_RID_USERS;
+ } else {
+ DEBUG(0, ("NO group RID specified on account %s, "
+ "cannot store!\n", pdb_get_username(sampass)));
+ ldap_mods_free(*mods, 1);
+ return False;
+ }
}
slprintf(temp, sizeof(temp) - 1, "%i", rid);