summaryrefslogtreecommitdiff
path: root/source3/smbwrapper
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-04 10:14:21 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-04 10:14:21 +0000
commita1b002fcbe5daa91ce8bc94b73760e2428238315 (patch)
tree005af724097b775b4b277b20590446eb91af7c7d /source3/smbwrapper
parent6760e69a68571e01ee57b959193a56278962a23c (diff)
downloadsamba-a1b002fcbe5daa91ce8bc94b73760e2428238315.tar.gz
samba-a1b002fcbe5daa91ce8bc94b73760e2428238315.tar.bz2
samba-a1b002fcbe5daa91ce8bc94b73760e2428238315.zip
add support for unlink() on printer shares in smbwrapper. unlink()
will remove the job from the pirnt queue. (This used to be commit 7bd738c30a09a211fd14a8544309efeec17c66f5)
Diffstat (limited to 'source3/smbwrapper')
-rw-r--r--source3/smbwrapper/smbw.c10
-rw-r--r--source3/smbwrapper/smbw_stat.c10
2 files changed, 16 insertions, 4 deletions
diff --git a/source3/smbwrapper/smbw.c b/source3/smbwrapper/smbw.c
index 3a2cbcf5ac..0abe823e29 100644
--- a/source3/smbwrapper/smbw.c
+++ b/source3/smbwrapper/smbw.c
@@ -756,7 +756,15 @@ int smbw_unlink(const char *fname)
goto failed;
}
- if (!cli_unlink(&srv->cli, path)) {
+ if (strncmp(srv->cli.dev, "LPT", 3) == 0) {
+ int job = smbw_stat_printjob(srv, path, NULL, NULL);
+ if (job == -1) {
+ goto failed;
+ }
+ if (cli_printjob_del(&srv->cli, job) != 0) {
+ goto failed;
+ }
+ } else if (!cli_unlink(&srv->cli, path)) {
errno = smbw_errno(&srv->cli);
goto failed;
}
diff --git a/source3/smbwrapper/smbw_stat.c b/source3/smbwrapper/smbw_stat.c
index 69ca38a2ae..d0b0e59b4f 100644
--- a/source3/smbwrapper/smbw_stat.c
+++ b/source3/smbwrapper/smbw_stat.c
@@ -100,9 +100,13 @@ int smbw_stat_printjob(struct smbw_server *srv,char *path,
fstrcpy(printjob.name, path);
cli_print_queue(&srv->cli, smbw_printjob_stat);
- *size = printjob.size;
- *m_time = printjob.t;
- return 0;
+ if (size) {
+ *size = printjob.size;
+ }
+ if (m_time) {
+ *m_time = printjob.t;
+ }
+ return printjob.id;
}