diff options
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 1be11f6a18..088945fb79 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -6521,14 +6521,15 @@ WERROR _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM return WERR_BADFID; } - /* - * FIXME!! Feels like there should be an access check here, but haven't - * had time to verify. --jerry - */ - - if (!get_printer_snum(p,handle, &snum)) return WERR_BADFID; + + if (!print_access_check(NULL, snum, PRINTER_ACCESS_ADMINISTER)) { + DEBUG(3, ("security descriptor change denied by existing " + "security descriptor\n")); + status = WERR_ACCESS_DENIED; + goto done; + } /* can't add if builtin */ if (get_a_builtin_ntform(&form->name,&tmpForm)) { @@ -6544,9 +6545,6 @@ WERROR _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM * ChangeID must always be set */ - if (!get_printer_snum(p,handle, &snum)) - return WERR_BADFID; - status = get_a_printer(&printer, 2, lp_servicename(snum)); if (!W_ERROR_IS_OK(status)) goto done; @@ -6607,9 +6605,6 @@ WERROR _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DE * ChangeID must always be set */ - if (!get_printer_snum(p,handle, &snum)) - return WERR_BADFID; - status = get_a_printer(&printer, 2, lp_servicename(snum)); if (!W_ERROR_IS_OK(status)) goto done; @@ -6672,9 +6667,6 @@ WERROR _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM * * ChangeID must always be set */ - if (!get_printer_snum(p,handle, &snum)) - return WERR_BADFID; - status = get_a_printer(&printer, 2, lp_servicename(snum)); if (!W_ERROR_IS_OK(status)) goto done; |