svn commit: samba r21446 - in branches: SAMBA_3_0/source/param SAMBA_3_0/source/printing SAMBA_3_0_25/source/param SAMBA_3_0_25/source/printing

vlendec at samba.org vlendec at samba.org
Mon Feb 19 13:30:09 GMT 2007


Author: vlendec
Date: 2007-02-19 13:30:07 +0000 (Mon, 19 Feb 2007)
New Revision: 21446

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

Log:
Karolins "printjob username"
Modified:
   branches/SAMBA_3_0/source/param/loadparm.c
   branches/SAMBA_3_0/source/printing/printing.c
   branches/SAMBA_3_0_25/source/param/loadparm.c
   branches/SAMBA_3_0_25/source/printing/printing.c


Changeset:
Modified: branches/SAMBA_3_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_0/source/param/loadparm.c	2007-02-19 11:45:33 UTC (rev 21445)
+++ branches/SAMBA_3_0/source/param/loadparm.c	2007-02-19 13:30:07 UTC (rev 21446)
@@ -349,6 +349,7 @@
 	char *szQueuepausecommand;
 	char *szQueueresumecommand;
 	char *szPrintername;
+	char *szPrintjobUsername;
 	char *szDontdescend;
 	char **szHostsallow;
 	char **szHostsdeny;
@@ -488,6 +489,7 @@
 	NULL,			/* szQueuepausecommand */
 	NULL,			/* szQueueresumecommand */
 	NULL,			/* szPrintername */
+	NULL,			/* szPrintjobUsername */
 	NULL,			/* szDontdescend */
 	NULL,			/* szHostsallow */
 	NULL,			/* szHostsdeny */
@@ -1065,6 +1067,7 @@
 	{"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, 
 	{"default devmode", P_BOOL, P_LOCAL, &sDefault.bDefaultDevmode, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, 
 	{"force printername", P_BOOL, P_LOCAL, &sDefault.bForcePrintername, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, 
+	{"printjob username", P_STRING, P_LOCAL, &sDefault.szPrintjobUsername, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
 
 	{N_("Filename Handling"), P_SEP, P_SEPARATOR}, 
 	{"mangling method", P_STRING, P_GLOBAL, &Globals.szManglingMethod, NULL, NULL, FLAG_ADVANCED}, 
@@ -1409,6 +1412,7 @@
 				string_set((char **)parm_table[i].ptr, "");
 
 		string_set(&sDefault.fstype, FSTYPE_STRING);
+		string_set(&sDefault.szPrintjobUsername, "%U");
 
 		init_printer_values(&sDefault);
 
@@ -1995,6 +1999,7 @@
 FN_LOCAL_STRING(lp_queuepausecommand, szQueuepausecommand)
 FN_LOCAL_STRING(lp_queueresumecommand, szQueueresumecommand)
 static FN_LOCAL_STRING(_lp_printername, szPrintername)
+FN_LOCAL_CONST_STRING(lp_printjob_username, szPrintjobUsername)
 FN_LOCAL_LIST(lp_hostsallow, szHostsallow)
 FN_LOCAL_LIST(lp_hostsdeny, szHostsdeny)
 FN_LOCAL_STRING(lp_magicscript, szMagicScript)

Modified: branches/SAMBA_3_0/source/printing/printing.c
===================================================================
--- branches/SAMBA_3_0/source/printing/printing.c	2007-02-19 11:45:33 UTC (rev 21445)
+++ branches/SAMBA_3_0/source/printing/printing.c	2007-02-19 13:30:07 UTC (rev 21446)
@@ -2396,7 +2396,11 @@
 	fstrcpy(pjob.jobname, jobname);
 
 	if ((vuser = get_valid_user_struct(user->vuid)) != NULL) {
-		fstrcpy(pjob.user, vuser->user.smb_name);
+		fstrcpy(pjob.user, lp_printjob_username(snum));
+		standard_sub_basic(vuser->user.smb_name, vuser->user.domain, 
+				   pjob.user, sizeof(pjob.user)-1);
+		/* ensure NULL termination */ 
+		pjob.user[sizeof(pjob.user)-1] = '\0'; 
 	} else {
 		fstrcpy(pjob.user, uidtoname(user->ut.uid));
 	}

Modified: branches/SAMBA_3_0_25/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_0_25/source/param/loadparm.c	2007-02-19 11:45:33 UTC (rev 21445)
+++ branches/SAMBA_3_0_25/source/param/loadparm.c	2007-02-19 13:30:07 UTC (rev 21446)
@@ -348,6 +348,7 @@
 	char *szQueuepausecommand;
 	char *szQueueresumecommand;
 	char *szPrintername;
+	char *szPrintjobUsername;
 	char *szDontdescend;
 	char **szHostsallow;
 	char **szHostsdeny;
@@ -488,6 +489,7 @@
 	NULL,			/* szQueuepausecommand */
 	NULL,			/* szQueueresumecommand */
 	NULL,			/* szPrintername */
+	NULL,			/* szPrintjobUsername */
 	NULL,			/* szDontdescend */
 	NULL,			/* szHostsallow */
 	NULL,			/* szHostsdeny */
@@ -1067,6 +1069,7 @@
 	{"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, 
 	{"default devmode", P_BOOL, P_LOCAL, &sDefault.bDefaultDevmode, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, 
 	{"force printername", P_BOOL, P_LOCAL, &sDefault.bForcePrintername, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, 
+	{"printjob username", P_STRING, P_LOCAL, &sDefault.szPrintjobUsername, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
 
 	{N_("Filename Handling"), P_SEP, P_SEPARATOR}, 
 	{"mangling method", P_STRING, P_GLOBAL, &Globals.szManglingMethod, NULL, NULL, FLAG_ADVANCED}, 
@@ -1410,6 +1413,7 @@
 				string_set((char **)parm_table[i].ptr, "");
 
 		string_set(&sDefault.fstype, FSTYPE_STRING);
+		string_set(&sDefault.szPrintjobUsername, "%U");
 
 		init_printer_values(&sDefault);
 
@@ -1993,6 +1997,7 @@
 FN_LOCAL_STRING(lp_queuepausecommand, szQueuepausecommand)
 FN_LOCAL_STRING(lp_queueresumecommand, szQueueresumecommand)
 static FN_LOCAL_STRING(_lp_printername, szPrintername)
+FN_LOCAL_CONST_STRING(lp_printjob_username, szPrintjobUsername)
 FN_LOCAL_LIST(lp_hostsallow, szHostsallow)
 FN_LOCAL_LIST(lp_hostsdeny, szHostsdeny)
 FN_LOCAL_STRING(lp_magicscript, szMagicScript)

Modified: branches/SAMBA_3_0_25/source/printing/printing.c
===================================================================
--- branches/SAMBA_3_0_25/source/printing/printing.c	2007-02-19 11:45:33 UTC (rev 21445)
+++ branches/SAMBA_3_0_25/source/printing/printing.c	2007-02-19 13:30:07 UTC (rev 21446)
@@ -2396,7 +2396,11 @@
 	fstrcpy(pjob.jobname, jobname);
 
 	if ((vuser = get_valid_user_struct(user->vuid)) != NULL) {
-		fstrcpy(pjob.user, vuser->user.smb_name);
+		fstrcpy(pjob.user, lp_printjob_username(snum));
+		standard_sub_basic(vuser->user.smb_name, vuser->user.domain, 
+				   pjob.user, sizeof(pjob.user)-1);
+		/* ensure NULL termination */ 
+		pjob.user[sizeof(pjob.user)-1] = '\0'; 
 	} else {
 		fstrcpy(pjob.user, uidtoname(user->ut.uid));
 	}



More information about the samba-cvs mailing list