summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2003-03-22 20:48:47 +0000
committerVolker Lendecke <vlendec@samba.org>2003-03-22 20:48:47 +0000
commitba47af4ec2c6f900c86b589b53cd238fecdba1f2 (patch)
tree5f36b1dabe341cbbe717448f56c64bedc0138ef2
parent38794e945effa1b0626642ea1a80b74d9cf7e8f2 (diff)
downloadsamba-ba47af4ec2c6f900c86b589b53cd238fecdba1f2.tar.gz
samba-ba47af4ec2c6f900c86b589b53cd238fecdba1f2.tar.bz2
samba-ba47af4ec2c6f900c86b589b53cd238fecdba1f2.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 582a34efbe3c1570b852c93318ff6002954ddf6a)
-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 7cb092a9bc..9eab2863da 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -1364,23 +1364,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);
@@ -1390,15 +1392,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);