summaryrefslogtreecommitdiff
path: root/source3/smbd/fileio.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-04-16 06:22:31 +0000
committerAndrew Tridgell <tridge@samba.org>2000-04-16 06:22:31 +0000
commit54de56a1be8ede7476c741cd1631ad1ac8107fcc (patch)
treea89c1c9ef109ae03623c6080331da3a36f2bfc76 /source3/smbd/fileio.c
parent8a91379a00cade86a0b448c6a7c4e949cc58185c (diff)
downloadsamba-54de56a1be8ede7476c741cd1631ad1ac8107fcc.tar.gz
samba-54de56a1be8ede7476c741cd1631ad1ac8107fcc.tar.bz2
samba-54de56a1be8ede7476c741cd1631ad1ac8107fcc.zip
the changes to the main smb code
------------ The following series of commits are for the new tdb based printing backend. This completely replaces our old printing backend. Major changes include: - all print ops are now done in printing/*.c rather than scattered all over the place - system job ids are decoupled from SMB job ids - the lpq parsers don't need to be nearly so smart, they only need to parse the filename, the status and system job id - we can store lots more info about a job, including the full job name - the queue cache control is much better I also added a new utility routine file_lines_load() that loads a text file and parses it into lines. This is used in out lpq parsing and I also want to use it to replace all of our fgets() based code in other places. (This used to be commit d870542c2884510bd45fd5b54ff2157434d53f4c)
Diffstat (limited to 'source3/smbd/fileio.c')
-rw-r--r--source3/smbd/fileio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 43fd091b49..5d8c3a9710 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -96,6 +96,11 @@ ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n)
{
ssize_t ret=0,readret;
+ /* you can't read from print files */
+ if (fsp->print_file) {
+ return -1;
+ }
+
/*
* Serve from write cache if we can.
*/
@@ -154,6 +159,10 @@ ssize_t write_file(files_struct *fsp, char *data, SMB_OFF_T pos, size_t n)
ssize_t total_written = 0;
int write_path = -1;
+ if (fsp->print_file) {
+ return print_job_write(fsp->print_jobid, data, n);
+ }
+
if (!fsp->can_write) {
errno = EPERM;
return(0);