svn commit: samba r18984 - in branches/SAMBA_3_0/source: libgpo utils

gd at samba.org gd at samba.org
Thu Sep 28 23:13:16 GMT 2006


Author: gd
Date: 2006-09-28 23:13:15 +0000 (Thu, 28 Sep 2006)
New Revision: 18984

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

Log:
Removing ads_gpo_get_sysvol_gpt_version() which was just doing stupid
things.

Guenther

Modified:
   branches/SAMBA_3_0/source/libgpo/gpo_parse.c
   branches/SAMBA_3_0/source/utils/net_ads_gpo.c


Changeset:
Modified: branches/SAMBA_3_0/source/libgpo/gpo_parse.c
===================================================================
--- branches/SAMBA_3_0/source/libgpo/gpo_parse.c	2006-09-28 23:04:17 UTC (rev 18983)
+++ branches/SAMBA_3_0/source/libgpo/gpo_parse.c	2006-09-28 23:13:15 UTC (rev 18984)
@@ -50,97 +50,6 @@
 	return True;
 }
 
-NTSTATUS ads_gpo_get_sysvol_gpt_version(ADS_STRUCT *ads, 
-					TALLOC_CTX *mem_ctx, 
-					const char *filesyspath, 
-					uint32 *sysvol_version)
-{
-	NTSTATUS status;
-	const char *path;
-	struct cli_state *cli;
-	int fnum;
-	fstring tok;
-	static int io_bufsize = 64512;
-	int read_size = io_bufsize;
-	char *data = NULL;
-	off_t start = 0;
-	off_t nread = 0;
-	int handle = 0;
-	const char *local_file;
-
-	*sysvol_version = 0;
-
-	next_token(&filesyspath, tok, "\\", sizeof(tok));
-	next_token(&filesyspath, tok, "\\", sizeof(tok));
-
-	path = talloc_asprintf(mem_ctx, "\\%s\\gpt.ini", filesyspath);
-	if (path == NULL) {
-		return NT_STATUS_NO_MEMORY;
-	}
-
-	local_file = talloc_asprintf(mem_ctx, "%s/%s", lock_path("gpo_cache"), "gpt.ini");
-	if (local_file == NULL) {
-		return NT_STATUS_NO_MEMORY;
-	}
-
-	/* FIXME: walk down the dfs tree instead */
-	status = cli_full_connection(&cli, global_myname(), 
-				     ads->config.ldap_server_name,
-				     NULL, 0,
-				     "SYSVOL", "A:",
-				     ads->auth.user_name, NULL, ads->auth.password,
-				     CLI_FULL_CONNECTION_USE_KERBEROS,
-				     Undefined, NULL);
-	if (!NT_STATUS_IS_OK(status)) {
-		return status;
-	}
-
-	fnum = cli_open(cli, path, O_RDONLY, DENY_NONE);
-	if (fnum == -1) {
-		return NT_STATUS_NO_SUCH_FILE;
-	}
-
-
-	data = (char *)SMB_MALLOC(read_size);
-	if (data == NULL) {
-		return NT_STATUS_NO_MEMORY;
-	}
-
-	handle = sys_open(local_file, O_WRONLY|O_CREAT|O_TRUNC, 0644);
-
-	if (handle == -1) {
-		return NT_STATUS_NO_SUCH_FILE;
-	}
-	 
-	while (1) {
-
-		int n = cli_read(cli, fnum, data, nread + start, read_size);
-
-		if (n <= 0)
-			break;
-
-		if (write(handle, data, n) != n) {
-			break;
-		}
-
-		nread += n;
-	}
-
-	cli_close(cli, fnum);
-
-	if (!pm_process(local_file, do_section, do_parameter)) {
-		return NT_STATUS_INVALID_PARAMETER;
-	}
-
-	*sysvol_version = version;
-
-	SAFE_FREE(data);
-
-	cli_shutdown(cli);
-
-	return NT_STATUS_OK;
-}
-
 /*
 
 perfectly parseable with pm_process() :))

Modified: branches/SAMBA_3_0/source/utils/net_ads_gpo.c
===================================================================
--- branches/SAMBA_3_0/source/utils/net_ads_gpo.c	2006-09-28 23:04:17 UTC (rev 18983)
+++ branches/SAMBA_3_0/source/utils/net_ads_gpo.c	2006-09-28 23:13:15 UTC (rev 18984)
@@ -424,14 +424,14 @@
 	}	
 
 	dump_gpo(mem_ctx, &gpo);
-
+#if 0
 	status = ADS_ERROR_NT(ads_gpo_get_sysvol_gpt_version(ads, mem_ctx, gpo.file_sys_path, &sysvol_gpt_version)); 
 	if (!ADS_ERR_OK(status)) {
 		goto out;
 	}
 
 	printf("sysvol GPT version: %d\n", sysvol_gpt_version);
-
+#endif
 out:
 	talloc_destroy(mem_ctx);
 	ads_destroy(&ads);



More information about the samba-cvs mailing list