s3-spoolss: fix _spoolss_GetPrinterDriverDirectory and spoolss_GetPrintProcessorDirec...
authorGünther Deschner <gd@samba.org>
Fri, 20 Feb 2009 13:55:31 +0000 (14:55 +0100)
committerGünther Deschner <gd@samba.org>
Sat, 21 Feb 2009 20:14:20 +0000 (21:14 +0100)
Both calls need to return NULL in the error case to avoid ndr encoding problems.
(found by smbtorture spoolss test).

Guenther

source3/rpc_server/srv_spoolss_nt.c

index 7439fe51a50875513f28b6e25f79437a0cc8dffb..0fe66d9ed9d44c318be0ae6b7624a9429cf9253a 100644 (file)
@@ -8309,7 +8309,7 @@ WERROR _spoolss_GetPrinterDriverDirectory(pipes_struct *p,
                                                     &r->out.info->info1,
                                                     r->in.offered,
                                                     r->out.needed);
-               if (W_ERROR_EQUAL(werror, WERR_INSUFFICIENT_BUFFER)) {
+               if (!W_ERROR_IS_OK(werror)) {
                        TALLOC_FREE(r->out.info);
                }
                break;
@@ -9969,7 +9969,7 @@ WERROR _spoolss_GetPrintProcessorDirectory(pipes_struct *p,
                                                            &r->out.info->info1,
                                                            r->in.offered,
                                                            r->out.needed);
-               if (W_ERROR_EQUAL(result, WERR_INSUFFICIENT_BUFFER)) {
+               if (!W_ERROR_IS_OK(result)) {
                        TALLOC_FREE(r->out.info);
                }
                break;