summaryrefslogtreecommitdiffstats
path: root/source/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
commitd870542c2884510bd45fd5b54ff2157434d53f4c (patch)
tree9f6a7370d17cf41ccf807f6906443dfbdeece8b9 /source/smbd/fileio.c
parent2df82862c061cca5644f5f69146c97302ccb42d5 (diff)
downloadsamba-d870542c2884510bd45fd5b54ff2157434d53f4c.tar.gz
samba-d870542c2884510bd45fd5b54ff2157434d53f4c.tar.xz
samba-d870542c2884510bd45fd5b54ff2157434d53f4c.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.
Diffstat (limited to 'source/smbd/fileio.c')
-rw-r--r--source/smbd/fileio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/smbd/fileio.c b/source/smbd/fileio.c
index 43fd091b49d..5d8c3a9710f 100644
--- a/source/smbd/fileio.c
+++ b/source/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);