svn commit: samba r19814 - in branches/SAMBA_3_0_24/source: client libmsrpc libsmb utils

jerry at samba.org jerry at samba.org
Tue Nov 21 04:52:54 GMT 2006


Author: jerry
Date: 2006-11-21 04:52:52 +0000 (Tue, 21 Nov 2006)
New Revision: 19814

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19814

Log:
Fix 'make everything build'
The only major remaining pieces that are not being merged are:

* The IDL work
* The security descriptor merge.




Modified:
   branches/SAMBA_3_0_24/source/client/client.c
   branches/SAMBA_3_0_24/source/libmsrpc/cac_lsarpc.c
   branches/SAMBA_3_0_24/source/libmsrpc/cac_winreg.c
   branches/SAMBA_3_0_24/source/libmsrpc/libmsrpc_internal.c
   branches/SAMBA_3_0_24/source/libsmb/libsmbclient.c
   branches/SAMBA_3_0_24/source/utils/net_rpc.c


Changeset:
Modified: branches/SAMBA_3_0_24/source/client/client.c
===================================================================
--- branches/SAMBA_3_0_24/source/client/client.c	2006-11-21 04:36:22 UTC (rev 19813)
+++ branches/SAMBA_3_0_24/source/client/client.c	2006-11-21 04:52:52 UTC (rev 19814)
@@ -2787,13 +2787,10 @@
 	NTSTATUS status;
 	struct rpc_pipe_client *pipe_hnd;
 	TALLOC_CTX *mem_ctx;
-	uint32 enum_hnd = 0;
-	uint32 *penum_hnd = &enum_hnd;
-	struct srvsvc_NetShareCtr1 ctr1;
-	union srvsvc_NetShareCtr ctr;
+	ENUM_HND enum_hnd;
+	WERROR werr;
+	SRV_SHARE_INFO_CTR ctr;
 	int i;
-	uint32 level;
-	uint32 numentries;
 
 	mem_ctx = talloc_new(NULL);
 	if (mem_ctx == NULL) {
@@ -2801,6 +2798,8 @@
 		return False;
 	}
 
+	init_enum_hnd(&enum_hnd, 0);
+
 	pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, &status);
 
 	if (pipe_hnd == NULL) {
@@ -2810,23 +2809,23 @@
 		return False;
 	}
 
-	ZERO_STRUCT(ctr1);
-	level = 1;
-	ctr.ctr1 = &ctr1;
+	werr = rpccli_srvsvc_net_share_enum(pipe_hnd, mem_ctx, 1, &ctr,
+					    0xffffffff, &enum_hnd);
 
-	status = rpccli_srvsvc_NetShareEnum(pipe_hnd, mem_ctx, "", &level,
-					    &ctr, 0xffffffff, &numentries,
-					    &penum_hnd);
-
-	if (!NT_STATUS_IS_OK(status)) {
+	if (!W_ERROR_IS_OK(werr)) {
 		TALLOC_FREE(mem_ctx);
 		cli_rpc_pipe_close(pipe_hnd);
 		return False;
 	}
 
-	for (i=0; i<numentries; i++) {
-		struct srvsvc_NetShareInfo1 *info = &ctr.ctr1->array[i];
-		browse_fn(info->name, info->type, info->comment, NULL);
+	for (i=0; i<ctr.num_entries; i++) {
+		SRV_SHARE_INFO_1 *info = &ctr.share.info1[i];
+		char *name, *comment;
+		name = rpcstr_pull_unistr2_talloc(
+			mem_ctx, &info->info_1_str.uni_netname);
+		comment = rpcstr_pull_unistr2_talloc(
+			mem_ctx, &info->info_1_str.uni_remark);
+		browse_fn(name, info->info_1.type, comment, NULL);
 	}
 
 	TALLOC_FREE(mem_ctx);

Modified: branches/SAMBA_3_0_24/source/libmsrpc/cac_lsarpc.c
===================================================================
--- branches/SAMBA_3_0_24/source/libmsrpc/cac_lsarpc.c	2006-11-21 04:36:22 UTC (rev 19813)
+++ branches/SAMBA_3_0_24/source/libmsrpc/cac_lsarpc.c	2006-11-21 04:52:52 UTC (rev 19814)
@@ -139,7 +139,7 @@
 		return CAC_FAILURE;
 	}
 
-	hnd->status = rpccli_lsa_Close( pipe_hnd, mem_ctx, pol );
+	hnd->status = rpccli_lsa_close( pipe_hnd, mem_ctx, pol );
 
 	TALLOC_FREE( pol );
 

Modified: branches/SAMBA_3_0_24/source/libmsrpc/cac_winreg.c
===================================================================
--- branches/SAMBA_3_0_24/source/libmsrpc/cac_winreg.c	2006-11-21 04:36:22 UTC (rev 19813)
+++ branches/SAMBA_3_0_24/source/libmsrpc/cac_winreg.c	2006-11-21 04:52:52 UTC (rev 19814)
@@ -49,7 +49,7 @@
 
    /*initialize for winreg pipe if we have to*/
    if(!hnd->_internal.pipes[PI_WINREG]) {
-      if(!(pipe_hnd = cli_rpc_pipe_open_noauth(&srv->cli, PI_WINREG, &(hnd->status)))) {
+      if(!(pipe_hnd = cli_rpc_pipe_open_noauth(srv->cli, PI_WINREG, &(hnd->status)))) {
          return CAC_FAILURE;
       }
 
@@ -966,7 +966,7 @@
 
    /*initialize for winreg pipe if we have to*/
    if(!hnd->_internal.pipes[PI_SHUTDOWN]) {
-      if(!(pipe_hnd = cli_rpc_pipe_open_noauth(&srv->cli, PI_SHUTDOWN, &(hnd->status)))) {
+      if(!(pipe_hnd = cli_rpc_pipe_open_noauth(srv->cli, PI_SHUTDOWN, &(hnd->status)))) {
          return CAC_FAILURE;
       }
 

Modified: branches/SAMBA_3_0_24/source/libmsrpc/libmsrpc_internal.c
===================================================================
--- branches/SAMBA_3_0_24/source/libmsrpc/libmsrpc_internal.c	2006-11-21 04:36:22 UTC (rev 19813)
+++ branches/SAMBA_3_0_24/source/libmsrpc/libmsrpc_internal.c	2006-11-21 04:52:52 UTC (rev 19814)
@@ -129,7 +129,7 @@
 		init_rpc_blob_uint32( blob, data.reg_dword );
 		break;
 
-	case REG_DWORD_BIG_ENDIAN:
+	case REG_DWORD_BE:
 		init_rpc_blob_uint32( blob, data.reg_dword_be );
 		break;
 
@@ -274,7 +274,7 @@
 		data->reg_dword = *( ( uint32 * ) buf.buffer );
 		break;
 
-	case REG_DWORD_BIG_ENDIAN:
+	case REG_DWORD_BE:
 		data->reg_dword_be = *( ( uint32 * ) buf.buffer );
 		break;
 

Modified: branches/SAMBA_3_0_24/source/libsmb/libsmbclient.c
===================================================================
--- branches/SAMBA_3_0_24/source/libsmb/libsmbclient.c	2006-11-21 04:36:22 UTC (rev 19813)
+++ branches/SAMBA_3_0_24/source/libsmb/libsmbclient.c	2006-11-21 04:52:52 UTC (rev 19814)
@@ -2472,16 +2472,16 @@
                    void *state)
 {
         int i;
-	NTSTATUS result;
-	uint32 enum_hnd;
-	uint32 *penum_hnd = &enum_hnd;
+	WERROR result;
+	ENUM_HND enum_hnd;
         uint32 info_level = 1;
 	uint32 preferred_len = 0xffffffff;
-	struct srvsvc_NetShareCtr1 ctr1;
-	union srvsvc_NetShareCtr ctr;
+        uint32 type;
+	SRV_SHARE_INFO_CTR ctr;
+	fstring name = "";
+        fstring comment = "";
         void *mem_ctx;
 	struct rpc_pipe_client *pipe_hnd;
-	uint32 numentries;
         NTSTATUS nt_status;
 
         /* Open the server service pipe */
@@ -2499,28 +2499,37 @@
                 return -1; 
         }
 
-	ZERO_STRUCT(ctr1);
-	ctr.ctr1 = &ctr1;
-
         /* Issue the NetShareEnum RPC call and retrieve the response */
-	enum_hnd = 0;
-	result = rpccli_srvsvc_NetShareEnum(pipe_hnd, mem_ctx, NULL,
-					    &info_level, &ctr, preferred_len,
-					    &numentries, &penum_hnd);
+	init_enum_hnd(&enum_hnd, 0);
+	result = rpccli_srvsvc_net_share_enum(pipe_hnd,
+                                              mem_ctx,
+                                              info_level,
+                                              &ctr,
+                                              preferred_len,
+                                              &enum_hnd);
 
         /* Was it successful? */
-	if (!NT_STATUS_IS_OK(result) || numentries == 0) {
+	if (!W_ERROR_IS_OK(result) || ctr.num_entries == 0) {
                 /*  Nope.  Go clean up. */
 		goto done;
         }
 
         /* For each returned entry... */
-        for (i = 0; i < numentries; i++) {
+        for (i = 0; i < ctr.num_entries; i++) {
 
+                /* pull out the share name */
+                rpcstr_pull_unistr2_fstring(
+                        name, &ctr.share.info1[i].info_1_str.uni_netname);
+
+                /* pull out the share's comment */
+                rpcstr_pull_unistr2_fstring(
+                        comment, &ctr.share.info1[i].info_1_str.uni_remark);
+
+                /* Get the type value */
+                type = ctr.share.info1[i].info_1.type;
+
                 /* Add this share to the list */
-                (*fn)(ctr.ctr1->array[i].name, 
-					  ctr.ctr1->array[i].type, 
-					  ctr.ctr1->array[i].comment, state);
+                (*fn)(name, type, comment, state);
         }
 
 done:
@@ -2531,7 +2540,7 @@
         TALLOC_FREE(mem_ctx);
 
         /* Tell 'em if it worked */
-        return NT_STATUS_IS_OK(result) ? 0 : -1;
+        return W_ERROR_IS_OK(result) ? 0 : -1;
 }
 
 
@@ -3733,8 +3742,8 @@
 	if (ace1->flags != ace2->flags) 
 		return ace1->flags - ace2->flags;
 
-	if (ace1->access_mask != ace2->access_mask) 
-		return ace1->access_mask - ace2->access_mask;
+	if (ace1->info.mask != ace2->info.mask) 
+		return ace1->info.mask - ace2->info.mask;
 
 	if (ace1->size != ace2->size) 
 		return ace1->size - ace2->size;
@@ -3749,14 +3758,14 @@
 	uint32 i;
 	if (!the_acl) return;
 
-	qsort(the_acl->aces, the_acl->num_aces, sizeof(the_acl->aces[0]),
+	qsort(the_acl->ace, the_acl->num_aces, sizeof(the_acl->ace[0]),
               QSORT_CAST ace_compare);
 
 	for (i=1;i<the_acl->num_aces;) {
-		if (sec_ace_equal(&the_acl->aces[i-1], &the_acl->aces[i])) {
+		if (sec_ace_equal(&the_acl->ace[i-1], &the_acl->ace[i])) {
 			int j;
 			for (j=i; j<the_acl->num_aces-1; j++) {
-				the_acl->aces[j] = the_acl->aces[j+1];
+				the_acl->ace[j] = the_acl->ace[j+1];
 			}
 			the_acl->num_aces--;
 		} else {
@@ -3961,7 +3970,7 @@
 	}
 
  done:
-	mask = amask;
+	mask.mask = amask;
 	init_sec_ace(ace, &sid, atype, mask, aflags);
 	return True;
 }
@@ -3983,7 +3992,7 @@
 	if ((aces = SMB_CALLOC_ARRAY(SEC_ACE, 1+(*the_acl)->num_aces)) == NULL) {
 		return False;
 	}
-	memcpy(aces, (*the_acl)->aces, (*the_acl)->num_aces * sizeof(SEC_ACE));
+	memcpy(aces, (*the_acl)->ace, (*the_acl)->num_aces * sizeof(SEC_ACE));
 	memcpy(aces+(*the_acl)->num_aces, ace, sizeof(SEC_ACE));
 	newacl = make_sec_acl(ctx, (*the_acl)->revision,
                               1+(*the_acl)->num_aces, aces);
@@ -4555,10 +4564,10 @@
                 }
 
                 if (! exclude_nt_group) {
-                        if (sd->group_sid) {
+                        if (sd->grp_sid) {
                                 convert_sid_to_string(ipc_cli, pol,
                                                       sidstr, numeric,
-                                                      sd->group_sid);
+                                                      sd->grp_sid);
                         } else {
                                 fstrcpy(sidstr, "");
                         }
@@ -4603,7 +4612,7 @@
                         /* Add aces to value buffer  */
                         for (i = 0; sd->dacl && i < sd->dacl->num_aces; i++) {
 
-                                SEC_ACE *ace = &sd->dacl->aces[i];
+                                SEC_ACE *ace = &sd->dacl->ace[i];
                                 convert_sid_to_string(ipc_cli, pol,
                                                       sidstr, numeric,
                                                       &ace->trustee);
@@ -4617,7 +4626,7 @@
                                                         sidstr,
                                                         ace->type,
                                                         ace->flags,
-                                                        ace->access_mask);
+                                                        ace->info.mask);
                                                 if (!p) {
                                                         errno = ENOMEM;
                                                         return -1;
@@ -4630,7 +4639,7 @@
                                                         sidstr,
                                                         ace->type,
                                                         ace->flags,
-                                                        ace->access_mask);
+                                                        ace->info.mask);
                                         }
                                 } else if ((StrnCaseCmp(name, "acl", 3) == 0 &&
                                             StrCaseCmp(name+3, sidstr) == 0) ||
@@ -4642,7 +4651,7 @@
                                                         "%d/%d/0x%08x", 
                                                         ace->type,
                                                         ace->flags,
-                                                        ace->access_mask);
+                                                        ace->info.mask);
                                                 if (!p) {
                                                         errno = ENOMEM;
                                                         return -1;
@@ -4653,7 +4662,7 @@
                                                              "%d/%d/0x%08x", 
                                                              ace->type,
                                                              ace->flags,
-                                                             ace->access_mask);
+                                                             ace->info.mask);
                                         }
                                 } else if (all_nt_acls) {
                                         if (determine_size) {
@@ -4664,7 +4673,7 @@
                                                         sidstr,
                                                         ace->type,
                                                         ace->flags,
-                                                        ace->access_mask);
+                                                        ace->info.mask);
                                                 if (!p) {
                                                         errno = ENOMEM;
                                                         return -1;
@@ -4677,7 +4686,7 @@
                                                              sidstr,
                                                              ace->type,
                                                              ace->flags,
-                                                             ace->access_mask);
+                                                             ace->info.mask);
                                         }
                                 }
                                 if (n > bufsize) {
@@ -5108,7 +5117,7 @@
 	switch (mode) {
 	case SMBC_XATTR_MODE_REMOVE_ALL:
                 old->dacl->num_aces = 0;
-                SAFE_FREE(old->dacl->aces);
+                SAFE_FREE(old->dacl->ace);
                 SAFE_FREE(old->dacl);
                 old->dacl = NULL;
                 dacl = old->dacl;
@@ -5119,16 +5128,16 @@
 			BOOL found = False;
 
 			for (j=0;old->dacl && j<old->dacl->num_aces;j++) {
-                                if (sec_ace_equal(&sd->dacl->aces[i],
-                                                  &old->dacl->aces[j])) {
+                                if (sec_ace_equal(&sd->dacl->ace[i],
+                                                  &old->dacl->ace[j])) {
 					uint32 k;
 					for (k=j; k<old->dacl->num_aces-1;k++) {
-						old->dacl->aces[k] =
-                                                        old->dacl->aces[k+1];
+						old->dacl->ace[k] =
+                                                        old->dacl->ace[k+1];
 					}
 					old->dacl->num_aces--;
 					if (old->dacl->num_aces == 0) {
-						SAFE_FREE(old->dacl->aces);
+						SAFE_FREE(old->dacl->ace);
 						SAFE_FREE(old->dacl);
 						old->dacl = NULL;
 					}
@@ -5151,14 +5160,14 @@
 			BOOL found = False;
 
 			for (j=0;old->dacl && j<old->dacl->num_aces;j++) {
-				if (sid_equal(&sd->dacl->aces[i].trustee,
-					      &old->dacl->aces[j].trustee)) {
+				if (sid_equal(&sd->dacl->ace[i].trustee,
+					      &old->dacl->ace[j].trustee)) {
                                         if (!(flags & SMBC_XATTR_FLAG_CREATE)) {
                                                 err = EEXIST;
                                                 ret = -1;
                                                 goto failed;
                                         }
-                                        old->dacl->aces[j] = sd->dacl->aces[i];
+                                        old->dacl->ace[j] = sd->dacl->ace[i];
                                         ret = -1;
 					found = True;
 				}
@@ -5171,7 +5180,7 @@
 			}
                         
                         for (i=0;sd->dacl && i<sd->dacl->num_aces;i++) {
-                                add_ace(&old->dacl, &sd->dacl->aces[i], ctx);
+                                add_ace(&old->dacl, &sd->dacl->ace[i], ctx);
                         }
 		}
                 dacl = old->dacl;
@@ -5180,7 +5189,7 @@
 	case SMBC_XATTR_MODE_SET:
  		old = sd;
                 owner_sid = old->owner_sid;
-                grp_sid = old->group_sid;
+                grp_sid = old->grp_sid;
                 dacl = old->dacl;
 		break;
 
@@ -5189,7 +5198,7 @@
                 break;
 
         case SMBC_XATTR_MODE_CHGRP:
-                grp_sid = sd->group_sid;
+                grp_sid = sd->grp_sid;
                 break;
 	}
 

Modified: branches/SAMBA_3_0_24/source/utils/net_rpc.c
===================================================================
--- branches/SAMBA_3_0_24/source/utils/net_rpc.c	2006-11-21 04:36:22 UTC (rev 19813)
+++ branches/SAMBA_3_0_24/source/utils/net_rpc.c	2006-11-21 04:52:52 UTC (rev 19814)
@@ -6269,7 +6269,7 @@
  */
 BOOL net_rpc_check(unsigned flags)
 {
-	struct cli_state cli;
+	struct cli_state *cli;
 	BOOL ret = False;
 	struct in_addr server_ip;
 	char *server_name = NULL;
@@ -6278,23 +6278,23 @@
 	if (!net_find_server(NULL, flags, &server_ip, &server_name))
 		return False;
 
-	ZERO_STRUCT(cli);
-	if (cli_initialise(&cli) == False)
+	if ((cli = cli_initialise()) == NULL) {
 		return False;
+	}
 
-	if (!cli_connect(&cli, server_name, &server_ip))
+	if (!cli_connect(cli, server_name, &server_ip))
 		goto done;
 	if (!attempt_netbios_session_request(&cli, global_myname(), 
 					     server_name, &server_ip))
 		goto done;
-	if (!cli_negprot(&cli))
+	if (!cli_negprot(cli))
 		goto done;
-	if (cli.protocol < PROTOCOL_NT1)
+	if (cli->protocol < PROTOCOL_NT1)
 		goto done;
 
 	ret = True;
  done:
-	cli_shutdown(&cli);
+	cli_shutdown(cli);
 	return ret;
 }
 



More information about the samba-cvs mailing list