mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
Tidied up some error returns from printing calls. Still need to map UNIX
errors to NT error for print job failure returns. Patch from John Reilly at HP.
Jeremy.
(This used to be commit 3514b5bb8f
)
This commit is contained in:
parent
b3addf7ebe
commit
f03879e0b3
@ -2170,9 +2170,13 @@ BOOL print_access_check(struct current_user *user, int snum,
|
||||
|
||||
/* Get printer name */
|
||||
pname = PRINTERNAME(snum);
|
||||
if (!pname || !*pname) pname = SERVICE(snum);
|
||||
if (!pname || !*pname)
|
||||
pname = SERVICE(snum);
|
||||
|
||||
if (!pname || !*pname) return False;
|
||||
if (!pname || !*pname) {
|
||||
errno = EACCES;
|
||||
return False;
|
||||
}
|
||||
|
||||
/* Get printer security descriptor */
|
||||
nt_printing_getsec(pname, &secdesc);
|
||||
@ -2220,6 +2224,9 @@ BOOL print_access_check(struct current_user *user, int snum,
|
||||
/* Free mallocated memory */
|
||||
free_sec_desc_buf(&secdesc);
|
||||
|
||||
if (!result)
|
||||
errno = EACCES;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -622,6 +622,8 @@ int print_job_start(struct current_user *user, int snum, char *jobname)
|
||||
int next_jobid;
|
||||
extern struct current_user current_user;
|
||||
|
||||
errno = 0;
|
||||
|
||||
if (!print_access_check(user, snum, PRINTER_ACE_PRINT)) {
|
||||
DEBUG(3, ("job start denied by security descriptor\n"));
|
||||
return False;
|
||||
@ -713,7 +715,7 @@ int print_job_start(struct current_user *user, int snum, char *jobname)
|
||||
}
|
||||
|
||||
tdb_writeunlock(tdb);
|
||||
return jobid;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -2919,19 +2919,16 @@ uint32 _spoolss_startdocprinter(POLICY_HND *handle, uint32 level,
|
||||
* server-side code. *nnnnnggggh!*
|
||||
*/
|
||||
|
||||
if (info_1->p_datatype != 0)
|
||||
{
|
||||
unistr2_to_ascii(datatype, &(info_1->docname), sizeof(datatype));
|
||||
if (strcmp(datatype, "RAW") != 0)
|
||||
{
|
||||
if (info_1->p_datatype != 0) {
|
||||
unistr2_to_ascii(datatype, &info_1->docname, sizeof(datatype));
|
||||
if (strcmp(datatype, "RAW") != 0) {
|
||||
(*jobid)=0;
|
||||
return ERROR_INVALID_DATATYPE;
|
||||
}
|
||||
}
|
||||
|
||||
/* get the share number of the printer */
|
||||
if (!get_printer_snum(handle, &snum))
|
||||
{
|
||||
if (!get_printer_snum(handle, &snum)) {
|
||||
return ERROR_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user