s3-rpcclient: add deldriverex flags argument
authorDavid Disseldorp <ddiss@samba.org>
Wed, 11 Jan 2012 11:29:58 +0000 (12:29 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Wed, 11 Jan 2012 13:39:35 +0000 (14:39 +0100)
The spoolss DeletePrinterDriverEx command offers three flags for
controlling how associated files and other versions of the driver are
effected: DPD_DELETE_UNUSED_FILES (1), DPD_DELETE_SPECIFIC_VERSION (2)
and DPD_DELETE_ALL_FILES (4).

This commit adds an optional numeric flags argument to the rpcclient
deldriverex command.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Autobuild-User: David Disseldorp <ddiss@samba.org>
Autobuild-Date: Wed Jan 11 14:39:35 CET 2012 on sn-devel-104

docs-xml/manpages-3/rpcclient.1.xml
source3/rpcclient/cmd_spoolss.c

index 40e4b9b6bcf713d77eda3b6e101b72bae8eefcfb..46d56ee56020a461a85349695bd5db50660b92c3 100644 (file)
@@ -273,10 +273,13 @@ Comma Separated list of Files
                only the entry from the server's list of drivers.
                </para></listitem></varlistentry>
 
-               <varlistentry><term>deldriverex &lt;driver&gt; [architecture] [version]
-               </term><listitem><para>Delete the specified printer driver including driver files. 
-               You can limit this action to a specific architecture and a specific version. 
-               If no architecure is given, all driver files of that driver will be deleted. 
+               <varlistentry><term>deldriverex &lt;driver&gt; [architecture] [version] [flags]
+               </term><listitem><para>Delete the specified printer driver and optionally files
+               associated with the driver.
+               You can limit this action to a specific architecture and a specific version.
+               If no architecure is given, all driver files of that driver will be deleted.
+               <parameter>flags</parameter> correspond to numeric DPD_* values, i.e. a value
+               of 3 requests (DPD_DELETE_UNUSED_FILES | DPD_DELETE_SPECIFIC_VERSION).
                </para></listitem></varlistentry>
 
                <varlistentry><term>enumdata</term><listitem><para>Enumerate all 
index 0e12201f927aedf67a06f0f7f8940576abf358c1..21f70aeb41561e3695b75c9964cf5dc35213acc3 100644 (file)
@@ -1928,24 +1928,24 @@ static WERROR cmd_spoolss_deletedriverex(struct rpc_pipe_client *cli,
        uint32_t delete_flags = 0;
 
        /* parse the command arguments */
-       if (argc < 2 || argc > 4) {
-               printf ("Usage: %s <driver> [arch] [version]\n", argv[0]);
+       if (argc < 2 || argc > 5) {
+               printf("Usage: %s <driver> [arch] [version] [flags]\n", argv[0]);
                return WERR_OK;
        }
 
        if (argc >= 3)
                arch = argv[2];
-       if (argc == 4)
-               vers = atoi (argv[3]);
-
-       if (vers >= 0) {
+       if (argc >= 4) {
+               vers = atoi(argv[3]);
                delete_flags |= DPD_DELETE_SPECIFIC_VERSION;
        }
+       if (argc == 5)
+               delete_flags = atoi(argv[4]);
 
        /* delete the driver for all architectures */
        for (i=0; archi_table[i].long_archi; i++) {
 
-               if (arch &&  !strequal( archi_table[i].long_archi, arch))
+               if (arch && !strequal(archi_table[i].long_archi, arch))
                        continue;
 
                if (vers >= 0 && archi_table[i].version != vers)