summaryrefslogtreecommitdiff
path: root/source3/auth/auth_util.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-05-28 17:03:18 -0400
committerAndrew Bartlett <abartlet@samba.org>2010-06-07 22:53:07 +1000
commitaaf45cd48ecf8e9f640a6f487b66785d47b8154a (patch)
tree8a7a8efa994b3b183e496ccd64354146053e6813 /source3/auth/auth_util.c
parentaa1a3cbad2ed62d5b59c48a6e7726eef4776f461 (diff)
downloadsamba-aaf45cd48ecf8e9f640a6f487b66785d47b8154a.tar.gz
samba-aaf45cd48ecf8e9f640a6f487b66785d47b8154a.tar.bz2
samba-aaf45cd48ecf8e9f640a6f487b66785d47b8154a.zip
s3:auth remove unused structure member
sids are now completely handled using info3, remove dead code that fills server info sids and the structure members themselves Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/auth/auth_util.c')
-rw-r--r--source3/auth/auth_util.c76
1 files changed, 1 insertions, 75 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index ea95f33a86..c9ad507e8c 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -30,34 +30,6 @@
#define DBGC_CLASS DBGC_AUTH
/****************************************************************************
- Ensure primary group SID is always at position 0 in a
- auth_serversupplied_info struct.
-****************************************************************************/
-
-static void sort_sid_array_for_smbd(struct auth_serversupplied_info *result,
- const struct dom_sid *pgroup_sid)
-{
- unsigned int i;
-
- if (!result->sids) {
- return;
- }
-
- if (sid_compare(&result->sids[0], pgroup_sid)==0) {
- return;
- }
-
- for (i = 1; i < result->num_sids; i++) {
- if (sid_compare(pgroup_sid,
- &result->sids[i]) == 0) {
- sid_copy(&result->sids[i], &result->sids[0]);
- sid_copy(&result->sids[0], pgroup_sid);
- return;
- }
- }
-}
-
-/****************************************************************************
Create a UNIX user on demand.
****************************************************************************/
@@ -567,7 +539,6 @@ NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info,
{
NTSTATUS status;
struct samu *sampass = NULL;
- gid_t *gids;
char *qualified_name = NULL;
TALLOC_CTX *mem_ctx = NULL;
struct dom_sid u_sid;
@@ -646,13 +617,13 @@ NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info,
return status;
}
+ TALLOC_FREE(sampass);
result->unix_name = talloc_strdup(result, unix_username);
result->sanitized_username = sanitize_username(result, unix_username);
if ((result->unix_name == NULL)
|| (result->sanitized_username == NULL)) {
- TALLOC_FREE(sampass);
TALLOC_FREE(result);
return NT_STATUS_NO_MEMORY;
}
@@ -660,34 +631,6 @@ NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info,
result->utok.uid = pwd->pw_uid;
result->utok.gid = pwd->pw_gid;
- status = pdb_enum_group_memberships(result, sampass,
- &result->sids, &gids,
- &result->num_sids);
-
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10, ("pdb_enum_group_memberships failed: %s\n",
- nt_errstr(status)));
- TALLOC_FREE(sampass);
- TALLOC_FREE(result);
- return status;
- }
-
- TALLOC_FREE(sampass);
-
- /* FIXME: add to info3 too ? */
- status = add_sid_to_array_unique(result, &u_sid,
- &result->sids,
- &result->num_sids);
- if (!NT_STATUS_IS_OK(status)) {
- TALLOC_FREE(result);
- return status;
- }
-
- /* For now we throw away the gids and convert via sid_to_gid
- * later. This needs fixing, but I'd like to get the code straight and
- * simple first. */
- TALLOC_FREE(gids);
-
*server_info = result;
return NT_STATUS_OK;
@@ -1189,23 +1132,6 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
result->utok.uid = uid;
result->utok.gid = gid;
- /* Create a 'combined' list of all SIDs we might want in the SD */
-
- result->num_sids = 0;
- result->sids = NULL;
-
- nt_status = sid_array_from_info3(result, info3,
- &result->sids,
- &result->num_sids,
- false, false);
- if (!NT_STATUS_IS_OK(nt_status)) {
- TALLOC_FREE(result);
- return nt_status;
- }
-
- /* Ensure the primary group sid is at position 0. */
- sort_sid_array_for_smbd(result, &group_sid);
-
/* ensure we are never given NULL session keys */
if (memcmp(info3->base.key.key, zeros, sizeof(zeros)) == 0) {