summaryrefslogtreecommitdiff
path: root/source3/smbd/lanman.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-08-01 00:41:19 +0000
committerJeremy Allison <jra@samba.org>2000-08-01 00:41:19 +0000
commitd95777ac34f68a3525786103b9217f6397d9f1d4 (patch)
tree08979563f948bea642c0afeeea00f79179c4e104 /source3/smbd/lanman.c
parent55ff9cb38bbabfaee591f6f5190e57b5564f3942 (diff)
downloadsamba-d95777ac34f68a3525786103b9217f6397d9f1d4.tar.gz
samba-d95777ac34f68a3525786103b9217f6397d9f1d4.tar.bz2
samba-d95777ac34f68a3525786103b9217f6397d9f1d4.zip
Added print job substitutions for %{printername}, %{sharename} and %{portname}
from the NT printer tdb. Also added checks for time restrictions before allowing a job to print. Jeremy. (This used to be commit 8cfb55e81abebf0354e6d470ed68bbac1d6560ad)
Diffstat (limited to 'source3/smbd/lanman.c')
-rw-r--r--source3/smbd/lanman.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index ab2fd4d55d..047212bf9f 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -707,23 +707,21 @@ static int get_printerdrivernumber(int snum)
} else {
/* didn't find driver in tdb */
- DEBUG(10,("snum: %d\nlp_printerdriver: [%s]\nlp_driverfile: [%s]\n",
+ DEBUG(10,("snum: %d\nlp_printerdriver: [%s]\nlp_driverfile: [%s]\n",
snum, lp_printerdriver(snum), lp_driverfile(snum)));
- lines = file_lines_load(lp_driverfile(snum), NULL);
- if (!lines) {
+ lines = file_lines_load(lp_driverfile(snum), NULL);
+ if (!lines) {
DEBUG(3,("Can't open %s - %s\n", lp_driverfile(snum),strerror(errno)));
- }
- else
- {
+ } else {
/* lookup the long printer driver name in the file description */
- for (i=0;lines[i] && !ok;i++) {
- p = lines[i];
- if (next_token(&p,tok,":",sizeof(tok)) &&
- (strlen(lp_printerdriver(snum)) == strlen(tok)) &&
- (!strncmp(tok,lp_printerdriver(snum),strlen(lp_printerdriver(snum)))))
+ for (i=0;lines[i] && !ok;i++) {
+ p = lines[i];
+ if (next_token(&p,tok,":",sizeof(tok)) &&
+ (strlen(lp_printerdriver(snum)) == strlen(tok)) &&
+ (!strncmp(tok,lp_printerdriver(snum),strlen(lp_printerdriver(snum)))))
ok = True;
- }
+ }
}
}
@@ -741,7 +739,7 @@ static int get_printerdrivernumber(int snum)
i++;
file_lines_free(lines);
- return(i);
+ return(i);
}
err:
@@ -861,10 +859,10 @@ static BOOL api_DosPrintQGetInfo(connection_struct *conn,
return(True);
}
-
/****************************************************************************
- view list of all print jobs on all queues
- ****************************************************************************/
+ View list of all print jobs on all queues.
+****************************************************************************/
+
static BOOL api_DosPrintQEnum(connection_struct *conn, uint16 vuid, char* param, char* data,
int mdrcnt, int mprcnt,
char **rdata, char** rparam,