summaryrefslogtreecommitdiff
path: root/usr/src/cmd/lp
diff options
context:
space:
mode:
authorsonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>2010-04-26 20:06:29 +0530
committersonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>2010-04-26 20:06:29 +0530
commit1c0f3f009eb3d816a7be93e5ce9d49a177ceac77 (patch)
treec3cfc98c018431ccc7f485208c07dd7b071cf669 /usr/src/cmd/lp
parent98d1cbfec254295273b6a761bc1861c0374bdf02 (diff)
downloadillumos-joyent-1c0f3f009eb3d816a7be93e5ce9d49a177ceac77.tar.gz
6922197 Remote printing broken if banner page is disabled
Diffstat (limited to 'usr/src/cmd/lp')
-rw-r--r--usr/src/cmd/lp/cmd/lpsched/exec.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/usr/src/cmd/lp/cmd/lpsched/exec.c b/usr/src/cmd/lp/cmd/lpsched/exec.c
index da9ec06f4d..081639b388 100644
--- a/usr/src/cmd/lp/cmd/lpsched/exec.c
+++ b/usr/src/cmd/lp/cmd/lpsched/exec.c
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -314,7 +313,7 @@ exec(int type, ...)
char *mail_zonename = NULL;
char *slabel = NULL;
int setid = 1;
- char *ridno = NULL;
+ char *ridno = NULL, *tmprid = NULL;
syslog(LOG_DEBUG, "exec(%s)", _exec_name(type));
@@ -770,13 +769,18 @@ exec(int type, ...)
*/
if (STRNEQU(options, "job-id-requested=", 17)) {
ridno = strdup(options + 17);
- if (ridno != NULL)
+ tmprid = strstr(ridno, " ");
+ if (ridno != NULL) {
/*
* Read job-id-requested
* successfully
*/
+ tmprid = strstr(ridno, " ");
+ if (tmprid != NULL)
+ *tmprid = '\0';
+
setid = 0;
- else
+ } else
/*
* could not read
* ridno from the string
@@ -861,6 +865,9 @@ exec(int type, ...)
if (ridno != NULL)
free(ridno);
+
+ if (tmprid != NULL)
+ free(tmprid);
}
av[ac++] = arg_string(UNTRUSTED, "%s", request->request->user);