[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1080-gfe2828c

Günther Deschner gd at samba.org
Fri Apr 17 15:28:16 GMT 2009


The branch, master has been updated
       via  fe2828c3536eac18902a059049dd12b9b103f731 (commit)
       via  6900d61d369961e0c11e590ccdc102169f21cef3 (commit)
       via  5e563ee508d0b3cc87d72ad52d777946ee0537b1 (commit)
       via  d76837f6da2cf735d2b18c97f3b46ae2f04b750d (commit)
      from  cb9c0cefaf61cf2c03f92a212dbf6673caa755dd (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fe2828c3536eac18902a059049dd12b9b103f731
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 17 17:21:19 2009 +0200

    s4-smbtorture: Skip Job pause and resume on paused printers for Samba 3 for now.
    
    Guenther

commit 6900d61d369961e0c11e590ccdc102169f21cef3
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 14 00:01:03 2009 +0200

    s3-spoolss: add support for _spoolss_EnumPrinterDrivers() level 6.
    
    Guenther

commit 5e563ee508d0b3cc87d72ad52d777946ee0537b1
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 14 00:00:37 2009 +0200

    s3-spoolss: add support for _spoolss_EnumPrinterDrivers() level 5.
    
    Guenther

commit d76837f6da2cf735d2b18c97f3b46ae2f04b750d
Author: Günther Deschner <gd at samba.org>
Date:   Mon Apr 13 23:58:59 2009 +0200

    s3-spoolss: add support for _spoolss_EnumPrinterDrivers() level 4.
    
    Guenther

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

Summary of changes:
 source3/rpc_server/srv_spoolss_nt.c |  187 ++++++++++++++++++++++++++++++++++-
 source4/torture/rpc/spoolss.c       |    8 +-
 2 files changed, 192 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index d114152..251415a 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -4846,6 +4846,121 @@ static WERROR fill_printer_driver_info3(TALLOC_CTX *mem_ctx,
 }
 
 /********************************************************************
+ * fill a spoolss_DriverInfo4 struct
+ ********************************************************************/
+
+static WERROR fill_printer_driver_info4(TALLOC_CTX *mem_ctx,
+					struct spoolss_DriverInfo4 *r,
+					const NT_PRINTER_DRIVER_INFO_LEVEL *driver,
+					const char *servername)
+{
+	const char *cservername = canon_servername(servername);
+
+	r->version		= driver->info_3->cversion;
+
+	r->driver_name		= talloc_strdup(mem_ctx, driver->info_3->name);
+	W_ERROR_HAVE_NO_MEMORY(r->driver_name);
+	r->architecture		= talloc_strdup(mem_ctx, driver->info_3->environment);
+	W_ERROR_HAVE_NO_MEMORY(r->architecture);
+
+	if (strlen(driver->info_3->driverpath)) {
+		r->driver_path	= talloc_asprintf(mem_ctx, "\\\\%s%s",
+				cservername, driver->info_3->driverpath);
+	} else {
+		r->driver_path	= talloc_strdup(mem_ctx, "");
+	}
+	W_ERROR_HAVE_NO_MEMORY(r->driver_path);
+
+	if (strlen(driver->info_3->datafile)) {
+		r->data_file	= talloc_asprintf(mem_ctx, "\\\\%s%s",
+				cservername, driver->info_3->datafile);
+	} else {
+		r->data_file	= talloc_strdup(mem_ctx, "");
+	}
+	W_ERROR_HAVE_NO_MEMORY(r->data_file);
+
+	if (strlen(driver->info_3->configfile)) {
+		r->config_file	= talloc_asprintf(mem_ctx, "\\\\%s%s",
+				cservername, driver->info_3->configfile);
+	} else {
+		r->config_file	= talloc_strdup(mem_ctx, "");
+	}
+	W_ERROR_HAVE_NO_MEMORY(r->config_file);
+
+	if (strlen(driver->info_3->helpfile)) {
+		r->help_file	= talloc_asprintf(mem_ctx, "\\\\%s%s",
+				cservername, driver->info_3->helpfile);
+	} else {
+		r->help_file	= talloc_strdup(mem_ctx, "");
+	}
+	W_ERROR_HAVE_NO_MEMORY(r->help_file);
+
+	r->dependent_files = string_array_from_driver_info(mem_ctx,
+							   driver->info_3->dependentfiles,
+							   cservername);
+
+
+	r->monitor_name		= talloc_strdup(mem_ctx, driver->info_3->monitorname);
+	W_ERROR_HAVE_NO_MEMORY(r->monitor_name);
+	r->default_datatype	= talloc_strdup(mem_ctx, driver->info_3->defaultdatatype);
+	W_ERROR_HAVE_NO_MEMORY(r->default_datatype);
+
+	r->previous_names = string_array_from_driver_info(mem_ctx,
+							  NULL,
+							  cservername);
+
+	return WERR_OK;
+}
+
+/********************************************************************
+ * fill a spoolss_DriverInfo5 struct
+ ********************************************************************/
+
+static WERROR fill_printer_driver_info5(TALLOC_CTX *mem_ctx,
+					struct spoolss_DriverInfo5 *r,
+					const NT_PRINTER_DRIVER_INFO_LEVEL *driver,
+					const char *servername)
+{
+	const char *cservername = canon_servername(servername);
+
+	r->version		= driver->info_3->cversion;
+
+	r->driver_name		= talloc_strdup(mem_ctx, driver->info_3->name);
+	W_ERROR_HAVE_NO_MEMORY(r->driver_name);
+	r->architecture		= talloc_strdup(mem_ctx, driver->info_3->environment);
+	W_ERROR_HAVE_NO_MEMORY(r->architecture);
+
+	if (strlen(driver->info_3->driverpath)) {
+		r->driver_path	= talloc_asprintf(mem_ctx, "\\\\%s%s",
+				cservername, driver->info_3->driverpath);
+	} else {
+		r->driver_path	= talloc_strdup(mem_ctx, "");
+	}
+	W_ERROR_HAVE_NO_MEMORY(r->driver_path);
+
+	if (strlen(driver->info_3->datafile)) {
+		r->data_file	= talloc_asprintf(mem_ctx, "\\\\%s%s",
+				cservername, driver->info_3->datafile);
+	} else {
+		r->data_file	= talloc_strdup(mem_ctx, "");
+	}
+	W_ERROR_HAVE_NO_MEMORY(r->data_file);
+
+	if (strlen(driver->info_3->configfile)) {
+		r->config_file	= talloc_asprintf(mem_ctx, "\\\\%s%s",
+				cservername, driver->info_3->configfile);
+	} else {
+		r->config_file	= talloc_strdup(mem_ctx, "");
+	}
+	W_ERROR_HAVE_NO_MEMORY(r->config_file);
+
+	r->driver_attributes	= 0;
+	r->config_version	= 0;
+	r->driver_version	= 0;
+
+	return WERR_OK;
+}
+/********************************************************************
  * fill a spoolss_DriverInfo6 struct
  ********************************************************************/
 
@@ -4893,7 +5008,7 @@ static WERROR fill_printer_driver_info6(TALLOC_CTX *mem_ctx,
 	} else {
 		r->help_file	= talloc_strdup(mem_ctx, "");
 	}
-	W_ERROR_HAVE_NO_MEMORY(r->config_file);
+	W_ERROR_HAVE_NO_MEMORY(r->help_file);
 
 	r->monitor_name		= talloc_strdup(mem_ctx, driver->info_3->monitorname);
 	W_ERROR_HAVE_NO_MEMORY(r->monitor_name);
@@ -6673,6 +6788,18 @@ static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx,
 				result = fill_printer_driver_info3(info, &info[count+i].info3,
 								   &driver, servername);
 				break;
+			case 4:
+				result = fill_printer_driver_info4(info, &info[count+i].info4,
+								   &driver, servername);
+				break;
+			case 5:
+				result = fill_printer_driver_info5(info, &info[count+i].info5,
+								   &driver, servername);
+				break;
+			case 6:
+				result = fill_printer_driver_info6(info, &info[count+i].info6,
+								   &driver, servername);
+				break;
 			default:
 				result = WERR_UNKNOWN_LEVEL;
 				break;
@@ -6745,6 +6872,49 @@ static WERROR enumprinterdrivers_level3(TALLOC_CTX *mem_ctx,
 					info_p, count);
 }
 
+/****************************************************************************
+ Enumerates all printer drivers at level 4.
+****************************************************************************/
+
+static WERROR enumprinterdrivers_level4(TALLOC_CTX *mem_ctx,
+					const char *servername,
+					const char *architecture,
+					union spoolss_DriverInfo **info_p,
+					uint32_t *count)
+{
+	return enumprinterdrivers_level(mem_ctx, servername, architecture, 4,
+					info_p, count);
+}
+
+/****************************************************************************
+ Enumerates all printer drivers at level 5.
+****************************************************************************/
+
+static WERROR enumprinterdrivers_level5(TALLOC_CTX *mem_ctx,
+					const char *servername,
+					const char *architecture,
+					union spoolss_DriverInfo **info_p,
+					uint32_t *count)
+{
+	return enumprinterdrivers_level(mem_ctx, servername, architecture, 5,
+					info_p, count);
+}
+
+/****************************************************************************
+ Enumerates all printer drivers at level 6.
+****************************************************************************/
+
+static WERROR enumprinterdrivers_level6(TALLOC_CTX *mem_ctx,
+					const char *servername,
+					const char *architecture,
+					union spoolss_DriverInfo **info_p,
+					uint32_t *count)
+{
+	return enumprinterdrivers_level(mem_ctx, servername, architecture, 6,
+					info_p, count);
+}
+
+
 /****************************************************************
  _spoolss_EnumPrinterDrivers
 ****************************************************************/
@@ -6789,6 +6959,21 @@ WERROR _spoolss_EnumPrinterDrivers(pipes_struct *p,
 						   r->in.environment,
 						   r->out.info, r->out.count);
 		break;
+	case 4:
+		result = enumprinterdrivers_level4(p->mem_ctx, cservername,
+						   r->in.environment,
+						   r->out.info, r->out.count);
+		break;
+	case 5:
+		result = enumprinterdrivers_level5(p->mem_ctx, cservername,
+						   r->in.environment,
+						   r->out.info, r->out.count);
+		break;
+	case 6:
+		result = enumprinterdrivers_level6(p->mem_ctx, cservername,
+						   r->in.environment,
+						   r->out.info, r->out.count);
+		break;
 	default:
 		return WERR_UNKNOWN_LEVEL;
 	}
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index af9fe45..bc89eab 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -1212,8 +1212,12 @@ static bool test_EnumJobs(struct torture_context *tctx,
 		for (j = 0; j < count; j++) {
 
 			test_GetJob(tctx, p, handle, info[j].info1.job_id);
-			test_SetJob(tctx, p, handle, info[j].info1.job_id, SPOOLSS_JOB_CONTROL_PAUSE);
-			test_SetJob(tctx, p, handle, info[j].info1.job_id, SPOOLSS_JOB_CONTROL_RESUME);
+
+			/* FIXME - gd */
+			if (!torture_setting_bool(tctx, "samba3", false)) {
+				test_SetJob(tctx, p, handle, info[j].info1.job_id, SPOOLSS_JOB_CONTROL_PAUSE);
+				test_SetJob(tctx, p, handle, info[j].info1.job_id, SPOOLSS_JOB_CONTROL_RESUME);
+			}
 		}
 
 	} else {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list