summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-08-19 08:11:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:23 -0500
commit9723edd84f90582a8cf394f45d70af6086e714a6 (patch)
tree0723996fca22ef01fd244f4fa15cacbb8565ed04 /source3/passdb
parent3ced3cd8aee4d7c9320a49fd9945977a9dcf8992 (diff)
downloadsamba-9723edd84f90582a8cf394f45d70af6086e714a6.tar.gz
samba-9723edd84f90582a8cf394f45d70af6086e714a6.tar.bz2
samba-9723edd84f90582a8cf394f45d70af6086e714a6.zip
r1906: Revert lukeh's change for primary uid/gid change. This creates a recursion
loop between uid_to_sid -> getsampwnam -> uid_to_sid. It needs further inspection. Volker (This used to be commit 67d8bc48531dd1a7d9b5db93f7d71f920a27e8fb)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 14c8c67aa3..743978919b 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -190,9 +190,7 @@ static NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd
const char *guest_account = lp_guestaccount();
GROUP_MAP map;
BOOL ret;
- DOM_SID user_sid;
- DOM_SID group_sid;
-
+
if (!account_data || !pwd) {
return NT_STATUS_INVALID_PARAMETER;
}
@@ -200,7 +198,7 @@ static NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd
/* this is a hack this thing should not be set
this way --SSS */
if (!(guest_account && *guest_account)) {
- DEBUG(1, ("pdb_set_sam_sids: NULL guest account!?!?\n"));
+ DEBUG(1, ("NULL guest account!?!?\n"));
return NT_STATUS_UNSUCCESSFUL;
} else {
/* Ensure this *must* be set right */
@@ -215,13 +213,8 @@ static NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd
}
}
- if (NT_STATUS_IS_OK(uid_to_sid(&user_sid, pwd->pw_uid))) {
- if (!pdb_set_user_sid(account_data, &user_sid, PDB_SET)) {
- DEBUG(0,("pdb_set_sam_sids: Can't set User SID from mapped UID\n"));
- return NT_STATUS_INVALID_PARAMETER;
- }
- } else if (!pdb_set_user_sid_from_rid(account_data, algorithmic_pdb_uid_to_user_rid(pwd->pw_uid), PDB_SET)) {
- DEBUG(0,("pdb_set_sam_sids: Can't set User SID from RID!\n"));
+ if (!pdb_set_user_sid_from_rid(account_data, algorithmic_pdb_uid_to_user_rid(pwd->pw_uid), PDB_SET)) {
+ DEBUG(0,("Can't set User SID from RID!\n"));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -232,18 +225,13 @@ static NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd
if( ret ) {
if (!pdb_set_group_sid(account_data, &map.sid, PDB_SET)){
- DEBUG(0,("pdb_set_sam_sids: Can't set Group SID!\n"));
+ DEBUG(0,("Can't set Group SID!\n"));
return NT_STATUS_INVALID_PARAMETER;
}
}
else {
- if (NT_STATUS_IS_OK(gid_to_sid(&group_sid, pwd->pw_gid))) {
- if (!pdb_set_group_sid(account_data, &group_sid, PDB_SET)) {
- DEBUG(0,("pdb_set_sam_sids: Can't set Group SID from mapped GID\n"));
- return NT_STATUS_INVALID_PARAMETER;
- }
- } else if (!pdb_set_group_sid_from_rid(account_data, pdb_gid_to_group_rid(pwd->pw_gid), PDB_SET)) {
- DEBUG(0,("pdb_set_sam_sids: Can't set Group SID\n"));
+ if (!pdb_set_group_sid_from_rid(account_data, pdb_gid_to_group_rid(pwd->pw_gid), PDB_SET)) {
+ DEBUG(0,("Can't set Group SID\n"));
return NT_STATUS_INVALID_PARAMETER;
}
}