s3-spoolss: make us pass the RPC-SPOOLSS torture test w.r.t. directory calls.
authorGünther Deschner <gd@samba.org>
Wed, 25 Feb 2009 20:08:13 +0000 (21:08 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 25 Feb 2009 20:18:09 +0000 (21:18 +0100)
Guenther

source3/rpc_server/srv_spoolss_nt.c

index 62301c001bd91edc66b9defbc9f0a537f19846a7..2f89775101879364248d508402b0096ddded0aae 100644 (file)
@@ -8180,28 +8180,21 @@ WERROR _spoolss_GetPrinterDriverDirectory(pipes_struct *p,
                return WERR_INVALID_PARAM;
        }
 
-       if (r->in.offered > MAX_RPC_DATA_SIZE) {
-               return WERR_INVALID_PARAM;
-       }
-
-       DEBUG(4,("_spoolss_GetPrinterDriverDirectory\n"));
+       DEBUG(5,("_spoolss_GetPrinterDriverDirectory: level %d\n",
+               r->in.level));
 
        *r->out.needed = 0;
 
-       switch (r->in.level) {
-       case 1:
-               werror = getprinterdriverdir_level_1(p->mem_ctx,
-                                                    r->in.server,
-                                                    r->in.environment,
-                                                    &r->out.info->info1,
-                                                    r->in.offered,
-                                                    r->out.needed);
-               if (!W_ERROR_IS_OK(werror)) {
-                       TALLOC_FREE(r->out.info);
-               }
-               break;
-       default:
-               return WERR_UNKNOWN_LEVEL;
+       /* r->in.level is ignored */
+
+       werror = getprinterdriverdir_level_1(p->mem_ctx,
+                                            r->in.server,
+                                            r->in.environment,
+                                            &r->out.info->info1,
+                                            r->in.offered,
+                                            r->out.needed);
+       if (!W_ERROR_IS_OK(werror)) {
+               TALLOC_FREE(r->out.info);
        }
 
        return werror;
@@ -9834,28 +9827,21 @@ WERROR _spoolss_GetPrintProcessorDirectory(pipes_struct *p,
                return WERR_INVALID_PARAM;
        }
 
-       if (r->in.offered > MAX_RPC_DATA_SIZE) {
-               return WERR_INVALID_PARAM;
-       }
-
-       DEBUG(5,("_spoolss_GetPrintProcessorDirectory\n"));
+       DEBUG(5,("_spoolss_GetPrintProcessorDirectory: level %d\n",
+               r->in.level));
 
        *r->out.needed = 0;
 
-       switch (r->in.level) {
-       case 1:
-               result = getprintprocessordirectory_level_1(p->mem_ctx,
-                                                           r->in.server,
-                                                           r->in.environment,
-                                                           &r->out.info->info1,
-                                                           r->in.offered,
-                                                           r->out.needed);
-               if (!W_ERROR_IS_OK(result)) {
-                       TALLOC_FREE(r->out.info);
-               }
-               break;
-       default:
-               result = WERR_UNKNOWN_LEVEL;
+       /* r->in.level is ignored */
+
+       result = getprintprocessordirectory_level_1(p->mem_ctx,
+                                                   r->in.server,
+                                                   r->in.environment,
+                                                   &r->out.info->info1,
+                                                   r->in.offered,
+                                                   r->out.needed);
+       if (!W_ERROR_IS_OK(result)) {
+               TALLOC_FREE(r->out.info);
        }
 
        return result;