s3-rpcclient: allow to set offered size for enumkey command.
[ira/wip.git] / source3 / rpcclient / cmd_spoolss.c
index 5393ba75a9963fbf7be95688f098cb81fd1f5771..6101fc651d9ec7d73605f181ea164b79cfa68660 100644 (file)
@@ -2906,18 +2906,23 @@ static WERROR cmd_spoolss_enum_printerkey(struct rpc_pipe_client *cli,
        struct policy_handle hnd;
        const char **key_buffer = NULL;
        int i;
        struct policy_handle hnd;
        const char **key_buffer = NULL;
        int i;
+       uint32_t offered = 0;
 
 
-       if (argc < 2 || argc > 3) {
-               printf("Usage: %s printername [keyname]\n", argv[0]);
+       if (argc < 2 || argc > 4) {
+               printf("Usage: %s printername [keyname] [offered]\n", argv[0]);
                return WERR_OK;
        }
 
                return WERR_OK;
        }
 
-       if (argc == 3) {
+       if (argc >= 3) {
                keyname = argv[2];
        } else {
                keyname = "";
        }
 
                keyname = argv[2];
        } else {
                keyname = "";
        }
 
+       if (argc == 4) {
+               offered = atoi(argv[3]);
+       }
+
        /* Open printer handle */
 
        RPCCLIENT_PRINTERNAME(printername, cli, argv[1]);
        /* Open printer handle */
 
        RPCCLIENT_PRINTERNAME(printername, cli, argv[1]);
@@ -2936,7 +2941,7 @@ static WERROR cmd_spoolss_enum_printerkey(struct rpc_pipe_client *cli,
                                               &hnd,
                                               keyname,
                                               &key_buffer,
                                               &hnd,
                                               keyname,
                                               &key_buffer,
-                                              0);
+                                              offered);
 
        if (!W_ERROR_IS_OK(result)) {
                goto done;
 
        if (!W_ERROR_IS_OK(result)) {
                goto done;