svn commit: samba r16898 - in trunk/source/printing: .

vlendec at samba.org vlendec at samba.org
Sun Jul 9 13:41:57 GMT 2006


Author: vlendec
Date: 2006-07-09 13:41:56 +0000 (Sun, 09 Jul 2006)
New Revision: 16898

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16898

Log:
is_owner really needs the share name, not the snum...

There are a lot of functions in printing like this. Jerry, if it is ok I'll
start lifting the snum to one level higher step by step.

Volker

Modified:
   trunk/source/printing/printing.c


Changeset:
Modified: trunk/source/printing/printing.c
===================================================================
--- trunk/source/printing/printing.c	2006-07-09 13:18:15 UTC (rev 16897)
+++ trunk/source/printing/printing.c	2006-07-09 13:41:56 UTC (rev 16898)
@@ -1942,9 +1942,10 @@
  Return true if the current user owns the print job.
 ****************************************************************************/
 
-static BOOL is_owner(struct current_user *user, int snum, uint32 jobid)
+static BOOL is_owner(struct current_user *user, const char *servicename,
+		     uint32 jobid)
 {
-	struct printjob *pjob = print_job_find(lp_const_servicename(snum), jobid);
+	struct printjob *pjob = print_job_find(servicename, jobid);
 	user_struct *vuser;
 
 	if (!pjob || !user)
@@ -1970,7 +1971,7 @@
 
 	*errcode = WERR_OK;
 		
-	owner = is_owner(user, snum, jobid);
+	owner = is_owner(user, lp_const_servicename(snum), jobid);
 	
 	/* Check access against security descriptor or whether the user
 	   owns their job. */
@@ -2049,7 +2050,7 @@
 		return False;
 	}
 
-	if (!is_owner(user, snum, jobid) &&
+	if (!is_owner(user, lp_const_servicename(snum), jobid) &&
 	    !print_access_check(user, snum, JOB_ACCESS_ADMINISTER)) {
 		DEBUG(3, ("pause denied by security descriptor\n"));
 
@@ -2109,7 +2110,7 @@
 		return False;
 	}
 
-	if (!is_owner(user, snum, jobid) &&
+	if (!is_owner(user, lp_const_servicename(snum), jobid) &&
 	    !print_access_check(user, snum, JOB_ACCESS_ADMINISTER)) {
 		DEBUG(3, ("resume denied by security descriptor\n"));
 		*errcode = WERR_ACCESS_DENIED;
@@ -2817,7 +2818,7 @@
 		become_root();
 
 	for (i=0;i<njobs;i++) {
-		BOOL owner = is_owner(user, snum, queue[i].job);
+		BOOL owner = is_owner(user, lp_const_servicename(snum), queue[i].job);
 
 		if (owner || can_job_admin) {
 			print_job_delete1(snum, queue[i].job);



More information about the samba-cvs mailing list