[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-2331-g9e5b732

Günther Deschner gd at samba.org
Sun Feb 17 01:15:50 GMT 2008


The branch, v3-2-test has been updated
       via  9e5b732d451f6a2f09d2a71e5a3aec59c771db01 (commit)
       via  92fca97951bf7adf8caaeabdaff21682b18dd91f (commit)
       via  d9502eb75395131d5a8130ff2c4ebace106cb974 (commit)
       via  df90a37c3e765faf69a77522d58e3a5f7f70b418 (commit)
       via  f22ba8aee2ff90e9e34db066d506fec24c52379f (commit)
       via  ea609d1b0e82d7c366dd73013228003136264b64 (commit)
       via  3b0135d57e1e70175a5eec49b603a2e5f700c770 (commit)
       via  5483f5fb44bb2138a1348c05845a2b8f3588697a (commit)
       via  c06e507737bb07ff995876e49341de3f60b0da35 (commit)
       via  bf860ae1ac6765b1eb6e2ca9b667b19b4e661fda (commit)
       via  5866c11b288c217f0c38240c44f8bfeff185890d (commit)
       via  c55160f8e866d9b24a4dad234af78ae46c236a37 (commit)
       via  06095e8c705fc292323fa8d0110ae3aaeccab949 (commit)
      from  5095c59f8930212c20a0713464c9620220388aeb (commit)

http://gitweb.samba.org/?samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 9e5b732d451f6a2f09d2a71e5a3aec59c771db01
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 02:10:43 2008 +0100

    Finally let our samlogon routines call rpccli_netr_LogonSamLogon internally and
    return netr_SamInfo3.
    
    Guenther

commit 92fca97951bf7adf8caaeabdaff21682b18dd91f
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 02:09:35 2008 +0100

    Use netr_SamInfo3 in remaining places.
    
    Guenther

commit d9502eb75395131d5a8130ff2c4ebace106cb974
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 02:08:12 2008 +0100

    Use netr_SamInfo3 everywhere in winbindd.
    
    Guenther

commit df90a37c3e765faf69a77522d58e3a5f7f70b418
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 02:06:17 2008 +0100

    Add some more samlogon related netlogon init functions.
    
    Guenther

commit f22ba8aee2ff90e9e34db066d506fec24c52379f
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 02:04:52 2008 +0100

    Getting rid of net_io_user_info3() when sending an NDR encoded netr_SamInfo3.
    
    Guenther

commit ea609d1b0e82d7c366dd73013228003136264b64
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 02:01:30 2008 +0100

    Fix some more callers of PAC_DATA.
    
    Guenther

commit 3b0135d57e1e70175a5eec49b603a2e5f700c770
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 01:59:02 2008 +0100

    Use new IDL based PAC structures in clikrb5.c
    
    Guenther

commit 5483f5fb44bb2138a1348c05845a2b8f3588697a
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 01:57:57 2008 +0100

    Some more cleanup in authdata.c.
    
    Guenther

commit c06e507737bb07ff995876e49341de3f60b0da35
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 01:57:20 2008 +0100

    Align our krb5 PAC decoding routines to the samba4 ones.
    
    (while keeping all the trans krb5 lib support)
    
    Guenther

commit bf860ae1ac6765b1eb6e2ca9b667b19b4e661fda
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 01:47:01 2008 +0100

    Use netr_SamInfo3 in samlogon cache and use ndr functions for storing the blob.
    
    Guenther

commit 5866c11b288c217f0c38240c44f8bfeff185890d
Author: Günther Deschner <gd at samba.org>
Date:   Sat Feb 16 19:08:22 2008 +0100

    Use netr_SamInfo3 in make_server_info_info3().
    
    Guenther

commit c55160f8e866d9b24a4dad234af78ae46c236a37
Author: Günther Deschner <gd at samba.org>
Date:   Sat Feb 16 18:55:08 2008 +0100

    Use new structs in reply_spnego_kerberos().
    
    Guenther

commit 06095e8c705fc292323fa8d0110ae3aaeccab949
Author: Günther Deschner <gd at samba.org>
Date:   Sat Feb 16 18:51:01 2008 +0100

    Use netr_SamInfo3 in sid_array_from_info3.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source/Makefile.in                |   16 +-
 source/auth/auth_domain.c         |   10 +-
 source/auth/auth_util.c           |   52 +-
 source/include/includes.h         |    9 +-
 source/lib/util_sid.c             |   30 +-
 source/libads/authdata.c          | 1086 ++++++++-----------------------------
 source/libads/kerberos_verify.c   |    2 +-
 source/libsmb/clikrb5.c           |   14 +-
 source/libsmb/samlogon_cache.c    |  217 ++++----
 source/passdb/passdb.c            |    2 +-
 source/passdb/pdb_get_set.c       |    2 +-
 source/rpc_client/cli_netlogon.c  |  353 ++++++++-----
 source/rpc_client/init_netlogon.c |   71 +++
 source/smbd/sesssetup.c           |   11 +-
 source/utils/net_ads.c            |    8 +-
 source/utils/ntlm_auth.c          |    2 +-
 source/winbindd/winbindd_ads.c    |   10 +-
 source/winbindd/winbindd_cache.c  |    2 +-
 source/winbindd/winbindd_creds.c  |   14 +-
 source/winbindd/winbindd_pam.c    |  237 ++++-----
 source/winbindd/winbindd_rpc.c    |   14 +-
 source/winbindd/winbindd_util.c   |   18 +-
 22 files changed, 856 insertions(+), 1324 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index a1b8089..c0e4578 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -297,6 +297,9 @@ RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
 RPC_PARSE_OBJ1 = $(RPC_PARSE_OBJ0) rpc_parse/parse_sec.o
 
 RPC_PARSE_OBJ2 = rpc_parse/parse_rpc.o rpc_parse/parse_net.o rpc_parse/parse_srv.o
+RPC_PARSE_OBJ2 = rpc_parse/parse_rpc.o rpc_parse/parse_net.o rpc_parse/parse_srv.o \
+		 rpc_client/init_netlogon.o \
+		 rpc_client/init_lsa.o
 
 LIBREPLACE_OBJ = @LIBREPLACE_OBJS@
 
@@ -412,9 +415,7 @@ LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \
 	       $(RPC_CLIENT_OBJ1) rpc_client/cli_reg.o $(RPC_CLIENT_OBJ) \
 	       rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o  \
 	       rpc_client/cli_svcctl.o \
-	       rpc_client/init_samr.o \
-	       rpc_client/init_lsa.o \
-	       rpc_client/init_netlogon.o
+	       rpc_client/init_samr.o
 
 LIBMSRPC_GEN_OBJ = librpc/gen_ndr/cli_lsa.o \
 		   librpc/gen_ndr/cli_dfs.o \
@@ -1049,10 +1050,13 @@ NTLM_AUTH_OBJ1 = utils/ntlm_auth.o utils/ntlm_auth_diagnostics.o
 
 NTLM_AUTH_OBJ = ${NTLM_AUTH_OBJ1} $(LIBSAMBA_OBJ) $(POPT_LIB_OBJ) \
 		libsmb/asn1.o libsmb/spnego.o libsmb/clikrb5.o libads/kerberos.o \
-		libads/kerberos_verify.o $(SECRETS_OBJ) $(SERVER_MUTEX_OBJ) \
-		libads/authdata.o $(RPC_PARSE_OBJ1) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
+		$(SECRETS_OBJ) $(SERVER_MUTEX_OBJ) $(LIBADS_SERVER_OBJ) \
+		$(RPC_PARSE_OBJ1) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
 		$(SMBLDAP_OBJ) $(DOSERR_OBJ) rpc_parse/parse_net.o $(LIBNMB_OBJ) \
-		$(LDB_OBJ) $(ERRORMAP_OBJ) $(WBCOMMON_OBJ) @LIBWBCLIENT_STATIC@
+		$(LDB_OBJ) $(ERRORMAP_OBJ) $(WBCOMMON_OBJ) @LIBWBCLIENT_STATIC@ \
+		librpc/gen_ndr/ndr_samr.o \
+		librpc/gen_ndr/ndr_lsa.o \
+		librpc/gen_ndr/ndr_netlogon.o
 
 
 VLP_OBJ1 = ../testsuite/printing/vlp.o $(RPC_CLIENT_OBJ1) $(RPC_PARSE_OBJ2) $(RPC_CLIENT_OBJ)
diff --git a/source/auth/auth_domain.c b/source/auth/auth_domain.c
index 40a2985..df51966 100644
--- a/source/auth/auth_domain.c
+++ b/source/auth/auth_domain.c
@@ -189,7 +189,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
 					struct sockaddr_storage *dc_ss)
 
 {
-	NET_USER_INFO_3 info3;
+	struct netr_SamInfo3 *info3 = NULL;
 	struct cli_state *cli = NULL;
 	struct rpc_pipe_client *netlogon_pipe = NULL;
 	NTSTATUS nt_status = NT_STATUS_NO_LOGON_SERVERS;
@@ -227,8 +227,6 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
 
 	saf_store( domain, cli->desthost );
 
-	ZERO_STRUCT(info3);
-
         /*
          * If this call succeeds, we now have lots of info about the user
          * in the info3 structure.  
@@ -267,7 +265,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
 						user_info->smb_name,
 						domain,
 						server_info,
-						&info3);
+						info3);
 
 		if (NT_STATUS_IS_OK(nt_status)) {
 			if (user_info->was_mapped) {
@@ -281,12 +279,14 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
 				if (  !NT_STATUS_IS_OK(nt_status)) {
 					DEBUG(1, ("PAM account restriction prevents user login\n"));
 					cli_shutdown(cli);
+					TALLOC_FREE(info3);
 					return nt_status;
 				}
 			}
 		}
 
-		netsamlogon_cache_store( user_info->smb_name, &info3 );
+		netsamlogon_cache_store(user_info->smb_name, info3);
+		TALLOC_FREE(info3);
 	}
 
 	/* Note - once the cli stream is shutdown the mem_ctx used
diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c
index 6efd31d..a95a59e 100644
--- a/source/auth/auth_util.c
+++ b/source/auth/auth_util.c
@@ -1422,7 +1422,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
 				const char *sent_nt_username,
 				const char *domain,
 				auth_serversupplied_info **server_info, 
-				NET_USER_INFO_3 *info3) 
+				struct netr_SamInfo3 *info3)
 {
 	char zeros[16];
 
@@ -1446,23 +1446,25 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
 	   matches.
 	*/
 
-	sid_copy(&user_sid, &info3->dom_sid.sid);
-	if (!sid_append_rid(&user_sid, info3->user_rid)) {
+	sid_copy(&user_sid, info3->base.domain_sid);
+	if (!sid_append_rid(&user_sid, info3->base.rid)) {
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 	
-	sid_copy(&group_sid, &info3->dom_sid.sid);
-	if (!sid_append_rid(&group_sid, info3->group_rid)) {
+	sid_copy(&group_sid, info3->base.domain_sid);
+	if (!sid_append_rid(&group_sid, info3->base.primary_gid)) {
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
-	if (!(nt_username = unistr2_to_ascii_talloc(mem_ctx, &(info3->uni_user_name)))) {
+	nt_username = talloc_strdup(mem_ctx, info3->base.account_name.string);
+	if (!nt_username) {
 		/* If the server didn't give us one, just use the one we sent
 		 * them */
 		nt_username = sent_nt_username;
 	}
 
-	if (!(nt_domain = unistr2_to_ascii_talloc(mem_ctx, &(info3->uni_logon_dom)))) {
+	nt_domain = talloc_strdup(mem_ctx, info3->base.domain.string);
+	if (!nt_domain) {
 		/* If the server didn't give us one, just use the one we sent
 		 * them */
 		nt_domain = domain;
@@ -1527,50 +1529,50 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
 		TALLOC_FREE(sam_account);
 		return NT_STATUS_UNSUCCESSFUL;
 	}
-		
+
 	if (!pdb_set_fullname(sam_account,
-			      unistr2_static(&(info3->uni_full_name)), 
+			      info3->base.full_name.string,
 			      PDB_CHANGED)) {
 		TALLOC_FREE(sam_account);
 		return NT_STATUS_NO_MEMORY;
 	}
 
 	if (!pdb_set_logon_script(sam_account,
-				  unistr2_static(&(info3->uni_logon_script)),
+				  info3->base.logon_script.string,
 				  PDB_CHANGED)) {
 		TALLOC_FREE(sam_account);
 		return NT_STATUS_NO_MEMORY;
 	}
 
 	if (!pdb_set_profile_path(sam_account,
-				  unistr2_static(&(info3->uni_profile_path)),
+				  info3->base.profile_path.string,
 				  PDB_CHANGED)) {
 		TALLOC_FREE(sam_account);
 		return NT_STATUS_NO_MEMORY;
 	}
 
 	if (!pdb_set_homedir(sam_account,
-			     unistr2_static(&(info3->uni_home_dir)),
+			     info3->base.home_directory.string,
 			     PDB_CHANGED)) {
 		TALLOC_FREE(sam_account);
 		return NT_STATUS_NO_MEMORY;
 	}
 
 	if (!pdb_set_dir_drive(sam_account,
-			       unistr2_static(&(info3->uni_dir_drive)),
+			       info3->base.home_drive.string,
 			       PDB_CHANGED)) {
 		TALLOC_FREE(sam_account);
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	if (!pdb_set_acct_ctrl(sam_account, info3->acct_flags, PDB_CHANGED)) {
+	if (!pdb_set_acct_ctrl(sam_account, info3->base.acct_flags, PDB_CHANGED)) {
 		TALLOC_FREE(sam_account);
 		return NT_STATUS_NO_MEMORY;
 	}
 
 	if (!pdb_set_pass_last_set_time(
 		    sam_account,
-		    nt_time_to_unix(info3->pass_last_set_time),
+		    nt_time_to_unix(info3->base.last_password_change),
 		    PDB_CHANGED)) {
 		TALLOC_FREE(sam_account);
 		return NT_STATUS_NO_MEMORY;
@@ -1578,7 +1580,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
 
 	if (!pdb_set_pass_can_change_time(
 		    sam_account,
-		    nt_time_to_unix(info3->pass_can_change_time),
+		    nt_time_to_unix(info3->base.allow_password_change),
 		    PDB_CHANGED)) {
 		TALLOC_FREE(sam_account);
 		return NT_STATUS_NO_MEMORY;
@@ -1586,7 +1588,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
 
 	if (!pdb_set_pass_must_change_time(
 		    sam_account,
-		    nt_time_to_unix(info3->pass_must_change_time),
+		    nt_time_to_unix(info3->base.force_password_change),
 		    PDB_CHANGED)) {
 		TALLOC_FREE(sam_account);
 		return NT_STATUS_NO_MEMORY;
@@ -1624,27 +1626,27 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
 		return nt_status;
 	}
 
-	result->login_server = unistr2_to_ascii_talloc(result, 
-					    &(info3->uni_logon_srv));
+	result->login_server = talloc_strdup(result,
+					     info3->base.logon_server.string);
 
 	/* ensure we are never given NULL session keys */
 
 	ZERO_STRUCT(zeros);
 
-	if (memcmp(info3->user_sess_key, zeros, sizeof(zeros)) == 0) {
+	if (memcmp(info3->base.key.key, zeros, sizeof(zeros)) == 0) {
 		result->user_session_key = data_blob_null;
 	} else {
 		result->user_session_key = data_blob_talloc(
-			result, info3->user_sess_key,
-			sizeof(info3->user_sess_key));
+			result, info3->base.key.key,
+			sizeof(info3->base.key.key));
 	}
 
-	if (memcmp(info3->lm_sess_key, zeros, 8) == 0) {
+	if (memcmp(info3->base.LMSessKey.key, zeros, 8) == 0) {
 		result->lm_session_key = data_blob_null;
 	} else {
 		result->lm_session_key = data_blob_talloc(
-			result, info3->lm_sess_key,
-			sizeof(info3->lm_sess_key));
+			result, info3->base.LMSessKey.key,
+			sizeof(info3->base.LMSessKey.key));
 	}
 
 	result->was_mapped = username_was_mapped;
diff --git a/source/include/includes.h b/source/include/includes.h
index 041c431..02edbb0 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -1170,15 +1170,15 @@ bool kerberos_compatible_enctypes(krb5_context context, krb5_enctype enctype1, k
 void kerberos_free_data_contents(krb5_context context, krb5_data *pdata);
 NTSTATUS decode_pac_data(TALLOC_CTX *mem_ctx,
 			 DATA_BLOB *pac_data_blob,
-			 krb5_context context, 
+			 krb5_context context,
 			 krb5_keyblock *service_keyblock,
 			 krb5_const_principal client_principal,
 			 time_t tgs_authtime,
-			 PAC_DATA **pac_data);
+			 struct PAC_DATA **pac_data_out);
 void smb_krb5_checksum_from_pac_sig(krb5_checksum *cksum, 
-				    PAC_SIGNATURE_DATA *sig);
+				    struct PAC_SIGNATURE_DATA *sig);
 krb5_error_code smb_krb5_verify_checksum(krb5_context context,
-					 krb5_keyblock *keyblock,
+					 const krb5_keyblock *keyblock,
 					 krb5_keyusage usage,
 					 krb5_checksum *cksum,
 					 uint8 *data,
@@ -1206,7 +1206,6 @@ bool smb_krb5_principal_compare_any_realm(krb5_context context,
 					  krb5_const_principal princ2);
 int cli_krb5_get_ticket(const char *principal, time_t time_offset, 
 			DATA_BLOB *ticket, DATA_BLOB *session_key_krb5, uint32 extra_ap_opts, const char *ccname, time_t *tgs_expire);
-PAC_LOGON_INFO *get_logon_info_from_pac(PAC_DATA *pac_data);
 krb5_error_code smb_krb5_renew_ticket(const char *ccache_string, const char *client_string, const char *service_string, time_t *expire_time);
 krb5_error_code kpasswd_err_to_krb5_err(krb5_error_code res_code);
 krb5_error_code smb_krb5_gen_netbios_krb5_address(smb_krb5_addresses **kerb_addr);
diff --git a/source/lib/util_sid.c b/source/lib/util_sid.c
index 3786523..fd2e93a 100644
--- a/source/lib/util_sid.c
+++ b/source/lib/util_sid.c
@@ -665,7 +665,7 @@ bool is_null_sid(const DOM_SID *sid)
 }
 
 NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx,
-			      const NET_USER_INFO_3 *info3,
+			      const struct netr_SamInfo3 *info3,
 			      DOM_SID **user_sids,
 			      size_t *num_user_sids,
 			      bool include_user_group_rid)
@@ -678,45 +678,45 @@ NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx,
 
 	if (include_user_group_rid) {
 
-		if (!sid_compose(&sid, &(info3->dom_sid.sid), info3->user_rid))
+		if (!sid_compose(&sid, info3->base.domain_sid, info3->base.rid))
 		{
 			DEBUG(3, ("could not compose user SID from rid 0x%x\n",
-				  info3->user_rid));
+				  info3->base.rid));
 			return NT_STATUS_INVALID_PARAMETER;
 		}
 		status = add_sid_to_array(mem_ctx, &sid, &sid_array, &num_sids);
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(3, ("could not append user SID from rid 0x%x\n",
-				  info3->user_rid));
+				  info3->base.rid));
 			return status;
 		}
 
-		if (!sid_compose(&sid, &(info3->dom_sid.sid), info3->group_rid))
+		if (!sid_compose(&sid, info3->base.domain_sid, info3->base.primary_gid))
 		{
 			DEBUG(3, ("could not compose group SID from rid 0x%x\n",
-				  info3->group_rid));
+				  info3->base.primary_gid));
 			return NT_STATUS_INVALID_PARAMETER;
 		}
 		status = add_sid_to_array(mem_ctx, &sid, &sid_array, &num_sids);
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(3, ("could not append group SID from rid 0x%x\n",
-				  info3->group_rid));
+				  info3->base.rid));
 			return status;
 		}
 	}
 
-	for (i = 0; i < info3->num_groups2; i++) {
-		if (!sid_compose(&sid, &(info3->dom_sid.sid),
-				 info3->gids[i].g_rid))
+	for (i = 0; i < info3->base.groups.count; i++) {
+		if (!sid_compose(&sid, info3->base.domain_sid,
+				 info3->base.groups.rids[i].rid))
 		{
 			DEBUG(3, ("could not compose SID from additional group "
-				  "rid 0x%x\n", info3->gids[i].g_rid));
+				  "rid 0x%x\n", info3->base.groups.rids[i].rid));
 			return NT_STATUS_INVALID_PARAMETER;
 		}
 		status = add_sid_to_array(mem_ctx, &sid, &sid_array, &num_sids);
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(3, ("could not append SID from additional group "
-				  "rid 0x%x\n", info3->gids[i].g_rid));
+				  "rid 0x%x\n", info3->base.groups.rids[i].rid));
 			return status;
 		}
 	}
@@ -727,12 +727,12 @@ NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx,
            http://www.microsoft.com/windows2000/techinfo/administration/security/sidfilter.asp
          */
 
-	for (i = 0; i < info3->num_other_sids; i++) {
-		status = add_sid_to_array(mem_ctx, &info3->other_sids[i].sid,
+	for (i = 0; i < info3->sidcount; i++) {
+		status = add_sid_to_array(mem_ctx, info3->sids[i].sid,
 				      &sid_array, &num_sids);
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(3, ("could not add SID to array: %s\n",
-				  sid_string_dbg(&info3->other_sids[i].sid)));
+				  sid_string_dbg(info3->sids[i].sid)));
 			return status;
 		}
 	}
diff --git a/source/libads/authdata.c b/source/libads/authdata.c
index 644f851..7997287 100644
--- a/source/libads/authdata.c
+++ b/source/libads/authdata.c
@@ -1,23 +1,23 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    kerberos authorization data (PAC) utility library
-   Copyright (C) Jim McDonough <jmcd at us.ibm.com> 2003   
+   Copyright (C) Jim McDonough <jmcd at us.ibm.com> 2003
    Copyright (C) Andrew Bartlett <abartlet at samba.org> 2004-2005
    Copyright (C) Andrew Tridgell 2001
    Copyright (C) Luke Howard 2002-2003
    Copyright (C) Stefan Metzmacher 2004-2005
    Copyright (C) Guenther Deschner 2005,2007
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -26,628 +26,14 @@
 
 #ifdef HAVE_KRB5
 
-static bool pac_io_logon_name(const char *desc, PAC_LOGON_NAME *logon_name,
-			      prs_struct *ps, int depth)
-{
-	if (NULL == logon_name)
-		return False;
-
-	prs_debug(ps, depth, desc, "pac_io_logon_name");
-	depth++;
-
-	if (!smb_io_time("logon_time", &logon_name->logon_time, ps, depth))
-		return False;
-
-	if (!prs_uint16("len", ps, depth, &logon_name->len))
-		return False;
-
-	/* The following string is always in little endian 16 bit values,
-	   copy as 8 bits to avoid endian reversal on big-endian machines.
-	   len is the length in bytes. */
-
-	if (UNMARSHALLING(ps) && logon_name->len) {
-		logon_name->username = PRS_ALLOC_MEM(ps, uint8, logon_name->len);
-		if (!logon_name->username) {
-			DEBUG(3, ("No memory available\n"));
-			return False;
-		}
-	}
-
-	if (!prs_uint8s(True, "name", ps, depth, logon_name->username, logon_name->len))
-		return False;
-
-	return True;
-}
-
-#if 0 /* Unused (handled now in net_io_user_info3()) - Guenther */
-static bool pac_io_krb_sids(const char *desc, KRB_SID_AND_ATTRS *sid_and_attr,
-			    prs_struct *ps, int depth)
-{
-	if (NULL == sid_and_attr)
-		return False;
-
-	prs_debug(ps, depth, desc, "pac_io_krb_sids");
-	depth++;
-
-	if (UNMARSHALLING(ps)) {
-		sid_and_attr->sid = PRS_ALLOC_MEM(ps, DOM_SID2, 1);
-		if (!sid_and_attr->sid) {
-			DEBUG(3, ("No memory available\n"));
-			return False;
-		}
-	}
-
-	if(!smb_io_dom_sid2("sid", sid_and_attr->sid, ps, depth))
-		return False;
-
-	return True;
-}
-
-
-static bool pac_io_krb_attrs(const char *desc, KRB_SID_AND_ATTRS *sid_and_attr,
-			     prs_struct *ps, int depth)
-{
-	if (NULL == sid_and_attr)
-		return False;
-
-	prs_debug(ps, depth, desc, "pac_io_krb_attrs");
-	depth++;
-
-	if (!prs_uint32("sid_ptr", ps, depth, &sid_and_attr->sid_ptr))
-		return False;
-	if (!prs_uint32("attrs", ps, depth, &sid_and_attr->attrs))
-		return False;
-
-	return True;
-}
-
-static bool pac_io_krb_sid_and_attr_array(const char *desc, 
-					  KRB_SID_AND_ATTR_ARRAY *array,
-					  uint32 num,
-					  prs_struct *ps, int depth)
-{
-	int i;
-
-	if (NULL == array)
-		return False;
-
-	prs_debug(ps, depth, desc, "pac_io_krb_sid_and_attr_array");
-	depth++;
-
-
-	if (!prs_uint32("count", ps, depth, &array->count))
-		return False;
-
-	if (UNMARSHALLING(ps)) {
-		if (num) {
-			array->krb_sid_and_attrs = PRS_ALLOC_MEM(ps, KRB_SID_AND_ATTRS, num);
-			if (!array->krb_sid_and_attrs) {
-				DEBUG(3, ("No memory available\n"));
-				return False;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list