s3-lanman: exit early for unsupported levels in api_PrintJobInfo().
authorGünther Deschner <gd@samba.org>
Mon, 3 May 2010 09:58:06 +0000 (11:58 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 3 May 2010 12:43:34 +0000 (14:43 +0200)
Guenther

source3/smbd/lanman.c

index 1a5d9e89f3246d5174f1fd78e6d950b6619979d1..954c9c84badb284961b48f759dc7a3dcb06ddc96 100644 (file)
@@ -3337,6 +3337,23 @@ static bool api_PrintJobInfo(connection_struct *conn, uint16 vuid,
                return False;
        }
 
+       *rdata_len = 0;
+
+       /* check it's a supported varient */
+       if ((strcmp(str1,"WWsTP")) ||
+           (!check_printjob_info(&desc,uLevel,str2)))
+               return(False);
+
+       errcode = NERR_notsupported;
+
+       switch (function) {
+       case 0xb:
+               /* change print job name, data gives the name */
+               break;
+       default:
+               goto out;
+       }
+
        ZERO_STRUCT(handle);
 
        status = rpc_pipe_open_internal(mem_ctx, &ndr_table_spoolss.syntax_id,
@@ -3367,13 +3384,6 @@ static bool api_PrintJobInfo(connection_struct *conn, uint16 vuid,
                goto out;
        }
 
-       *rdata_len = 0;
-
-       /* check it's a supported varient */
-       if ((strcmp(str1,"WWsTP")) || 
-           (!check_printjob_info(&desc,uLevel,str2)))
-               return(False);
-
        werr = rpccli_spoolss_getjob(cli, mem_ctx,
                                     &handle,
                                     jobid,
@@ -3385,16 +3395,6 @@ static bool api_PrintJobInfo(connection_struct *conn, uint16 vuid,
                goto out;
        }
 
-       errcode = NERR_notsupported;
-
-       switch (function) {
-       case 0xb:
-               /* change print job name, data gives the name */
-               break;
-       default:
-               goto out;
-       }
-
        ZERO_STRUCT(ctr);
 
        info1.job_id            = info.info1.job_id;