diff options
author | Günther Deschner <gd@samba.org> | 2010-04-23 03:04:47 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-04-23 03:04:47 +0200 |
commit | a14938377e42344eb04a3d3003199b231e88dc8d (patch) | |
tree | b485b12a72cb5ab4d4f36df60bbd0941402702ff /source3/rpc_server | |
parent | 587921b7da93cc02386193ac4c3354db4717fa3f (diff) | |
download | samba-a14938377e42344eb04a3d3003199b231e88dc8d.tar.gz samba-a14938377e42344eb04a3d3003199b231e88dc8d.tar.bz2 samba-a14938377e42344eb04a3d3003199b231e88dc8d.zip |
s3-spoolss: make sure AddPrinterDriver calls into AddPrinterDriverEx.
Not vice versa. Also disable some info levels in AddPrinterDriver according to
MS-RPRN 3.1.4.4.1.
Found by torture test.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 72499d8ad0..e8b5f8e85b 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -7370,11 +7370,11 @@ WERROR _spoolss_AddPrinter(pipes_struct *p, } /**************************************************************** - _spoolss_AddPrinterDriver + _spoolss_AddPrinterDriverEx ****************************************************************/ -WERROR _spoolss_AddPrinterDriver(pipes_struct *p, - struct spoolss_AddPrinterDriver *r) +WERROR _spoolss_AddPrinterDriverEx(pipes_struct *p, + struct spoolss_AddPrinterDriverEx *r) { WERROR err = WERR_OK; char *driver_name = NULL; @@ -7392,6 +7392,18 @@ WERROR _spoolss_AddPrinterDriver(pipes_struct *p, return WERR_INVALID_PARAM; } + /* + * we only support the semantics of AddPrinterDriver() + * i.e. only copy files that are newer than existing ones + */ + + if (r->in.flags == 0) { + return WERR_INVALID_PARAM; + } + + if (r->in.flags != APD_COPY_NEW_FILES) { + return WERR_ACCESS_DENIED; + } /* FIXME */ if (r->in.info_ctr->level != 3 && r->in.info_ctr->level != 6) { @@ -7498,31 +7510,27 @@ done: } /**************************************************************** - _spoolss_AddPrinterDriverEx + _spoolss_AddPrinterDriver ****************************************************************/ -WERROR _spoolss_AddPrinterDriverEx(pipes_struct *p, - struct spoolss_AddPrinterDriverEx *r) +WERROR _spoolss_AddPrinterDriver(pipes_struct *p, + struct spoolss_AddPrinterDriver *r) { - struct spoolss_AddPrinterDriver a; - - /* - * we only support the semantics of AddPrinterDriver() - * i.e. only copy files that are newer than existing ones - */ - - if (r->in.flags == 0) { - return WERR_INVALID_PARAM; - } + struct spoolss_AddPrinterDriverEx a; - if (r->in.flags != APD_COPY_NEW_FILES) { - return WERR_ACCESS_DENIED; + switch (r->in.info_ctr->level) { + case 6: + case 8: + return WERR_UNKNOWN_LEVEL; + default: + break; } a.in.servername = r->in.servername; a.in.info_ctr = r->in.info_ctr; + a.in.flags = APD_COPY_NEW_FILES; - return _spoolss_AddPrinterDriver(p, &a); + return _spoolss_AddPrinterDriverEx(p, &a); } /**************************************************************************** |