summaryrefslogtreecommitdiff
path: root/source3/printing
AgeCommit message (Collapse)AuthorFilesLines
2010-03-10Try and fix bug #7233 - print fails with jobs >4GB from Win7 clients.Jeremy Allison1-1/+1
Remove an arbitrarty 4G B limit that *doesn't need to be there* ! Jeremy.
2010-03-10s3: Fix a long-standing problem with recycled PIDsVolker Lendecke2-3/+5
When a samba server process dies hard, it has no chance to clean up its entries in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb. For locking.tdb and brlock.tdb Samba is robust by checking every time we read an entry from the database if the corresponding process still exists. If it does not exist anymore, the entry is deleted. This is not 100% failsafe though: On systems with a limited PID space there is a non-zero chance that between the smbd's death and the fresh access, the PID is recycled by another long-running process. This renders all files that had been locked by the killed smbd potentially unusable until the new process also dies. This patch is supposed to fix the problem the following way: Every process ID in every database is augmented by a random 64-bit number that is stored in a serverid.tdb. Whenever we need to check if a process still exists we know its PID and the 64-bit number. We look up the PID in serverid.tdb and compare the 64-bit number. If it's the same, the process still is a valid smbd holding the lock. If it is different, a new smbd has taken over. I believe this is safe against an smbd that has died hard and the PID has been taken over by a non-samba process. This process would not have registered itself with a fresh 64-bit number in serverid.tdb, so the old one still exists in serverid.tdb. We protect against this case by the parent smbd taking care of deregistering PIDs from serverid.tdb and the fact that serverid.tdb is CLEAR_IF_FIRST. CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not work when all smbds are restarted. For this, "net serverid wipe" has to be run before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up sessionid.tdb and connections.tdb. While there, this also cleans up overloading connections.tdb with all the process entries just for messaging_send_all(). Volker
2010-03-05Fix for bug #7189 - Open txt files with notepad on samba shares creates problem.Jeremy Allison2-1/+4
Ensure we don't use any of the create_options for Samba private use. Add a new parameter to the VFS_CREATE call (private_flags) which is only used internally. Renumber NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and NTCREATEX_OPTIONS_PRIVATE_DENY_FCB to match the S4 code). Rev. the VFS interface to version 28. Jeremy.
2010-02-23s3-print: Remove obsolete signal type cast.Andreas Schneider1-3/+3
2010-02-14s3: convert registry and printing code to TYPESAFE_QSORT()Andrew Tridgell1-3/+2
2010-02-12Use sec_initial_uid() in the places where being root doesn't matter,Jeremy Allison1-1/+1
and 0 in the places where it does. Jeremy
2010-01-10s3: Replace most calls to sid_append_rid() by sid_compose()Volker Lendecke1-2/+2
2009-12-08s3-spoolss: use driver level info8 everywhere in spoolss server internally.Günther Deschner1-99/+196
Guenther
2009-12-07s3-spoolss: a default printer should have at least a "PrintDriverData" key.Günther Deschner1-0/+7
Guenther
2009-11-29s3: "print_job_end" only looks at the sizeVolker Lendecke1-2/+1
2009-11-29s3: Pass the "fake dir create times" parameter to sys_*statVolker Lendecke1-1/+2
Step 0 to restore it as a per-share paramter
2009-11-25Fix warnings with talloc_asprintf.Jeremy Allison1-3/+3
Jeremy.
2009-11-23s3-printing: remove duplicate code while cleaning up driver structs.Günther Deschner1-68/+39
Guenther
2009-11-23s3-printing: use spoolss types and structs while getting and deleting drivers.Günther Deschner1-166/+157
Guenther
2009-11-23s3-printing: use spoolss types and structs while adding drivers.Günther Deschner1-275/+167
Guenther
2009-11-17Remove "store create time" code, cause create time to be storedJeremy Allison1-5/+4
in the "user.DOSATTRIB" EA. From the docs: In Samba 3.5.0 and above the "user.DOSATTRIB" extended attribute has been extended to store the create time for a file as well as the DOS attributes. This is done in a backwards compatible way so files created by Samba 3.5.0 and above can still have the DOS attribute read from this extended attribute by earlier versions of Samba, but they will not be able to read the create time stored there. Storing the create time separately from the normal filesystem meta-data allows Samba to faithfully reproduce NTFS semantics on top of a POSIX filesystem. Passes make test but will need more testing. Jeremy.
2009-10-01s3-registry: use pull_reg_sz() where appropriate.Günther Deschner1-3/+6
(and move away from rpcstr_pull and rpcstr_pull_talloc). Guenther
2009-09-30s3-printing: use regval_ctr_addvalue_multi_sz.Günther Deschner1-17/+4
Guenther
2009-09-30s3-registry: use regval_ctr_addvalue_sz().Günther Deschner1-22/+6
Greatly simplifies and cleanes up the code. Guenther
2009-09-30s3-registry: use push_reg_sz().Günther Deschner1-15/+9
Guenther
2009-08-10s3-spoolss: remove device mode defines from nt_printing.h.Günther Deschner1-12/+17
Guenther
2009-08-07s3:smbd: conn_free_internal() can be static nowStefan Metzmacher1-3/+3
metze
2009-07-24s3: Convert a few callers of unix_convert() over to filename_convert()Tim Prouty1-5/+23
This patch also changes the unix convert flags to make sure the correct semantics are preservered for allowing/disallowing wildcards in the last component of the path.
2009-07-20s3: Finish plumbing the fsp->fsp_name smb_fname conversion through the modules.Tim Prouty1-2/+8
2009-06-26s3-vlp: drastically shrink size and dependencies of the virtual line printer.Günther Deschner1-11/+8
This gets vlp from 13M down to 214K on my box. Guenther
2009-06-24s3-printing: eliminate another non sec_initial_uid using security check.Günther Deschner1-1/+1
Guenther
2009-06-22s3: forward MSG_DEBUG from smbd parent to all childrenAravind Srinivasan1-0/+19
Before 3.3, an smbcontrol debug message sent to the target "smbd" would actually be sent to all running processes including nmbd and winbindd. This behavior was changed in 3.3 so that the "smbd" target would only send a message to the process found in smbd.pid, while the "all" target would send a message to all processes. The ability to set the debug level of all processes within a single daemon, without specifying each pid is quite useful. This was implemented in winbindd in 065760ed. This patch does the same thing for smbd. Upon receiving a MSG_DEBUG the parent smbd will rebroadcast it to all of its children. The printing process has been added to the list of smbd child processes, and we now always track the number of smbd children regardless of the "max smbd processes" setting.
2009-06-19Fix coverity #740. Resource leak in error paths. We shouldJeremy Allison1-3/+2
always return queue here as the caller will free. Jeremy.
2009-06-15Do a correct TALLOC_FREE in an error caseVolker Lendecke1-1/+4
2009-06-12s3: Plumb smb_filename through SMB_VFS_CREATE_FILETim Prouty1-47/+27
2009-06-10s3: Prepare the first set of SMB_VFS_CREATE_FILE callers to take an ↵Tim Prouty1-53/+95
smb_filename struct Some of the callers required minimal changes, while others (copy_internals) required significant changes. The task is simplified a little bit because we are able to do operations and checks on the base_name when a stream isn't used. This patch should cause no functional changes. Volker, Jeremy: Please check
2009-06-10s3: Remove extraneous calls to unix_convertTim Prouty1-6/+0
Not only are these unnecessary in spirit because unlink_internals calls unix_convert, but in practice the return value is simply being ignored right now.
2009-05-27s3: Allow child processes to exit gracefully if we are out of fdsMarc VanHeyningen2-4/+5
When we run out of file descriptors for some reason, every new connection forks a child that immediately panics causing smbd to coredump. This seems unnecessarily harsh; with this code change we now catch that error and merely log a message about it and exit without the core dump. Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke3-4/+4
This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
2009-05-20s3: Change unix_convert (and its callers) to use struct smb_filenameTim Prouty1-1/+16
This is the first of a series of patches that change path based operations to operate on a struct smb_filename instead of a char *. This same concept already exists in source4. My goals for this series of patches are to eventually: 1) Solve the stream vs. posix filename that contains a colon ambiguity that currently exists. 2) Make unix_convert the only function that parses the stream name. 3) Clean up the unix_convert API. 4) Change all path based vfs operation to take a struct smb_filename. 5) Make is_ntfs_stream_name() a constant operation that can simply check the state of struct smb_filename rather than re-parse the filename. 6) Eliminate the need for split_ntfs_stream_name() to exist. My strategy is to start from the inside at unix_convert() and work my way out through the vfs layer, call by call. This first patch does just that, by changing unix_convert and all of its callers to operate on struct smb_filename. Since this is such a large change, I plan on pushing the patches in phases, where each phase keeps full compatibility and passes make test. The API of unix_convert has been simplified from: NTSTATUS unix_convert(TALLOC_CTX *ctx, connection_struct *conn, const char *orig_path, bool allow_wcard_last_component, char **pp_conv_path, char **pp_saved_last_component, SMB_STRUCT_STAT *pst) to: NTSTATUS unix_convert(TALLOC_CTX *ctx, connection_struct *conn, const char *orig_path, struct smb_filename *smb_fname, uint32_t ucf_flags) Currently the smb_filename struct looks like: struct smb_filename { char *base_name; char *stream_name; char *original_lcomp; SMB_STRUCT_STAT st; }; One key point here is the decision to break up the base_name and stream_name. I have introduced a helper function called get_full_smb_filename() that takes an smb_filename struct and allocates the full_name. I changed the callers of unix_convert() to subsequently call get_full_smb_filename() for the time being, but I plan to eventually eliminate get_full_smb_filename().
2009-05-13s3-printing: no need to define struct table_node 4 times.Günther Deschner1-7/+1
Guenther
2009-05-13s3-spoolss: move SPL_ARCH_X defines to IDL.Günther Deschner1-8/+0
Guenther
2009-05-12s3-printing: Fix vlp testprinter application.Günther Deschner1-24/+23
Jeremy, we cannot just access cache_path() here without calling lp_load and friends as well as parsing configfile from the commandline in order to make "make test/selftest" find the correct conffile with path, etc. I just changed it to pass the target tdbfilename as an argument, ok ? Guenther
2009-05-11Hopefully fix the buildfarm. Add some debug level 10 messagesJeremy Allison2-5/+20
I used to track down the vlp problem, change the vlp test printer not to use a static path of /tmp/vlp.tdb for the virtual print database (as this will eventually fill up). Cause it to use a virtual print database inside the cachepath. Jeremy.
2009-05-06s3-printing: simplify print_queue helper functions and return WERROR.Günther Deschner1-17/+10
Guenther
2009-04-30s3-printing: rework move_driver_file_to_download_area() a bit for clarity.Günther Deschner1-32/+40
Guenther
2009-04-30s3-printing: use move_driver_file_to_download_area() to avoid code duplication.Günther Deschner1-144/+54
Guenther
2009-04-30s3-printing: add move_driver_file_to_download_area().Günther Deschner1-0/+40
Guenther
2009-04-27s3:nt_printing: fix a comment typoMichael Adam1-1/+1
Michael
2009-04-27s3:registry: replace typedef REGISTRY_VALUE by struct regval_blobMichael Adam1-4/+4
Michael
2009-04-27s3:registry: replace typedef REGVAL_CTR by struct regval_ctr.Michael Adam1-9/+9
This paves the way for hiding the typedef and the implementation from the surface. Michael
2009-04-20Remove smb_mkstemp() - libreplace will now provide a secure mkstemp() ifJelmer Vernooij1-1/+1
the system one is broken.
2009-04-20s3-printing: use ARRAY_SIZE() macro in forms functions.Günther Deschner1-6/+5
Guenther
2009-04-20s3-printing: use sec_initial_uid() instead "0" in print_access_check().Günther Deschner1-1/+1
Another babystep in order to make us pass RPC-SPOOLSS. Guenther
2009-04-14s3-spoolss: remove unused dup_nt_devicemode().Günther Deschner1-28/+0
Guenther