Patch from James Henstridge to allow rpcclient adddriver command to specify
authorTim Potter <tpot@samba.org>
Wed, 5 Nov 2003 16:40:13 +0000 (16:40 +0000)
committerTim Potter <tpot@samba.org>
Wed, 5 Nov 2003 16:40:13 +0000 (16:40 +0000)
printer driver version.  Closes bug #514.

source/rpcclient/cmd_spoolss.c

index eca31ae4444699b4bb497e8ae223065950e028f8..798949fae92f448ac400204d2ad34d6366a5ca6e 100644 (file)
@@ -1266,12 +1266,13 @@ static WERROR cmd_spoolss_addprinterdriver(struct cli_state *cli,
        fstring                 driver_name;
 
        /* parse the command arguements */
-       if (argc != 3)
+       if (argc != 3 && argc != 4)
        {
-               printf ("Usage: %s <Environment>\\\n", argv[0]);
+               printf ("Usage: %s <Environment> \\\n", argv[0]);
                printf ("\t<Long Printer Name>:<Driver File Name>:<Data File Name>:\\\n");
                printf ("\t<Config File Name>:<Help File Name>:<Language Monitor Name>:\\\n");
-               printf ("\t<Default Data Type>:<Comma Separated list of Files>\n");
+               printf ("\t<Default Data Type>:<Comma Separated list of Files> \\\n");
+               printf ("\t[version]\n");
 
             return WERR_OK;
         }
@@ -1292,6 +1293,14 @@ static WERROR cmd_spoolss_addprinterdriver(struct cli_state *cli,
                return WERR_INVALID_PARAM;
        }
 
+       /* if printer driver version specified, override the default version
+        * used by the architecture.  This allows installation of Windows
+        * 2000 (version 3) printer drivers. */
+       if (argc == 4)
+       {
+               info3.version = atoi(argv[3]);
+       }
+
 
        ctr.info3 = &info3;
        result = cli_spoolss_addprinterdriver (cli, mem_ctx, level, &ctr);