From 943471f2c83325e7ec52e952f57b4cc294856ced Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Apr 2000 07:51:15 +0000 Subject: split fsp specific routines out of printing.c to fix linking problem in TNG (This used to be commit 82df25b28b94b0041676fb433e0e677acb544579) --- source3/printing/printfsp.c | 91 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 source3/printing/printfsp.c (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c new file mode 100644 index 0000000000..72cd006e20 --- /dev/null +++ b/source3/printing/printfsp.c @@ -0,0 +1,91 @@ +/* + Unix SMB/Netbios implementation. + Version 3.0 + printing backend routines for smbd - using files_struct rather + than only snum + Copyright (C) Andrew Tridgell 1992-2000 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +extern int DEBUGLEVEL; + + +/*************************************************************************** +open a print file and setup a fsp for it. This is a wrapper around +print_job_start(). +***************************************************************************/ + +files_struct *print_fsp_open(connection_struct *conn,char *jobname) +{ + int jobid; + SMB_STRUCT_STAT sbuf; + extern struct current_user current_user; + files_struct *fsp = file_new(); + + if(!fsp) + return NULL; + + jobid = print_job_start(SNUM(conn), jobname); + if (jobid == -1) { + file_free(fsp); + return NULL; + } + + /* setup a full fsp */ + fsp->print_jobid = jobid; + fsp->fd = print_job_fd(jobid); + conn->vfs_ops.fstat(fsp->fd, &sbuf); + fsp->mode = sbuf.st_mode; + fsp->inode = sbuf.st_ino; + fsp->dev = sbuf.st_dev; + GetTimeOfDay(&fsp->open_time); + fsp->vuid = current_user.vuid; + fsp->size = 0; + fsp->pos = -1; + fsp->open = True; + fsp->can_lock = True; + fsp->can_read = False; + fsp->can_write = True; + fsp->share_mode = 0; + fsp->print_file = True; + fsp->modified = False; + fsp->oplock_type = NO_OPLOCK; + fsp->sent_oplock_break = NO_BREAK_SENT; + fsp->is_directory = False; + fsp->stat_open = False; + fsp->directory_delete_on_close = False; + fsp->conn = conn; + string_set(&fsp->fsp_name,print_job_fname(jobid)); + fsp->wbmpx_ptr = NULL; + fsp->wcp = NULL; + + conn->num_files_open++; + + return fsp; +} + +/**************************************************************************** +print a file - called on closing the file +****************************************************************************/ +void print_fsp_end(files_struct *fsp) +{ + print_job_end(fsp->print_jobid); + + if (fsp->fsp_name) { + string_free(&fsp->fsp_name); + } +} -- cgit From e82dbfcbe97c79b1c81915ae949bb2b1763970ba Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 24 Apr 2000 19:23:51 +0000 Subject: Now that fsp's are created on successful file open, the structure member fsp->open is no longer needed (if an fsp pointer is valid, then it's open :-). NB for Luke, this patch also did not apply to TNG. TNG is not yet identical w.r.t file serving with HEAD. This makes it impossible for me to help maintain TNG. Please fix asap. lib/substitute.c: Removed unused variable (pidstr). Jeremy. (This used to be commit 389b700a26e8a308a0dff6fc038c38068aa0119a) --- source3/printing/printfsp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 72cd006e20..41635561a6 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -56,7 +56,6 @@ files_struct *print_fsp_open(connection_struct *conn,char *jobname) fsp->vuid = current_user.vuid; fsp->size = 0; fsp->pos = -1; - fsp->open = True; fsp->can_lock = True; fsp->can_read = False; fsp->can_write = True; -- cgit From 49a0e6d5989656c1b3c9c063a20308ca4ee5d73b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 May 2000 10:41:59 +0000 Subject: more merging voodoo this adds "#define OLD_NTDOMAIN 1" in lots of places. Don't panic - this isn't permanent, it should go after another few merge steps have been done (This used to be commit 92109d7b3c06f240452d39f669ecb8c9c86ab610) --- source3/printing/printfsp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 41635561a6..5387502707 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -1,3 +1,5 @@ +#define OLD_NTDOMAIN 1 + /* Unix SMB/Netbios implementation. Version 3.0 @@ -88,3 +90,5 @@ void print_fsp_end(files_struct *fsp) string_free(&fsp->fsp_name); } } + +#undef OLD_NTDOMAIN -- cgit From a72c9e20803f50d77361413f9e90248ba7bff58f Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 16 Jun 2000 08:24:45 +0000 Subject: Pass the vuid from the connection_struct to the printing back end functions. (This used to be commit a8975d6e226e7271f60d5487243301db3c220d87) --- source3/printing/printfsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 5387502707..09c6140884 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -41,7 +41,7 @@ files_struct *print_fsp_open(connection_struct *conn,char *jobname) if(!fsp) return NULL; - jobid = print_job_start(SNUM(conn), jobname); + jobid = print_job_start(SNUM(conn), conn->vuid, jobname); if (jobid == -1) { file_free(fsp); return NULL; -- cgit From 78a4848e8da7bb4f96e99e3419c5473c4c23bb6d Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 10 Jul 2000 05:08:21 +0000 Subject: Re-instated lanman printing security checks (oops). A user can now pause, resume or delete their own job even if they don't have the Manage Documents privilege. Added call to se_access_check() for changing printer properties. The Full Access privilege is required for the user to perform this. Several uninitialised variables and memory leaks plugged. Modified default ACL created on new printers to be Everyone / Print instead of Everyone / Full Access. This required some random stuffing around with the value of the revision field to correspond with the ACL that NT produces when setting the same permission on the printer. Fixed dodgy function call in printing/printfsp.c (This used to be commit 2abce4dcfa351051df6e5f789b34fa99c9b81c22) --- source3/printing/printfsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 09c6140884..a1303eb441 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -41,7 +41,7 @@ files_struct *print_fsp_open(connection_struct *conn,char *jobname) if(!fsp) return NULL; - jobid = print_job_start(SNUM(conn), conn->vuid, jobname); + jobid = print_job_start(¤t_user, SNUM(conn), jobname); if (jobid == -1) { file_free(fsp); return NULL; -- cgit From 636f146abf0a75cd3b21a57b50627ee149a635ab Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Oct 2000 03:21:49 +0000 Subject: Restructuring of vfs layer to include a "this" pointer - can be an fsp or a conn struct depending on the call. We need this to have a clean NT ACL call interface. This will break any existing VFS libraries (that's why this is pre-release code). Andrew gets credit for this one :-) :-). In addition - added Herb's WITH_PROFILE changes - Herb - please examine the changes I've made to the smbd/reply.c code you added. The original code was very ugly and I have replaced it with a START_PROFILE(x)/END_PROFILE(x) pair using the preprocessor. Please check this compiles ok with the --with-profile switch. Jeremy. (This used to be commit b07611f8159b0b3f42e7e02611be9f4d56de96f5) --- source3/printing/printfsp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index a1303eb441..9b5a4877ee 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -50,10 +50,6 @@ files_struct *print_fsp_open(connection_struct *conn,char *jobname) /* setup a full fsp */ fsp->print_jobid = jobid; fsp->fd = print_job_fd(jobid); - conn->vfs_ops.fstat(fsp->fd, &sbuf); - fsp->mode = sbuf.st_mode; - fsp->inode = sbuf.st_ino; - fsp->dev = sbuf.st_dev; GetTimeOfDay(&fsp->open_time); fsp->vuid = current_user.vuid; fsp->size = 0; @@ -73,6 +69,10 @@ files_struct *print_fsp_open(connection_struct *conn,char *jobname) string_set(&fsp->fsp_name,print_job_fname(jobid)); fsp->wbmpx_ptr = NULL; fsp->wcp = NULL; + conn->vfs_ops.fstat(fsp,fsp->fd, &sbuf); + fsp->mode = sbuf.st_mode; + fsp->inode = sbuf.st_ino; + fsp->dev = sbuf.st_dev; conn->num_files_open++; -- cgit From 2506c61ab3bd667d54c5e004cc80ce5e40643b5d Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Mon, 29 Jan 2001 21:34:08 +0000 Subject: Changes from APPLIANCE_HEAD: source/include/proto.h - make proto source/printing/nt_printing.c source/rpc_server/srv_spoolss_nt.c - Fix for the overwriting of printerdata entries when WinNT and Win2k are modifying printer parameters on PCL printers. Turns out that Win2k creates a printer with a NULL devmode entry and then expects to set it on *OPEN* (yes this is insane). So we cannot return a "default" devmode for a printer - and we must allow an open to set it. source/tdb/tdb.c - Show freelist in an easier format. Show total free. - When storing a new record, allocate memory for the key + data before the tdb_allocate() as if the malloc fails a (sparse) hole is left in the tdb. source/tdb/tdbtool.c - Show freelist in an easier format. Show total free. source/tdb/Makefile - cleaned up Makefile dependancies source/smbd/lanman.c - Fix for Win9x corrupting it's own parameter string. source/printing/printfsp.c source/printing/printing.c source/rpc_server/srv_spoolss_nt.c source/smbd/close.c - Added normal close parameter into print_fsp_end() which treats an abnormal close as error condition and deletes the spool file. (This used to be commit 025f7a092ad258ff774e3f5e53737f8210cc8af6) --- source3/printing/printfsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 9b5a4877ee..f6ab69fd93 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -82,9 +82,9 @@ files_struct *print_fsp_open(connection_struct *conn,char *jobname) /**************************************************************************** print a file - called on closing the file ****************************************************************************/ -void print_fsp_end(files_struct *fsp) +void print_fsp_end(files_struct *fsp, BOOL normal_close) { - print_job_end(fsp->print_jobid); + print_job_end(fsp->print_jobid, normal_close); if (fsp->fsp_name) { string_free(&fsp->fsp_name); -- cgit From 201753ddc623a18f4ddd0d9a19391ea0471d4c49 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 22 Feb 2001 01:31:55 +0000 Subject: Fixed file descriptor leak in error processing of print jobs. NT sends "delete on close" to cancel a print job copied from the command line. Deal with this. Merged JohnR's fixes for print job errors. Jeremy. (This used to be commit 2060d74e48d62c99a1689ee02ac435b71918ddf0) --- source3/printing/printfsp.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index f6ab69fd93..c87fb9754f 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -84,6 +84,14 @@ print a file - called on closing the file ****************************************************************************/ void print_fsp_end(files_struct *fsp, BOOL normal_close) { + if (fsp->share_mode == FILE_DELETE_ON_CLOSE) { + /* + * Truncate the job. print_job_end will take + * care of deleting it for us. JRA. + */ + sys_ftruncate(fsp->fd, 0); + } + print_job_end(fsp->print_jobid, normal_close); if (fsp->fsp_name) { -- cgit From da3053048c3d224a20d6383ac6682d31059cd46c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 11 Mar 2001 00:32:10 +0000 Subject: Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy. (This used to be commit 0be41d5158ea4e645e93e8cd30617c038416e549) --- source3/printing/printfsp.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index c87fb9754f..efb97be919 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -1,5 +1,3 @@ -#define OLD_NTDOMAIN 1 - /* Unix SMB/Netbios implementation. Version 3.0 @@ -98,5 +96,3 @@ void print_fsp_end(files_struct *fsp, BOOL normal_close) string_free(&fsp->fsp_name); } } - -#undef OLD_NTDOMAIN -- cgit From 53850c51caf1c4d53ff285b2e5505e0615beeeee Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 14 Apr 2001 00:19:12 +0000 Subject: configure: configure.in: include/config.h.in: include/profile.h: smbd/vfs-wrap.c: smbd/vfs.c: Added fchmod and fchown to VFS (sorry Gerald - but we needed them anyway). smbd/dosmode.c: smbd/files.c: printing/printfsp.c: smbd/close.c: smbd/open.c: Fixed "dos filemode" correctly so there are no race conditions. Forces test of open of file O_WRONLY before allowing fchmod as root. Afterwards, calls standard close function that preserves POSIX locks due to POSIX-me-harder braindamage. :-). Andrew please review this code. Also - in removing the tmpdir param in smbrun an extra NULL parameter was missed in each print_run_command() call (which is a varargs fn.). Now fixed. Jeremy. (This used to be commit 32397e5bc6d995ce7ca37c82d6aedc1e5b1b6fbd) --- source3/printing/printfsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index efb97be919..6a8e4bea45 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -34,7 +34,7 @@ files_struct *print_fsp_open(connection_struct *conn,char *jobname) int jobid; SMB_STRUCT_STAT sbuf; extern struct current_user current_user; - files_struct *fsp = file_new(); + files_struct *fsp = file_new(conn); if(!fsp) return NULL; -- cgit From 6f78636a56106c510545dc1c8218b3a90a486c67 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 18 Apr 2001 05:12:46 +0000 Subject: Removed mktemp from HEAD - same as done in 2.2. Jeremy. (This used to be commit 121b59669fbcd1aaedb08011ff36169fc6561c55) --- source3/printing/printfsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 6a8e4bea45..6545dc59c2 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -29,7 +29,7 @@ open a print file and setup a fsp for it. This is a wrapper around print_job_start(). ***************************************************************************/ -files_struct *print_fsp_open(connection_struct *conn,char *jobname) +files_struct *print_fsp_open(connection_struct *conn) { int jobid; SMB_STRUCT_STAT sbuf; @@ -39,7 +39,7 @@ files_struct *print_fsp_open(connection_struct *conn,char *jobname) if(!fsp) return NULL; - jobid = print_job_start(¤t_user, SNUM(conn), jobname); + jobid = print_job_start(¤t_user, SNUM(conn), "smb.prn"); if (jobid == -1) { file_free(fsp); return NULL; -- cgit From e8e98c9ea0690e3acf1126b50882e59e1056c7b3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 Aug 2001 08:19:43 +0000 Subject: converted smbd to use NTSTATUS by default major changes include: - added NSTATUS type - added automatic mapping between dos and nt error codes - changed all ERROR() calls to ERROR_DOS() and many to ERROR_NT() these calls auto-translate to the client error code system - got rid of the cached error code and the writebmpx code We eventually will need to also: - get rid of BOOL, so we don't lose error info - replace all ERROR_DOS() calls with ERROR_NT() calls but that is too much for one night (This used to be commit 83d9896c1ea8be796192b51a4678c2a3b87f7518) --- source3/printing/printfsp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 6545dc59c2..2ec8de6835 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -65,7 +65,6 @@ files_struct *print_fsp_open(connection_struct *conn) fsp->directory_delete_on_close = False; fsp->conn = conn; string_set(&fsp->fsp_name,print_job_fname(jobid)); - fsp->wbmpx_ptr = NULL; fsp->wcp = NULL; conn->vfs_ops.fstat(fsp,fsp->fd, &sbuf); fsp->mode = sbuf.st_mode; -- cgit From dc1fc3ee8ec2199bc73bb5d7ec711c6800f61d65 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 2 Oct 2001 04:29:50 +0000 Subject: Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. (This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e) --- source3/printing/printfsp.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 2ec8de6835..35700bc868 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -21,8 +21,6 @@ */ #include "includes.h" -extern int DEBUGLEVEL; - /*************************************************************************** open a print file and setup a fsp for it. This is a wrapper around -- cgit From 02eda2e251e6dcb6e0db5cd9c3cbcfa765f3d630 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 17 Nov 2001 03:19:17 +0000 Subject: Tidyups when I was doing the big merge... Jeremy. (This used to be commit 9148bb9eaa67de60c3b0b4709a9c05a840c20c66) --- source3/printing/printfsp.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 35700bc868..322deadf0f 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -63,6 +63,7 @@ files_struct *print_fsp_open(connection_struct *conn) fsp->directory_delete_on_close = False; fsp->conn = conn; string_set(&fsp->fsp_name,print_job_fname(jobid)); + fsp->wbmpx_ptr = NULL; fsp->wcp = NULL; conn->vfs_ops.fstat(fsp,fsp->fd, &sbuf); fsp->mode = sbuf.st_mode; -- cgit From 9d8ed7220fed8a3b7ff9d45b9c5902c3255956ac Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 25 Jan 2002 20:16:14 +0000 Subject: Fixed display of "remote downlevel document" in old print job submission case. Jeremy. (This used to be commit 248770d73072e36fd9812ec5986dce5380dfab33) --- source3/printing/printfsp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 322deadf0f..ea50f43d2e 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -27,17 +27,27 @@ open a print file and setup a fsp for it. This is a wrapper around print_job_start(). ***************************************************************************/ -files_struct *print_fsp_open(connection_struct *conn) +files_struct *print_fsp_open(connection_struct *conn, char *fname) { int jobid; SMB_STRUCT_STAT sbuf; extern struct current_user current_user; files_struct *fsp = file_new(conn); + fstring name; if(!fsp) return NULL; - jobid = print_job_start(¤t_user, SNUM(conn), "smb.prn"); + fstrcpy( name, "Remote Downlevel Document"); + if (fname) { + char *p = strrchr(fname, '/'); + fstrcat(name, " "); + if (!p) + p = fname; + fstrcat(name, p); + } + + jobid = print_job_start(¤t_user, SNUM(conn), name); if (jobid == -1) { file_free(fsp); return NULL; -- cgit From cd68afe31256ad60748b34f7318a180cfc2127cc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Jan 2002 06:08:46 +0000 Subject: Removed version number from file header. Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa) --- source3/printing/printfsp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index ea50f43d2e..2560e1c2fe 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -1,6 +1,5 @@ /* - Unix SMB/Netbios implementation. - Version 3.0 + Unix SMB/CIFS implementation. printing backend routines for smbd - using files_struct rather than only snum Copyright (C) Andrew Tridgell 1992-2000 -- cgit From b9e91d2a8e41a43d7ebb7d7eed807a7d8de9b329 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 20 Mar 2002 00:46:53 +0000 Subject: Remove the "stat open" code - make it inline. This should fix the bugs with opening and renaming mp3 files, also the word rename problems that people have had for a while. Needs a make clean :-) make. Also added JohnR's printing fix. Jeremy. (This used to be commit 504e5ef0494c54efbd0357e334cb2aa5a9eb9c14) --- source3/printing/printfsp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 2560e1c2fe..9f33d57ad5 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -68,7 +68,6 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) fsp->oplock_type = NO_OPLOCK; fsp->sent_oplock_break = NO_BREAK_SENT; fsp->is_directory = False; - fsp->stat_open = False; fsp->directory_delete_on_close = False; fsp->conn = conn; string_set(&fsp->fsp_name,print_job_fname(jobid)); -- cgit From b2edf254eda92f775e7d3d9b6793b4d77f9000b6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 17 Aug 2002 17:00:51 +0000 Subject: sync 3.0 branch with head (This used to be commit 3928578b52cfc949be5e0ef444fce1558d75f290) --- source3/printing/printfsp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 9f33d57ad5..ff50ac47c4 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -54,7 +54,7 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) /* setup a full fsp */ fsp->print_jobid = jobid; - fsp->fd = print_job_fd(jobid); + fsp->fd = print_job_fd(SNUM(conn),jobid); GetTimeOfDay(&fsp->open_time); fsp->vuid = current_user.vuid; fsp->size = 0; @@ -70,7 +70,7 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) fsp->is_directory = False; fsp->directory_delete_on_close = False; fsp->conn = conn; - string_set(&fsp->fsp_name,print_job_fname(jobid)); + string_set(&fsp->fsp_name,print_job_fname(SNUM(conn),jobid)); fsp->wbmpx_ptr = NULL; fsp->wcp = NULL; conn->vfs_ops.fstat(fsp,fsp->fd, &sbuf); @@ -96,7 +96,7 @@ void print_fsp_end(files_struct *fsp, BOOL normal_close) sys_ftruncate(fsp->fd, 0); } - print_job_end(fsp->print_jobid, normal_close); + print_job_end(SNUM(fsp->conn),fsp->print_jobid, normal_close); if (fsp->fsp_name) { string_free(&fsp->fsp_name); -- cgit From a834a73e341059be154426390304a42e4a011f72 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 25 Sep 2002 15:19:00 +0000 Subject: sync'ing up for 3.0alpha20 release (This used to be commit 65e7b5273bb58802bf0c389b77f7fcae0a1f6139) --- source3/printing/printfsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index ff50ac47c4..8a4e7ea073 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -46,7 +46,7 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) fstrcat(name, p); } - jobid = print_job_start(¤t_user, SNUM(conn), name); + jobid = print_job_start(¤t_user, SNUM(conn), name, NULL); if (jobid == -1) { file_free(fsp); return NULL; -- cgit From 00a20ce45f11e62470e60a8d5fcacc6b0b1f90a2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 Dec 2002 04:00:16 +0000 Subject: The element in fsp->print_job should be a RAP jobid, not a uint32 RPC jobid. This was causing Win9x client "set name" calls to fail. Still need one cleanup fix to finish. Jeremy. (This used to be commit 6c23d2030ab8dddff4c849903c529f0012b94027) --- source3/printing/printfsp.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 8a4e7ea073..4ae74e27ec 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -52,8 +52,15 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) return NULL; } + /* Convert to RAP id. */ + fsp->rap_print_jobid = pjobid_to_rap(SNUM(conn), jobid); + if (fsp->rap_print_jobid == 0) { + /* We need to delete the entry in the tdb here ! FIXME ! JRA */ + file_free(fsp); + return NULL; + } + /* setup a full fsp */ - fsp->print_jobid = jobid; fsp->fd = print_job_fd(SNUM(conn),jobid); GetTimeOfDay(&fsp->open_time); fsp->vuid = current_user.vuid; @@ -88,6 +95,9 @@ print a file - called on closing the file ****************************************************************************/ void print_fsp_end(files_struct *fsp, BOOL normal_close) { + uint32 jobid; + int snum; + if (fsp->share_mode == FILE_DELETE_ON_CLOSE) { /* * Truncate the job. print_job_end will take @@ -96,9 +106,15 @@ void print_fsp_end(files_struct *fsp, BOOL normal_close) sys_ftruncate(fsp->fd, 0); } - print_job_end(SNUM(fsp->conn),fsp->print_jobid, normal_close); - if (fsp->fsp_name) { string_free(&fsp->fsp_name); } + + if (!rap_to_pjobid(fsp->rap_print_jobid, &snum, &jobid)) { + DEBUG(3,("print_fsp_end: Unable to convert RAP jobid %u to print jobid.\n", + (unsigned int)fsp->rap_print_jobid )); + return; + } + + print_job_end(SNUM(fsp->conn),jobid, normal_close); } -- cgit From 3999a905e93a0070132888804cafa114bc7d613d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 Dec 2002 22:32:15 +0000 Subject: Fix debugs for rap mapping. Delete job on map fail. Jeremy. (This used to be commit 6eb27e4f0dea6027ba9e041348f066c947e751c6) --- source3/printing/printfsp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 4ae74e27ec..f028e1f564 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -55,7 +55,8 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) /* Convert to RAP id. */ fsp->rap_print_jobid = pjobid_to_rap(SNUM(conn), jobid); if (fsp->rap_print_jobid == 0) { - /* We need to delete the entry in the tdb here ! FIXME ! JRA */ + /* We need to delete the entry in the tdb. */ + pjob_delete(SNUM(conn), jobid); file_free(fsp); return NULL; } -- cgit From ce85e52eff9d8a61a58c559bdf4beb5e1284060d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 4 Feb 2003 01:43:10 +0000 Subject: Ensure we only ever set fsp->conn in one place. Jeremy. (This used to be commit d8a42753cc1e1a94aa6b816222343e1569521f14) --- source3/printing/printfsp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index f028e1f564..45d937f29c 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -77,7 +77,6 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) fsp->sent_oplock_break = NO_BREAK_SENT; fsp->is_directory = False; fsp->directory_delete_on_close = False; - fsp->conn = conn; string_set(&fsp->fsp_name,print_job_fname(SNUM(conn),jobid)); fsp->wbmpx_ptr = NULL; fsp->wcp = NULL; -- cgit From e7c8c15888454043c73967635deb4d3419a489e9 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Sun, 11 May 2003 23:34:18 +0000 Subject: Fix VFS layer: 1. Finally work with cascaded modules with private data storage per module 2. Convert VFS API to macro calls to simplify cascading 3. Add quota support to VFS layer (prepare to NT quota support) Patch by Stefan (metze) Metzemacher, with review of Jelmer and me Tested in past few weeks. Documentation to new VFS API for third-party developers to follow (This used to be commit 91984ef5caa2d13c5d52e1f535bd3bbbae1ec978) --- source3/printing/printfsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 45d937f29c..00a707b34e 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -80,7 +80,7 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) string_set(&fsp->fsp_name,print_job_fname(SNUM(conn),jobid)); fsp->wbmpx_ptr = NULL; fsp->wcp = NULL; - conn->vfs_ops.fstat(fsp,fsp->fd, &sbuf); + VFS_FSTAT(fsp,fsp->fd, &sbuf); fsp->mode = sbuf.st_mode; fsp->inode = sbuf.st_ino; fsp->dev = sbuf.st_dev; -- cgit From bc2a3748e9caa8f60f7c2387e7eecd7fb3fae899 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Wed, 14 May 2003 10:59:01 +0000 Subject: Prefix VFS API macros with SMB_ for consistency and to avoid problems with VFS_ macros at system side. We currently have one clash with AIX and its VFS_LOCK. Compiled and tested -- no new functionality or code, just plain rename of macros for yet-unreleased VFS API version. Needs to be done before a24 is out (This used to be commit c2689ed118b490e49497a76ed6a2251262018769) --- source3/printing/printfsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 00a707b34e..0b6d4fdbe1 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -80,7 +80,7 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) string_set(&fsp->fsp_name,print_job_fname(SNUM(conn),jobid)); fsp->wbmpx_ptr = NULL; fsp->wcp = NULL; - VFS_FSTAT(fsp,fsp->fd, &sbuf); + SMB_VFS_FSTAT(fsp,fsp->fd, &sbuf); fsp->mode = sbuf.st_mode; fsp->inode = sbuf.st_ino; fsp->dev = sbuf.st_dev; -- cgit From 293136c04b7eb5293ef18273e13fca00c85bb5f0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 19 Oct 2004 17:05:01 +0000 Subject: r3067: patch based on volker's initial work in trunk that fixes the queu update problem when using the background daemon (This used to be commit de7af09e727e744aa27af85ef7c0f73ed5c1550a) --- source3/printing/printfsp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 0b6d4fdbe1..7c5de46870 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -53,16 +53,16 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) } /* Convert to RAP id. */ - fsp->rap_print_jobid = pjobid_to_rap(SNUM(conn), jobid); + fsp->rap_print_jobid = pjobid_to_rap(lp_const_servicename(SNUM(conn)), jobid); if (fsp->rap_print_jobid == 0) { /* We need to delete the entry in the tdb. */ - pjob_delete(SNUM(conn), jobid); + pjob_delete(lp_const_servicename(SNUM(conn)), jobid); file_free(fsp); return NULL; } /* setup a full fsp */ - fsp->fd = print_job_fd(SNUM(conn),jobid); + fsp->fd = print_job_fd(lp_const_servicename(SNUM(conn)),jobid); GetTimeOfDay(&fsp->open_time); fsp->vuid = current_user.vuid; fsp->size = 0; @@ -77,7 +77,7 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) fsp->sent_oplock_break = NO_BREAK_SENT; fsp->is_directory = False; fsp->directory_delete_on_close = False; - string_set(&fsp->fsp_name,print_job_fname(SNUM(conn),jobid)); + string_set(&fsp->fsp_name,print_job_fname(lp_const_servicename(SNUM(conn)),jobid)); fsp->wbmpx_ptr = NULL; fsp->wcp = NULL; SMB_VFS_FSTAT(fsp,fsp->fd, &sbuf); @@ -96,7 +96,7 @@ print a file - called on closing the file void print_fsp_end(files_struct *fsp, BOOL normal_close) { uint32 jobid; - int snum; + fstring sharename; if (fsp->share_mode == FILE_DELETE_ON_CLOSE) { /* @@ -110,7 +110,7 @@ void print_fsp_end(files_struct *fsp, BOOL normal_close) string_free(&fsp->fsp_name); } - if (!rap_to_pjobid(fsp->rap_print_jobid, &snum, &jobid)) { + if (!rap_to_pjobid(fsp->rap_print_jobid, sharename, &jobid)) { DEBUG(3,("print_fsp_end: Unable to convert RAP jobid %u to print jobid.\n", (unsigned int)fsp->rap_print_jobid )); return; -- cgit From 978ca8486031e43754a3c23757f361bf3a85f335 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Wed, 6 Apr 2005 16:28:04 +0000 Subject: r6225: get rid of warnings from my compiler about nested externs (This used to be commit efea76ac71412f8622cd233912309e91b9ea52da) --- source3/printing/printfsp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 7c5de46870..25f4d9bd46 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -21,6 +21,8 @@ #include "includes.h" +extern struct current_user current_user; + /*************************************************************************** open a print file and setup a fsp for it. This is a wrapper around print_job_start(). @@ -30,7 +32,6 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) { int jobid; SMB_STRUCT_STAT sbuf; - extern struct current_user current_user; files_struct *fsp = file_new(conn); fstring name; -- cgit From 08355754151b2d02b2102bc76e94b63ffffdf408 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 8 May 2005 23:16:28 +0000 Subject: r6673: Fix the write cache based on some VERY good detective work from Ingo Kilian . You must do a make clean after updating this. Jeremy. (This used to be commit 3b2cd19fcb8ce38578b122fd6ae722b73081dcda) --- source3/printing/printfsp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 25f4d9bd46..863de9624e 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -66,7 +66,6 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) fsp->fd = print_job_fd(lp_const_servicename(SNUM(conn)),jobid); GetTimeOfDay(&fsp->open_time); fsp->vuid = current_user.vuid; - fsp->size = 0; fsp->pos = -1; fsp->can_lock = True; fsp->can_read = False; -- cgit From af8a691db11a5072865f8b03fd1cbd3aab5cb6d7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 Jul 2005 04:51:27 +0000 Subject: r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy. (This used to be commit c7fe18761e2c753afbffd3a78abff46472a9b8eb) --- source3/printing/printfsp.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 863de9624e..eb81dc4536 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -28,7 +28,7 @@ open a print file and setup a fsp for it. This is a wrapper around print_job_start(). ***************************************************************************/ -files_struct *print_fsp_open(connection_struct *conn, char *fname) +files_struct *print_fsp_open(connection_struct *conn, const char *fname) { int jobid; SMB_STRUCT_STAT sbuf; @@ -40,10 +40,11 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) fstrcpy( name, "Remote Downlevel Document"); if (fname) { - char *p = strrchr(fname, '/'); + const char *p = strrchr(fname, '/'); fstrcat(name, " "); - if (!p) + if (!p) { p = fname; + } fstrcat(name, p); } @@ -63,24 +64,23 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) } /* setup a full fsp */ - fsp->fd = print_job_fd(lp_const_servicename(SNUM(conn)),jobid); + fsp->fh->fd = print_job_fd(lp_const_servicename(SNUM(conn)),jobid); GetTimeOfDay(&fsp->open_time); fsp->vuid = current_user.vuid; - fsp->pos = -1; + fsp->fh->pos = -1; fsp->can_lock = True; fsp->can_read = False; + fsp->access_mask = FILE_GENERIC_WRITE; fsp->can_write = True; - fsp->share_mode = 0; fsp->print_file = True; fsp->modified = False; fsp->oplock_type = NO_OPLOCK; fsp->sent_oplock_break = NO_BREAK_SENT; fsp->is_directory = False; - fsp->directory_delete_on_close = False; string_set(&fsp->fsp_name,print_job_fname(lp_const_servicename(SNUM(conn)),jobid)); fsp->wbmpx_ptr = NULL; fsp->wcp = NULL; - SMB_VFS_FSTAT(fsp,fsp->fd, &sbuf); + SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf); fsp->mode = sbuf.st_mode; fsp->inode = sbuf.st_ino; fsp->dev = sbuf.st_dev; @@ -91,19 +91,20 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname) } /**************************************************************************** -print a file - called on closing the file + Print a file - called on closing the file. ****************************************************************************/ + void print_fsp_end(files_struct *fsp, BOOL normal_close) { uint32 jobid; fstring sharename; - if (fsp->share_mode == FILE_DELETE_ON_CLOSE) { + if (fsp->fh->private_options & FILE_DELETE_ON_CLOSE) { /* * Truncate the job. print_job_end will take * care of deleting it for us. JRA. */ - sys_ftruncate(fsp->fd, 0); + sys_ftruncate(fsp->fh->fd, 0); } if (fsp->fsp_name) { -- cgit From d14af63e6ab600eb3ac705f2f425c860e927553a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 2 Feb 2006 20:44:50 +0000 Subject: r13293: Rather a big patch I'm afraid, but this should fix bug #3347 by saving the UNIX token used to set a delete on close flag, and using it when doing the delete. libsmbsharemodes.so still needs updating to cope with this change. Samba4 torture tests to follow. Jeremy. (This used to be commit 23f16cbc2e8cde97c486831e26bcafd4ab4a9654) --- source3/printing/printfsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index eb81dc4536..c248851822 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -94,7 +94,7 @@ files_struct *print_fsp_open(connection_struct *conn, const char *fname) Print a file - called on closing the file. ****************************************************************************/ -void print_fsp_end(files_struct *fsp, BOOL normal_close) +void print_fsp_end(files_struct *fsp, enum file_close_type close_type) { uint32 jobid; fstring sharename; @@ -117,5 +117,5 @@ void print_fsp_end(files_struct *fsp, BOOL normal_close) return; } - print_job_end(SNUM(fsp->conn),jobid, normal_close); + print_job_end(SNUM(fsp->conn),jobid, close_type); } -- cgit From fbdcf2663b56007a438ac4f0d8d82436b1bfe688 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:01:26 +0000 Subject: r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8) --- source3/printing/printfsp.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index c248851822..5278c60f99 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -28,15 +28,19 @@ open a print file and setup a fsp for it. This is a wrapper around print_job_start(). ***************************************************************************/ -files_struct *print_fsp_open(connection_struct *conn, const char *fname) +NTSTATUS print_fsp_open(connection_struct *conn, const char *fname, + files_struct **result) { int jobid; SMB_STRUCT_STAT sbuf; - files_struct *fsp = file_new(conn); + files_struct *fsp; fstring name; + NTSTATUS status; - if(!fsp) - return NULL; + status = file_new(conn, &fsp); + if(!NT_STATUS_IS_OK(status)) { + return status; + } fstrcpy( name, "Remote Downlevel Document"); if (fname) { @@ -50,8 +54,9 @@ files_struct *print_fsp_open(connection_struct *conn, const char *fname) jobid = print_job_start(¤t_user, SNUM(conn), name, NULL); if (jobid == -1) { + status = map_nt_error_from_unix(errno); file_free(fsp); - return NULL; + return status; } /* Convert to RAP id. */ @@ -60,7 +65,7 @@ files_struct *print_fsp_open(connection_struct *conn, const char *fname) /* We need to delete the entry in the tdb. */ pjob_delete(lp_const_servicename(SNUM(conn)), jobid); file_free(fsp); - return NULL; + return NT_STATUS_ACCESS_DENIED; /* No errno around here */ } /* setup a full fsp */ @@ -87,7 +92,8 @@ files_struct *print_fsp_open(connection_struct *conn, const char *fname) conn->num_files_open++; - return fsp; + *result = fsp; + return NT_STATUS_OK; } /**************************************************************************** -- cgit From e8156439f24137b5418baad20a7f00f6949cfe29 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 29 May 2007 09:30:34 +0000 Subject: r23183: Check in a change made by Tridge: This replaces the internal explicit dev/ino file id representation by a "struct file_id". This is necessary as cluster file systems and NFS don't necessarily assign the same device number to the shared file system. With this structure in place we can now easily add different schemes to map a file to a unique 64-bit device node. Jeremy, you might note that I did not change the external interface of smb_share_modes.c. Volker (This used to be commit 9b10dbbd5de8813fc15ebbb6be9b18010ffe8139) --- source3/printing/printfsp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 5278c60f99..062a72080d 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -87,8 +87,7 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname, fsp->wcp = NULL; SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf); fsp->mode = sbuf.st_mode; - fsp->inode = sbuf.st_ino; - fsp->dev = sbuf.st_dev; + fsp->file_id = file_id_sbuf(&sbuf); conn->num_files_open++; -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/printing/printfsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 062a72080d..9d34a37124 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/printing/printfsp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 9d34a37124..821f46041d 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 4b15f31f106f1dd69fdda721b5c3b787f5245a80 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 2 Aug 2007 08:53:24 +0000 Subject: r24120: add a file_id_create() hook into the VFS layer it's needed for some cluster filesystems to overload this function. metze (This used to be commit cdaa24e8047399002e4b287a31a8340a665e580f) --- source3/printing/printfsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 821f46041d..ab628e29fc 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -86,7 +86,7 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname, fsp->wcp = NULL; SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf); fsp->mode = sbuf.st_mode; - fsp->file_id = file_id_sbuf(&sbuf); + fsp->file_id = vfs_file_id_from_sbuf(conn, &sbuf); conn->num_files_open++; -- cgit From 3dd3c4cd013dadd1a1f57ac3e0750018dc5a0698 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 15 Aug 2007 16:58:29 +0000 Subject: r24464: Now Volker removed the readbmpx we don't need cached errors any more. Jeremy. (This used to be commit 9256ec0a20f532c7dd7ddc2d3534336a47e6c2d2) --- source3/printing/printfsp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index ab628e29fc..337fd4f74b 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -82,7 +82,6 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname, fsp->sent_oplock_break = NO_BREAK_SENT; fsp->is_directory = False; string_set(&fsp->fsp_name,print_job_fname(lp_const_servicename(SNUM(conn)),jobid)); - fsp->wbmpx_ptr = NULL; fsp->wcp = NULL; SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf); fsp->mode = sbuf.st_mode; -- cgit From 87a684f7fcfa8d9fabc42e33981299d0b33eeeb7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 13:21:26 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FSTAT(). Michael (This used to be commit 0b86c420be94d295f6917a220b5d699f65b46711) --- source3/printing/printfsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 337fd4f74b..1fde16b802 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -83,7 +83,7 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname, fsp->is_directory = False; string_set(&fsp->fsp_name,print_job_fname(lp_const_servicename(SNUM(conn)),jobid)); fsp->wcp = NULL; - SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf); + SMB_VFS_FSTAT(fsp, &sbuf); fsp->mode = sbuf.st_mode; fsp->file_id = vfs_file_id_from_sbuf(conn, &sbuf); -- cgit From a3c0be63256b7db6325d8dcb599497e8e7905f08 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 24 Jun 2008 16:03:28 +0200 Subject: Change print_access_check to take auth_serversupplied_info instead of current_user Reason: This is the main user of p->current_user which I would like to remove (This used to be commit fd43059b3dfa8cdac9814de1c76f963ba5de9bcb) --- source3/printing/printfsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 1fde16b802..4a2b26d2cd 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -51,7 +51,7 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname, fstrcat(name, p); } - jobid = print_job_start(¤t_user, SNUM(conn), name, NULL); + jobid = print_job_start(conn->server_info, SNUM(conn), name, NULL); if (jobid == -1) { status = map_nt_error_from_unix(errno); file_free(fsp); -- cgit From c885ae01ebbf2b2f5c75799c4e8b1b0c68b2d34e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 24 Jun 2008 16:58:29 +0200 Subject: Remove current_user reference from printfsp.c (This used to be commit 510f45d01a19ce1c226755ac42a328241098b2e0) --- source3/printing/printfsp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index 4a2b26d2cd..c6749226fd 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -20,15 +20,13 @@ #include "includes.h" -extern struct current_user current_user; - /*************************************************************************** open a print file and setup a fsp for it. This is a wrapper around print_job_start(). ***************************************************************************/ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname, - files_struct **result) + uint16_t current_vuid, files_struct **result) { int jobid; SMB_STRUCT_STAT sbuf; @@ -70,7 +68,7 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname, /* setup a full fsp */ fsp->fh->fd = print_job_fd(lp_const_servicename(SNUM(conn)),jobid); GetTimeOfDay(&fsp->open_time); - fsp->vuid = current_user.vuid; + fsp->vuid = current_vuid; fsp->fh->pos = -1; fsp->can_lock = True; fsp->can_read = False; -- cgit