From 54de56a1be8ede7476c741cd1631ad1ac8107fcc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Apr 2000 06:22:31 +0000 Subject: 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) --- source3/smbd/fileio.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/smbd/fileio.c') 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); -- cgit