[SCM] Samba Shared Repository - branch v3-4-test updated - release-4-0-0alpha7-888-g80d32b8

Günther Deschner gd at samba.org
Wed May 6 13:52:34 GMT 2009


The branch, v3-4-test has been updated
       via  80d32b8bfcc9a7805d864bd60d89d747bbe9ad0d (commit)
       via  163d0699e83c43f136449a16f539c99320a3eeaa (commit)
       via  133a98abd58ccecb15f493bf74f6e3e076b87dcd (commit)
       via  5ebe6755699fb970368580d4394289f9028ce9a8 (commit)
       via  4d67491ef558c96fd57a959bb58df9efa5e83ceb (commit)
      from  a2c023c5511d5f07def53da7e72cc32c52434ccf (commit)

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


- Log -----------------------------------------------------------------
commit 80d32b8bfcc9a7805d864bd60d89d747bbe9ad0d
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 6 15:43:23 2009 +0200

    s3-docs: Fix Bug #6331. Document "net dom join/net dom unjoin".
    
    Guenther
    (cherry picked from commit e398f1e91575909d2a90fab1e6f00804815a0b2f)

commit 163d0699e83c43f136449a16f539c99320a3eeaa
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 6 15:43:00 2009 +0200

    s3-docs: Fix "net eventlog dump" syntax in manpage.
    
    Guenther
    (cherry picked from commit bf197a9c0ab8a58a775277896d40617d36279288)

commit 133a98abd58ccecb15f493bf74f6e3e076b87dcd
Author: Günther Deschner <gd at samba.org>
Date:   Mon May 4 17:25:41 2009 +0200

    s3-rpcclient: print more infolevels in printer and driver info levels.
    
    Guenther
    (cherry picked from commit d77c45675744895b01d905f7f27ae55e64264c26)

commit 5ebe6755699fb970368580d4394289f9028ce9a8
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 6 10:20:52 2009 +0200

    s3-printing: fix debug statement in virtual registry layer
    (key_driver_fetch_keys).
    
    Guenther
    (cherry picked from commit 7ac1ae8d1c3bcf4d001e29fdc1ee314dcbe3df76)

commit 4d67491ef558c96fd57a959bb58df9efa5e83ceb
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 6 01:10:33 2009 +0200

    s3-printing: simplify print_queue helper functions and return WERROR.
    
    Guenther
    (cherry picked from commit 9966541f89b45834cdf63060202621f885bf9f5c)

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

Summary of changes:
 docs-xml/manpages-3/net.8.xml           |   83 ++++++++++-
 source3/include/proto.h                 |    9 +-
 source3/printing/printing.c             |   27 ++--
 source3/registry/reg_backend_printing.c |    2 +-
 source3/rpc_server/srv_spoolss_nt.c     |   12 +-
 source3/rpcclient/cmd_spoolss.c         |  245 ++++++++++++++++++++++++++++++-
 source3/smbd/lanman.c                   |   17 +--
 7 files changed, 344 insertions(+), 51 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/net.8.xml b/docs-xml/manpages-3/net.8.xml
index 477c3d8..995f28b 100644
--- a/docs-xml/manpages-3/net.8.xml
+++ b/docs-xml/manpages-3/net.8.xml
@@ -1605,7 +1605,7 @@ of eventlogs into an eventlog *.evt file.</member>
 </para>
 
 <refsect3>
-<title>EVENTLOG DUMP</title>
+<title>EVENTLOG DUMP <replaceable>filename</replaceable></title>
 
 <para>
 Prints a eventlog *.evt file to standard output.
@@ -1641,6 +1641,87 @@ See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manv
 </refsect2>
 
 <refsect2>
+<title>DOM</title>
+
+<para>Starting with version 3.2.0 Samba has support for remote join and unjoin APIs, both client and server-side. Windows supports remote join capabilities since Windows 2000.
+</para>
+<para>In order for Samba to be joined or unjoined remotely an account must be used that is either member of the Domain Admins group, a member of the local Administrators group or a user that is granted the SeMachineAccountPrivilege privilege.
+</para>
+
+<para>The client side support for remote join is implemented in the net dom commands which are:
+<simplelist>
+<member>net dom join - Join a remote computer into a domain.</member>
+<member>net dom unjoin - Unjoin a remote computer from a domain.</member>
+</simplelist>
+</para>
+
+<refsect3>
+<title>DOM JOIN	<replaceable>domain=DOMAIN</replaceable> <replaceable>ou=OU</replaceable> <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
+
+<para>
+Joins a computer into a domain. This command supports the following additional parameters:
+
+<itemizedlist>
+
+<listitem><replaceable>DOMAIN</replaceable> can be a NetBIOS domain name (also known as short domain name) or a DNS domain name for Active Directory Domains. As in Windows, it is also possible to control which Domain Controller to use. This can be achieved by appending the DC name using the \ separator character. Example: MYDOM\MYDC. The <replaceable>DOMAIN</replaceable> parameter cannot be NULL.</listitem>
+
+<listitem><replaceable>OU</replaceable> can be set to a RFC 1779 LDAP DN, like <emphasis>ou=mymachines,cn=Users,dc=example,dc=com</emphasis> in order to create the machine account in a non-default LDAP containter. This optional parameter is only supported when joining Active Directory Domains.</listitem>
+
+<listitem><replaceable>ACCOUNT</replaceable> defines a domain account that will be used to join the machine to the domain. This domain account needs to have sufficient privileges to join machines.</listitem>
+
+<listitem><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</listitem>
+
+<listitem><replaceable>REBOOT</replaceable> is an optional parameter that can be set to reboot the remote machine after successful join to the domain.</listitem>
+
+</itemizedlist>
+</para>
+
+<para>
+Note that you also need to use standard net paramters to connect and authenticate to the remote machine that you want to join. These additional parameters include: -S computer and -U user.
+</para>
+<para>
+	Example:
+	net dom join -S xp -U XP\\administrator%secret domain=MYDOM account=MYDOM\\administrator password=topsecret reboot.
+</para>
+<para>
+This example would connect to a computer named XP as the local administrator using password secret, and join the computer into a domain called MYDOM using the MYDOM domain administrator account and password topsecret. After successful join, the computer would reboot.
+</para>
+
+</refsect3>
+
+<refsect3>
+<title>DOM UNJOIN <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
+
+<para>
+Unjoins a computer from a domain. This command supports the following additional parameters:
+
+<itemizedlist>
+
+<listitem><replaceable>ACCOUNT</replaceable> defines a domain account that will be used to unjoin the machine from the domain. This domain account needs to have sufficient privileges to unjoin machines.</listitem>
+
+<listitem><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</listitem>
+
+<listitem><replaceable>REBOOT</replaceable> is an optional parameter that can be set to reboot the remote machine after successful unjoin from the domain.</listitem>
+
+</itemizedlist>
+</para>
+
+<para>
+Note that you also need to use standard net paramters to connect and authenticate to the remote machine that you want to unjoin. These additional parameters include: -S computer and -U user.
+</para>
+<para>
+	Example:
+	net dom unjoin -S xp -U XP\\administrator%secret account=MYDOM\\administrator password=topsecret reboot.
+</para>
+<para>
+This example would connect to a computer named XP as the local administrator using password secret, and unjoin the computer from the domain using the MYDOM domain administrator account and password topsecret. After successful unjoin, the computer would reboot.
+</para>
+
+</refsect3>
+
+</refsect2>
+
+<refsect2>
 <title>HELP [COMMAND]</title>
 
 <para>Gives usage information for the specified command.</para>
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 1f883cf..062c577 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4930,12 +4930,9 @@ bool print_job_end(int snum, uint32 jobid, enum file_close_type close_type);
 int print_queue_status(int snum, 
 		       print_queue_struct **ppqueue,
 		       print_status_struct *status);
-bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum,
-		       WERROR *errcode);
-bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum,
-			WERROR *errcode);
-bool print_queue_purge(struct auth_serversupplied_info *server_info, int snum,
-		       WERROR *errcode);
+WERROR print_queue_pause(struct auth_serversupplied_info *server_info, int snum);
+WERROR print_queue_resume(struct auth_serversupplied_info *server_info, int snum);
+WERROR print_queue_purge(struct auth_serversupplied_info *server_info, int snum);
 
 /* The following definitions come from printing/printing_db.c  */
 
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 8524cfb..e410c1c 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -2797,16 +2797,14 @@ int print_queue_status(int snum,
  Pause a queue.
 ****************************************************************************/
 
-bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum,
-		       WERROR *errcode)
+WERROR print_queue_pause(struct auth_serversupplied_info *server_info, int snum)
 {
 	int ret;
 	struct printif *current_printif = get_printer_fns( snum );
 
 	if (!print_access_check(server_info, snum,
 				PRINTER_ACCESS_ADMINISTER)) {
-		*errcode = WERR_ACCESS_DENIED;
-		return False;
+		return WERR_ACCESS_DENIED;
 	}
 
 
@@ -2817,8 +2815,7 @@ bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum,
 	unbecome_root();
 
 	if (ret != 0) {
-		*errcode = WERR_INVALID_PARAM;
-		return False;
+		return WERR_INVALID_PARAM;
 	}
 
 	/* force update the database */
@@ -2828,23 +2825,21 @@ bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum,
 
 	notify_printer_status(snum, PRINTER_STATUS_PAUSED);
 
-	return True;
+	return WERR_OK;
 }
 
 /****************************************************************************
  Resume a queue.
 ****************************************************************************/
 
-bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum,
-			WERROR *errcode)
+WERROR print_queue_resume(struct auth_serversupplied_info *server_info, int snum)
 {
 	int ret;
 	struct printif *current_printif = get_printer_fns( snum );
 
 	if (!print_access_check(server_info, snum,
 				PRINTER_ACCESS_ADMINISTER)) {
-		*errcode = WERR_ACCESS_DENIED;
-		return False;
+		return WERR_ACCESS_DENIED;
 	}
 
 	become_root();
@@ -2854,8 +2849,7 @@ bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum,
 	unbecome_root();
 
 	if (ret != 0) {
-		*errcode = WERR_INVALID_PARAM;
-		return False;
+		return WERR_INVALID_PARAM;
 	}
 
 	/* make sure the database is up to date */
@@ -2866,15 +2860,14 @@ bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum,
 
 	notify_printer_status(snum, PRINTER_STATUS_OK);
 
-	return True;
+	return WERR_OK;
 }
 
 /****************************************************************************
  Purge a queue - implemented by deleting all jobs that we can delete.
 ****************************************************************************/
 
-bool print_queue_purge(struct auth_serversupplied_info *server_info, int snum,
-		       WERROR *errcode)
+WERROR print_queue_purge(struct auth_serversupplied_info *server_info, int snum)
 {
 	print_queue_struct *queue;
 	print_status_struct status;
@@ -2908,5 +2901,5 @@ bool print_queue_purge(struct auth_serversupplied_info *server_info, int snum,
 
 	SAFE_FREE(queue);
 
-	return True;
+	return WERR_OK;
 }
diff --git a/source3/registry/reg_backend_printing.c b/source3/registry/reg_backend_printing.c
index a02293e..ef0b7d9 100644
--- a/source3/registry/reg_backend_printing.c
+++ b/source3/registry/reg_backend_printing.c
@@ -878,7 +878,7 @@ static int key_driver_fetch_keys( const char *key, struct regsubkey_ctr *subkeys
 
 	/* if anything else left, just say if has no subkeys */
 
-	DEBUG(1,("key_driver_fetch_keys unhandled key [%s] (subkey == %s\n",
+	DEBUG(1,("key_driver_fetch_keys unhandled key [%s] (subkey == %s)\n",
 		key, subkeypath ));
 
 	return 0;
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 0a8c31a..50011d1 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -5729,20 +5729,14 @@ static WERROR control_printer(struct policy_handle *handle, uint32_t command,
 
 	switch (command) {
 	case SPOOLSS_PRINTER_CONTROL_PAUSE:
-		if (print_queue_pause(p->server_info, snum, &errcode)) {
-			errcode = WERR_OK;
-		}
+		errcode = print_queue_pause(p->server_info, snum);
 		break;
 	case SPOOLSS_PRINTER_CONTROL_RESUME:
 	case SPOOLSS_PRINTER_CONTROL_UNPAUSE:
-		if (print_queue_resume(p->server_info, snum, &errcode)) {
-			errcode = WERR_OK;
-		}
+		errcode = print_queue_resume(p->server_info, snum);
 		break;
 	case SPOOLSS_PRINTER_CONTROL_PURGE:
-		if (print_queue_purge(p->server_info, snum, &errcode)) {
-			errcode = WERR_OK;
-		}
+		errcode = print_queue_purge(p->server_info, snum);
 		break;
 	default:
 		return WERR_UNKNOWN_LEVEL;
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 4bcaa29..3c319a0 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -238,13 +238,46 @@ static void display_print_info3(struct spoolss_PrinterInfo3 *r)
 /****************************************************************************
 ****************************************************************************/
 
+static void display_print_info4(struct spoolss_PrinterInfo4 *r)
+{
+	printf("\tservername:[%s]\n", r->servername);
+	printf("\tprintername:[%s]\n", r->printername);
+	printf("\tattributes:[0x%x]\n", r->attributes);
+	printf("\n");
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static void display_print_info5(struct spoolss_PrinterInfo5 *r)
+{
+	printf("\tprintername:[%s]\n", r->printername);
+	printf("\tportname:[%s]\n", r->portname);
+	printf("\tattributes:[0x%x]\n", r->attributes);
+	printf("\tdevice_not_selected_timeout:[0x%x]\n", r->device_not_selected_timeout);
+	printf("\ttransmission_retry_timeout:[0x%x]\n", r->transmission_retry_timeout);
+	printf("\n");
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static void display_print_info6(struct spoolss_PrinterInfo6 *r)
+{
+	printf("\tstatus:[0x%x]\n", r->status);
+	printf("\n");
+}
+
+/****************************************************************************
+****************************************************************************/
+
 static void display_print_info7(struct spoolss_PrinterInfo7 *r)
 {
 	printf("\tguid:[%s]\n", r->guid);
 	printf("\taction:[0x%x]\n", r->action);
+	printf("\n");
 }
 
-
 /****************************************************************************
 ****************************************************************************/
 
@@ -306,6 +339,15 @@ static WERROR cmd_spoolss_enum_printers(struct rpc_pipe_client *cli,
 			case 3:
 				display_print_info3(&info[i].info3);
 				break;
+			case 4:
+				display_print_info4(&info[i].info4);
+				break;
+			case 5:
+				display_print_info5(&info[i].info5);
+				break;
+			case 6:
+				display_print_info6(&info[i].info6);
+				break;
 			default:
 				printf("unknown info level %d\n", level);
 				goto done;
@@ -624,6 +666,15 @@ static WERROR cmd_spoolss_getprinter(struct rpc_pipe_client *cli,
 	case 3:
 		display_print_info3(&info.info3);
 		break;
+	case 4:
+		display_print_info4(&info.info4);
+		break;
+	case 5:
+		display_print_info5(&info.info5);
+		break;
+	case 6:
+		display_print_info6(&info.info6);
+		break;
 	case 7:
 		display_print_info7(&info.info7);
 		break;
@@ -917,7 +968,8 @@ static void display_print_driver1(struct spoolss_DriverInfo1 *r)
 	}
 
 	printf("Printer Driver Info 1:\n");
-	printf("\tDriver Name: [%s]\n\n", r->driver_name);
+	printf("\tDriver Name: [%s]\n", r->driver_name);
+	printf("\n");
 }
 
 /****************************************************************************
@@ -935,7 +987,8 @@ static void display_print_driver2(struct spoolss_DriverInfo2 *r)
 	printf("\tArchitecture: [%s]\n", r->architecture);
 	printf("\tDriver Path: [%s]\n", r->driver_path);
 	printf("\tDatafile: [%s]\n", r->data_file);
-	printf("\tConfigfile: [%s]\n\n", r->config_file);
+	printf("\tConfigfile: [%s]\n", r->config_file);
+	printf("\n");
 }
 
 /****************************************************************************
@@ -955,19 +1008,165 @@ static void display_print_driver3(struct spoolss_DriverInfo3 *r)
 	printf("\tArchitecture: [%s]\n", r->architecture);
 	printf("\tDriver Path: [%s]\n", r->driver_path);
 	printf("\tDatafile: [%s]\n", r->data_file);
-	printf("\tConfigfile: [%s]\n\n", r->config_file);
-	printf("\tHelpfile: [%s]\n\n", r->help_file);
+	printf("\tConfigfile: [%s]\n", r->config_file);
+	printf("\tHelpfile: [%s]\n", r->help_file);
 
-	for (i=0; r->dependent_files[i] != NULL; i++) {
+	for (i=0; r->dependent_files && r->dependent_files[i] != NULL; i++) {
 		printf("\tDependentfiles: [%s]\n", r->dependent_files[i]);
 	}
 
+	printf("\tMonitorname: [%s]\n", r->monitor_name);
+	printf("\tDefaultdatatype: [%s]\n", r->default_datatype);
+	printf("\n");
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static void display_print_driver4(struct spoolss_DriverInfo4 *r)
+{
+	int i;
+
+	if (!r) {
+		return;
+	}
+
+	printf("Printer Driver Info 4:\n");
+	printf("\tVersion: [%x]\n", r->version);
+	printf("\tDriver Name: [%s]\n", r->driver_name);
+	printf("\tArchitecture: [%s]\n", r->architecture);
+	printf("\tDriver Path: [%s]\n", r->driver_path);
+	printf("\tDatafile: [%s]\n", r->data_file);
+	printf("\tConfigfile: [%s]\n", r->config_file);
+	printf("\tHelpfile: [%s]\n", r->help_file);
+
+	for (i=0; r->dependent_files && r->dependent_files[i] != NULL; i++) {
+		printf("\tDependentfiles: [%s]\n", r->dependent_files[i]);
+	}
+
+	printf("\tMonitorname: [%s]\n", r->monitor_name);
+	printf("\tDefaultdatatype: [%s]\n", r->default_datatype);
+
+	for (i=0; r->previous_names && r->previous_names[i] != NULL; i++) {
+		printf("\tPrevious Names: [%s]\n", r->previous_names[i]);
+	}
+	printf("\n");
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static void display_print_driver5(struct spoolss_DriverInfo5 *r)
+{
+	if (!r) {
+		return;
+	}
+
+	printf("Printer Driver Info 5:\n");
+	printf("\tVersion: [%x]\n", r->version);
+	printf("\tDriver Name: [%s]\n", r->driver_name);
+	printf("\tArchitecture: [%s]\n", r->architecture);
+	printf("\tDriver Path: [%s]\n", r->driver_path);
+	printf("\tDatafile: [%s]\n", r->data_file);
+	printf("\tConfigfile: [%s]\n", r->config_file);
+	printf("\tDriver Attributes: [0x%x]\n", r->driver_attributes);
+	printf("\tConfig Version: [0x%x]\n", r->config_version);
+	printf("\tDriver Version: [0x%x]\n", r->driver_version);
 	printf("\n");
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static void display_print_driver6(struct spoolss_DriverInfo6 *r)
+{
+	int i;
+
+	if (!r) {
+		return;
+	}
+
+	printf("Printer Driver Info 6:\n");
+	printf("\tVersion: [%x]\n", r->version);
+	printf("\tDriver Name: [%s]\n", r->driver_name);
+	printf("\tArchitecture: [%s]\n", r->architecture);
+	printf("\tDriver Path: [%s]\n", r->driver_path);
+	printf("\tDatafile: [%s]\n", r->data_file);
+	printf("\tConfigfile: [%s]\n", r->config_file);
+	printf("\tHelpfile: [%s]\n", r->help_file);
+
+	for (i=0; r->dependent_files && r->dependent_files[i] != NULL; i++) {
+		printf("\tDependentfiles: [%s]\n", r->dependent_files[i]);
+	}
 
 	printf("\tMonitorname: [%s]\n", r->monitor_name);
-	printf("\tDefaultdatatype: [%s]\n\n", r->default_datatype);
+	printf("\tDefaultdatatype: [%s]\n", r->default_datatype);
+
+	for (i=0; r->previous_names && r->previous_names[i] != NULL; i++) {
+		printf("\tPrevious Names: [%s]\n", r->previous_names[i]);
+	}
+
+	printf("\tDriver Date: [%s]\n", nt_time_string(talloc_tos(), r->driver_date));
+	printf("\tDriver Version: [0x%016llx]\n", r->driver_version);
+	printf("\tManufacturer Name: [%s]\n", r->manufacturer_name);
+	printf("\tManufacturer Url: [%s]\n", r->manufacturer_url);
+	printf("\tHardware ID: [%s]\n", r->hardware_id);
+	printf("\tProvider: [%s]\n", r->provider);
+
+	printf("\n");
 }
 
+/****************************************************************************
+****************************************************************************/
+
+static void display_print_driver8(struct spoolss_DriverInfo8 *r)
+{
+	int i;
+
+	if (!r) {
+		return;
+	}
+
+	printf("Printer Driver Info 8:\n");
+	printf("\tVersion: [%x]\n", r->version);
+	printf("\tDriver Name: [%s]\n", r->driver_name);
+	printf("\tArchitecture: [%s]\n", r->architecture);
+	printf("\tDriver Path: [%s]\n", r->driver_path);
+	printf("\tDatafile: [%s]\n", r->data_file);
+	printf("\tConfigfile: [%s]\n", r->config_file);
+	printf("\tHelpfile: [%s]\n", r->help_file);
+	printf("\tMonitorname: [%s]\n", r->monitor_name);
+	printf("\tDefaultdatatype: [%s]\n", r->default_datatype);
+
+	for (i=0; r->dependent_files && r->dependent_files[i] != NULL; i++) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list