1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

5894 Commits

Author SHA1 Message Date
Volker Lendecke
51b84a9ed7 s3: Convert init_system_info to NTSTATUS 2011-02-20 10:23:29 +01:00
Volker Lendecke
13bfae95e7 s3: Fix some nonempty blank lines 2011-02-20 10:23:28 +01:00
Andrew Bartlett
09c4a5cd9b s3-cluster Always fill in the clustering vnn element
This avoids this structure being partially uninitialised.

Adnrew Bartlett
2011-02-17 16:02:19 +01:00
David Disseldorp
9c12232f1a s3: increase the log level for missing PIDs on SIGCHLD
Since the fix for bso#7836, the parent smbd is responsible for
maintaining an up-to-date printcap cache. It does this by forking a
child process to asynchronously fetch printcap data from CUPS.

When the child process exits after fetching all printcap data, the
parent smbd is sent SIGCHLD. This triggers smbd_sig_chld_handler() which
looks for the exited process PID on a "children" list.
Child smbd process PIDs are added to the "children" list to ensure
cleanup on unclean shutdown and log level change notification messages.

Printcap update process PIDs are not added to the list as they do not
maintain any state that requires cleanup, nor do they wait on tevent for
messages.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Feb 17 11:11:45 CET 2011 on sn-devel-104
2011-02-17 11:11:45 +01:00
Volker Lendecke
16229e4cef s3: Avoid a select call per smb
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Feb 11 12:13:54 CET 2011 on sn-devel-104
2011-02-11 12:13:54 +01:00
Michael Adam
82bcada6f6 s3:smbd: fix switch indentation level in get_ea_dos_attribute()
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Thu Feb 10 17:46:12 CET 2011 on sn-devel-104
2011-02-10 17:46:12 +01:00
Andrew Bartlett
2b05ba77b4 s3-auth Rename cryptic 'ptok' to security_token
This will allow the auth_serversupplied_info struct to be migrated
to auth_session_info easier.

Adnrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-02-10 06:51:06 +01:00
Jeremy Allison
0122a4f417 Put OpenDir() back the way it was - don't overload with an fsp arg. Create OpenDir_fsp for new usage.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Feb 10 02:43:31 CET 2011 on sn-devel-104
2011-02-10 02:43:31 +01:00
Jeremy Allison
4b0af9be9a Make it clear we're using the open file pathname.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Feb 10 01:06:29 CET 2011 on sn-devel-104
2011-02-10 01:06:29 +01:00
Jeremy Allison
1607ebfe86 Allow SMB2_FIND to actually use the open fd handle if we support fdopendir. Fallback to pathname opendir if not. 2011-02-09 15:13:40 -08:00
Jeremy Allison
4ccb7e5bdd Oops. Need to test for if(!NT_STATUS_IS_OK(..)) for error.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Feb  9 22:06:05 CET 2011 on sn-devel-104
2011-02-09 22:06:05 +01:00
Jeremy Allison
8c363e9252 Move to opening an fd on directory opens. Get more careful about symlink races. 2011-02-09 21:21:04 +01:00
Jeremy Allison
65e6dea73f Remove unneeded stat call. 2011-02-09 21:21:04 +01:00
Jeremy Allison
a674a56a97 Add fdopendir to the VFS. We will use this to reuse a directory fd already open by NtCreateX.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Feb  9 00:55:22 CET 2011 on sn-devel-104
2011-02-09 00:55:22 +01:00
Jeremy Allison
224fc03cb5 Pass fsp to dptr_CloseDir(). Cope with setting the fd if we're closing an fd that opendir knows about. 2011-02-08 15:06:00 -08:00
Jeremy Allison
e68f6adca9 If possible (O_DIRECTORY exists) open an fd for a directory open.
Start of the move towards handle-based code for directory access.
Currently makes fstat/fchown code work for directories rather than
falling back to pathnames.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Feb  8 06:34:41 CET 2011 on sn-devel-104
2011-02-08 06:34:41 +01:00
Jeremy Allison
dd7313a130 Use corrcet function instead of cut-and-paste code.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Feb  8 03:23:40 CET 2011 on sn-devel-104
2011-02-08 03:23:40 +01:00
Jeremy Allison
0a7f1af82c Fix leak in error path. 2011-02-07 17:33:26 -08:00
Volker Lendecke
8af7400d55 s3: Fix some nonempty blank lines 2011-02-06 16:44:56 +01:00
Jeremy Allison
df34e804fc Fix try_chown code. Use new vfs_chown_fsp() which always trys fd first.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb  5 03:33:59 CET 2011 on sn-devel-104
2011-02-05 03:33:58 +01:00
Jeremy Allison
ece94989b8 Move the "oplock file with byte range locks" check to the correct place, where we're making oplock decisions.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb  5 01:18:14 CET 2011 on sn-devel-104
2011-02-05 01:18:14 +01:00
Andreas Schneider
e3bdfd2d46 s3-smbd: Added a function to setup rpc services.
Move the complete setup of the rpc service to its own file and use
callbacks to register at the endpoint mapper.
2011-02-02 12:44:20 +01:00
Andreas Schneider
84995397a7 s3-epmapper: Added a endpoint mapper skeleton. 2011-02-02 12:44:20 +01:00
Jeremy Allison
3d4a9ddc24 Based on a conversation with Volker, refactor some of the oplock code to make it comprehensible.
delay_for_oplocks() did 4 things.

1). Validation of existing oplock types.
2). Check for compatibility with batch oplocks (pass 1).
3). Check for compatibility with exclusive oplocks (pass 2).
4). Set the correct oplock type from the requested value.

Refactor into 4 separate functions:

1). find_oplock_types() - does validation of oplock types and
	returns pointers to specific values.
2). delay_for_batch_oplocks() - the pass 1 phase above.
3). delay_for_exclusive_oplocks() - the pass 2 phase above
4). grant_fsp_oplock_type() - Set the correct oplock type from the requested value.

Now separated out this code should be much easier to understand
and modify. This also fixes an erroneous SMB_ASSERT which was
hidden by the previous complexity of the single delay_for_oplocks()
code.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Feb  2 01:52:21 CET 2011 on sn-devel-104
2011-02-02 01:52:21 +01:00
Günther Deschner
600ff3a74e s3-lanman: prefer dcerpc_samr_X functions.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Feb  1 16:45:10 CET 2011 on sn-devel-104
2011-02-01 16:45:10 +01:00
Pavel Shilovsky
6696fd1c1e Ensure we send the direct levelII oplock break to the correct fid.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Feb  1 00:39:56 CET 2011 on sn-devel-104
2011-02-01 00:39:56 +01:00
Pavel Shilovsky
7690d9d70c Fix bug #7928 - Samba problems with kernel oplocks option set to "no"
We should not grant levelII oplocks on a file with existing
byte range locks.
2011-01-31 12:00:15 -08:00
Stefan Metzmacher
0bbe7334d6 s3:smbd: let smbd_server_connection_loop_once() check for select errors
metze
2011-01-31 16:16:09 +01:00
Stefan Metzmacher
6953e2fa66 Revert "s3: Fix starving the echo responder"
This reverts commit d5cf6482ed.

I'll add a more generic fix for this problem.

metze
2011-01-31 16:16:09 +01:00
Stefan Metzmacher
19d3779274 Revert "s3:events: Call all ready fd event handlers on each iteration of the main loop"
This reverts commit 455fccf86b.

I'll add a more generic fix for this problem.

metze
2011-01-31 16:16:09 +01:00
Jeremy Allison
f2900a8b04 We need to reply to SMB2_GETINFO_FILE with a class of SMB2_FILE_STANDARD_INFO on an IPC$ share.
Otherwise a Win7 client issues this request twice (2xroundtrips)
if we return NOT_SUPPORTED. We do the same for SMB1 in call_trans2qpipeinfo()

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jan 28 22:53:18 CET 2011 on sn-devel-104
2011-01-28 22:53:18 +01:00
Jeremy Allison
eec50b21f6 Change "security=share" to downgrade to SMB1 from SMB2, rather than trying to fake it. 2011-01-27 15:26:47 -08:00
David Disseldorp
eb55338ccd Looking into printer driver issues, I ran across some peculiarities in
copy_file():
- Firstly, if the source file is zero bytes, NT_STATUS_DISK_FULL is
  returned.
- Secondly, the conditional lseek is confusing. It fires when
  OPENX_FILE_EXISTS_OPEN is set and I can't see why the lseek is
  necessary in this case.
- Finally, the lseek error path also results in NT_STATUS_DISK_FULL.

Proposed fix for first and third point below.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Jan 27 00:59:56 CET 2011 on sn-devel-104
2011-01-27 00:59:56 +01:00
Jeremy Allison
67e578ab5a Allow "security = share" with SMB2. We already handle this in smb2/smb2_server.c
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jan 26 20:37:29 CET 2011 on sn-devel-104
2011-01-26 20:37:29 +01:00
Jeremy Allison
44732734cc Fix bug #7863 - Unlink may unlink wrong file when hardlinks are involved.
Do this by keeping a linked list of delete on close tokens, one for
each filename that identifies a path to the dev/inode. Use the
jenkins hash of the pathname to identify the correct token.
2011-01-25 14:23:19 -08:00
Jeremy Allison
a65bce4e38 Add uint32_t name_hash argument (currently unused) to get_file_infos().
Will be used when we store more than one delete on close token.
2011-01-25 14:02:18 -08:00
Jeremy Allison
b97f1ce68a Add name_hash into the share mode entry struct (as yet only use for renames to identify a specific path). 2011-01-25 14:01:52 -08:00
Jeremy Allison
76418e23bc Add name_hash to files_struct. Set within fsp_set_smb_fname(). 2011-01-25 13:49:01 -08:00
Günther Deschner
831f3eec16 s3-lanman: remove trailing whitespace.
Guenther
2011-01-21 15:20:22 +01:00
Stefan Metzmacher
e830e37c9c s3:smbd: use dcerpc_spoolss_X() functions
metze

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-01-21 12:30:22 +01:00
Volker Lendecke
1b373d6044 s3: Fix a deadlock between smbd and ctdbd
Do the notification after we released the share mode lock. Inside notify_fname
we take out another tdb lock. With ctdb also accessing our databases, this can
lead to deadlocks. Putting this notify after the TALLOC_FREE(lck) above we
avoid locking two records simultaneously. Notifies are async and informational
only, so calling the notify_fname without holding the share mode lock should
not do any harm.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Jan 21 12:29:21 CET 2011 on sn-devel-104
2011-01-21 12:29:21 +01:00
Jeremy Allison
78b931ce6c Remove all uses of "./" in pathnames - make canonical. This will become important when we need to guarantee canonical names for hashing.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jan 21 02:59:56 CET 2011 on sn-devel-104
2011-01-21 02:59:56 +01:00
Jeremy Allison
de4b09ca01 Ensure we don't use "./" in findfirst pathnames. Use a directory open of "." instead. 2011-01-20 16:30:28 -08:00
Jeremy Allison
bb54f72b94 Make processing of incoming stream rename paths common between reply_mv and ntrename. Ensure we don't depend on "./" in the streams module. 2011-01-20 16:27:56 -08:00
Stefan Metzmacher
c3ad9bf157 s3:smbd: use anonymous_shared_free() for shared memory signing state
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jan 20 07:48:29 CET 2011 on sn-devel-104
2011-01-20 07:48:29 +01:00
Stefan Metzmacher
34ea909636 lib/util: s/allocate_anonymous_shared/anonymous_shared_allocate/
metze
2011-01-20 05:31:45 +01:00
Andreas Schneider
7a97518e12 s3-smbd: Fixed a possible null pointer dereference. 2011-01-19 22:27:48 +01:00
Volker Lendecke
d9204622e3 s3: Fix a C++ warning 2011-01-17 08:03:40 +01:00
Volker Lendecke
109cbe37a2 s3: Fix bug 7917: Yet another bug in chain_reply
Found by Michael Hanscho <samba@micha.priv.at> with a WinCE client.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Jan 14 17:42:05 CET 2011 on sn-devel-104
2011-01-14 17:42:05 +01:00
Günther Deschner
4189c00cae s3-lanman: prefer dcerpc_srvsvc_X functions.
Guenther

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-01-13 14:12:14 +01:00
David Disseldorp
0b188e7784 s3-printing: Initiate pcap reload from parent smbd
Since commit 7022554, smbds share a printcap cache (printer_list.tdb),
therefore ordering of events between smbd processes is important when
updating printcap cache information. Consider the following two process
example:
1) smbd1 receives HUP or printcap cache time expiry
2) smbd1 checks whether pcap needs refresh, it does
3) smbd1 marks pcap as refreshed
4) smbd1 forks child1 to obtain cups printer info
5) smbd2 receives HUP or printcap cache time expiry
6) smbd2 checks whether pcap needs refresh, it does not (due to step 3)
7) smbd2 reloads printer shares prior to child1 completion (stale pcap)
8) child1 completion, pcap cache (printer_list.tdb) is updated by smbd1
9) smbd1 reloads printer shares based on new pcap information

In this case both smbd1 and smbd2 are reliant on the pcap update
performed on child1 completion.
The prior commit "reload shares after pcap cache fill" ensures that
smbd1 only reloads printer shares following pcap update, however smbd2
continues to present shares based on stale pcap data.

This commit addresses the above problem by driving pcap cache and
printer share updates from the parent smbd process.
1) smbd0 (parent) receives a HUP or printcap cache time expiry
2) smbd0 forks child0 to obtain cups printer info
3) child0 completion, pcap cache (printer_list.tdb) is updated by smbd0
4) smbd0 reloads printer shares
5) smbd0 notifies child smbds of pcap update via message_send_all()
6) child smbds read fresh pcap data and reload printer shares

This architecture has the additional advantage that only a single
process (the parent smbd) requests printer information from the printcap
backend.

Use time_mono in housekeeping functions As suggested by Björn Jacke.
2011-01-07 15:37:39 -08:00
David Disseldorp
04248c2cfa s3-printing: reload shares after pcap cache fill
Since commit eada8f8a, updates to the cups pcap cache are performed
asynchronously - cups_cache_reload() forks a child process to request
cups printer information and notify the parent smbd on completion.

Currently printer shares are reloaded immediately following the call to
cups_cache_reload(), this occurs prior to smbd receiving new cups pcap
information from the child process. Such behaviour can result in stale
print shares as outlined in bug 7836.

This fix ensures print shares are only reloaded after new pcap data has
been received.

Pair-Programmed-With: Lars Müller <lars@samba.org>
2011-01-07 15:37:39 -08:00
Andreas Schneider
8925b03b59 s3-rpcecho: Only register rpcecho in the developer build.
Autobuild-User: Andreas Schneider <asn@samba.org>
Autobuild-Date: Tue Jan  4 18:56:38 CET 2011 on sn-devel-104
2011-01-04 18:56:38 +01:00
Andreas Schneider
d4f5bf0c36 s3-smbd: Call the rpc service shutdown functions. 2011-01-04 11:23:21 +01:00
Andreas Schneider
9aa8763976 s3-smbd: Call all the rpc services in the right order. 2011-01-04 11:23:21 +01:00
Jeremy Allison
9b31f6ab6c Fix bug #7892 - open_file_fchmod() leaves a stale lock.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Dec 29 02:15:23 CET 2010 on sn-devel-104
2010-12-29 02:15:23 +01:00
Jeremy Allison
30d29e64cb All calls to event_add_to_select_args() call GetTimeOfDay() and
pass this in as the &now parameter. Push this call inside of
event_add_to_select_args() to the correct point so it doesn't
get called unless needed.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Dec 23 01:08:11 CET 2010 on sn-devel-104
2010-12-23 01:08:11 +01:00
Jeremy Allison
e8f7c60ec2 My algorithm for determining whan an incoming sequence number can be allowed is incorrect.
(I based it on the text in MS-SMB2, silly me :-). Fix it so incoming sequence numbers
can range over the entire allowable bitmap range. This fixes a repeatable
disconnect against Win7.

Jeremy.
2010-12-21 18:07:52 -08:00
Jeremy Allison
0a5f4f523f Keep track of the sparse status of an open file handle. Allows bypass of
strict allocation on sparse files. Files opened as POSIX opens are always
sparse.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 21 04:12:22 CET 2010 on sn-devel-104
2010-12-21 04:12:22 +01:00
Jeremy Allison
8998f4b013 Added call out to a Linux-compatible fallocate() when we need to extend a file
allocation extent without changing end-of-file size.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 21 02:41:24 CET 2010 on sn-devel-104
2010-12-21 02:41:23 +01:00
Ken Harris
09aea03813 CREATE in a compound CREATE/NOTIFY sequence was being passed through set_operation_credits()
twice (ultimately perhaps because of bug 7331 involving this compound sequence and the need
to be ready for any incoming CANCEL of the NOTIFY). This had the server thinking it had
granted more credit than it actually had, which lead to zero-credits being granted in interim
NOTIFY responses.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Dec 20 20:59:55 CET 2010 on sn-devel-104
2010-12-20 20:59:55 +01:00
Jeremy Allison
e7707d5abd From metze's work on sparse attributes. FILE_ATTRIBUTE_SPARSE is valid on get but not on set.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Dec 20 20:11:22 CET 2010 on sn-devel-104
2010-12-20 20:11:22 +01:00
Volker Lendecke
d082701ea5 s3: Reply correctly to FSCTL_IS_VOLUME_DIRTY 2010-12-19 23:25:06 +01:00
Volker Lendecke
356add8a63 s3: Fix some nonempty blank lines 2010-12-19 23:25:06 +01:00
Volker Lendecke
98a2fff2e5 s3: re-add some debugs to check_reduced_name 2010-12-19 23:25:06 +01:00
Volker Lendecke
43e42b4e77 s3: Fix some typos 2010-12-19 23:25:06 +01:00
Jeremy Allison
716ea734e4 Rename vfs operation posix_fallocate to just fallocate and add the vfs_fallocate_mode parameter.
It turns out we need the fallocate operations to be able to both
allocate and extend filesize, and to allocate and not extend
filesize, and posix_fallocate can only do the former. So by defining
the vfs op as posix_fallocate we lose the opportunity to use any
underlying syscalls (like Linux fallocate) that can do the latter
as well.

We don't currently use the non-extending filesize call, but now
I've changed the vfs op definition we can in the future. For the
moment simply map the fallocate op onto posix_fallocate for the
VFS_FALLOCATE_EXTEND_SIZE case and return ENOSYS for the
VFS_FALLOCATE_KEEP_SIZE case.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Dec 18 08:59:27 CET 2010 on sn-devel-104
2010-12-18 08:59:27 +01:00
Jeremy Allison
16d6da8a9b Move checks inside file_set_sparse() to allow it to be called from anywhere.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Dec 17 21:56:38 CET 2010 on sn-devel-104
2010-12-17 21:56:38 +01:00
Jeremy Allison
fe50632d54 file_set_sparse needs to be a handle based call. 2010-12-17 21:11:04 +01:00
Björn Jacke
192c4a145f s3:smbd: implement FSCTL_SET_SPARSE more correctly
this is a port of a patch from metze for 3.3:

We don't do the "strict allocation" when the sparse bit isn't
set, but that shouldn't matter.

We now allow windows applications to set and unset the sparse
bit.

Note that in order to implement this 100% like described
in [MS-FSA], we'd have to change our data model and support
the sparse flag per stream.
2010-12-17 21:11:04 +01:00
Björn Jacke
5c27dd67c8 s3:smbd: add file_set_sparse() function
this is based on a patch for 3.3 from metze
2010-12-17 21:11:04 +01:00
Björn Jacke
480042ddf9 s3: remove set_sparse_flag
we need to determine sparseness from the sparse flag we store not from the
allocation size on the POSIX filesystem. This is how Windows works - in the
first place sparseness is a file flag, not the allocation state of the file

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-12-17 21:11:04 +01:00
Björn Jacke
ebe5600615 s3: add FILE_ATTRIBUTE_SPARSE to get_stat_dos_flags 2010-12-17 21:11:04 +01:00
Jeremy Allison
a06519a579 Fix old bug in openX code, exposed when "strict allocate" is set to true.
We need to return the file size here, not the allocation size, but
we were not updating the stat struct after the vfs_set_filesize()
call. Ensure we always use fresh data in openX replies.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Dec 16 02:37:58 CET 2010 on sn-devel-104
2010-12-16 02:37:57 +01:00
Jeremy Allison
a8eed184a0 Implement "use sendfile = yes" for SMB2. (cherry picked from commit 95cb7adcd03a1abbd0af395b6c96dd8e0eebd3d1)
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Dec 15 02:24:08 CET 2010 on sn-devel-104
2010-12-15 02:24:08 +01:00
Jeremy Allison
14c70346fc Change interface of schedule_smb2_aio_read() to allocate the return DATA_BLOB.
Change smb2_read code to allocate return DATA_BLOB just before the read.

Preparing for SMB2 sendfile change which will not need to allocate
return buffer.

Jeremy
2010-12-15 01:38:16 +01:00
Jeremy Allison
0fe744078d Ensure we use vfs_fsp_stat(), not VFS_STAT directly, and store into fsp->fsp_name->st
instead of a SMB_STRUCT_STAT on the stack.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 14 05:05:50 CET 2010 on sn-devel-104
2010-12-14 05:05:50 +01:00
Jeremy Allison
f974e68213 Change crediting so that the credits are returned on the interim async response.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 14 01:09:05 CET 2010 on sn-devel-104
2010-12-14 01:09:05 +01:00
Jeremy Allison
041428352c As we handle missing sendfile() inside lib/sendfile.c, remove the WITH_SENDFILE ifdefs.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Dec 13 23:47:07 CET 2010 on sn-devel-104
2010-12-13 23:47:07 +01:00
Jeremy Allison
6ce365b238 We need to start off with smb2.credits_granted == 0. That way
when processing the faked up SMB2 NegProt from the SMB1 packet we
always allocate one credit on reply.

Jeremy.
2010-12-13 13:34:50 -08:00
Jeremy Allison
27a47eb9fc Remove extra unused credit arg. to smbd_smb2_request_setup_out() 2010-12-13 13:20:05 -08:00
Jeremy Allison
2ac579ca76 Add a SMB2 crediting algorithm, by default the same as Windows. Defaults to 128 credits.
Jeremy.
2010-12-10 15:46:41 -08:00
Andrew Bartlett
b3c2df5e0d s3-smbd Don't send SPNEGO principal (rfc4178 hint) by default
This patch, based on the suggestion by Goldberg, Neil R. <ngoldber@mitre.org>
turns off the sending of the principal in the negprot by default, matching
Windows 2008 behaviour.

This slowly works us back from this hack, which from an RFC
perspective was never the right thing to do in the first place, but we
traditionally follow windows behaviour.  It also discourages client
implmentations from relying on it, as if they do they are more open to
man-in-the-middle attacks.

Andrew Bartlett
2010-12-10 16:08:30 +11:00
Jeremy Allison
b8d7de3199 Merge the two conflicting allocation codes into one function, vfs_slow_fallocate()
and use that from both the truncate and fill_sparse functions.

Jeremy.
2010-12-03 02:55:05 +01:00
Jeremy Allison
5819a36aef Move posix_fallocate into the VFS where it belongs.
Jeremy.
2010-12-02 16:25:59 -08:00
Jeremy Allison
de8ceb5364 Fix bug #7835 - vfs_fill_sparse() doesn't use posix_fallocate when strict allocate is on
Tries posix_fallocate() and then falls back to old code.

Jeremy.
2010-12-02 15:38:36 -08:00
Jeremy Allison
c8395ac6cf Fix a typo - should be '&&' not '&' when checking for privileges.
Jeremy.
2010-12-01 17:29:05 -08:00
Michael Adam
813fe0bc4d s3:smbd: remove some commented out legacy code
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Thu Dec  2 01:18:19 CET 2010 on sn-devel-104
2010-12-02 01:18:19 +01:00
Jeremy Allison
d38cd9b671 Fix bug discovered with "encryped passwords = no".
message_push_string() and message_push_blob() both update
the bcc value, so we don't need the old code that tries to
do it manually.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Nov 29 22:24:01 CET 2010 on sn-devel-104
2010-11-29 22:24:01 +01:00
Jeremy Allison
b1dacb8195 Add in fsp->access_mask checks. Not required (underlying system does this)
but makes logic cleaner. Pointed out by Metze.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Nov 24 01:47:13 CET 2010 on sn-devel-104
2010-11-24 01:47:13 +01:00
Jeremy Allison
2b788aa6ce Move the uglyness of #ifdef REALPATH_TAKES_NULL into the vfs_default
module, change the signature of VFS_REALPATH to always return a
malloc'ed string.

Needed to make some privileges work I plan on doing shortly
easier to code.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Nov 20 02:15:50 CET 2010 on sn-devel-104
2010-11-20 02:15:50 +01:00
Jeremy Allison
781c4aabb8 Move error reporting of messaging context creation fail into
the daemons themselves. Allows client utilities to silently
fail to create a messaging context due to access denied on the
messaging tdb (which I need for the following patch).

Jeremy.
2010-11-14 04:39:05 +00:00
Jelmer Vernooij
ed22f13e7e s3: Rename GIT_COMMIT_{TIME,DATE} to COMMIT_{TIME,DATE}.
This avoids some special casing in the waf code.
2010-11-12 17:42:14 +00:00
Jeremy Allison
f0dcc90f72 Fix bug 7781 - Samba transforms ShareName to lowercase (sharename) when adding new share via MMC
Change the find_service() interface to not depend on fstring, and
create a useable talloc-based interface.

Jeremy.
2010-11-10 01:14:17 +00:00
Jeremy Allison
9997ee813b Remove fstring from map_username. Create a more sane interface than the called-parameter-is-modified.
Jeremy.
2010-11-10 01:14:17 +00:00
Volker Lendecke
f2456cd542 s3: Allow disabling of mdns registrations
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Nov  5 11:24:41 UTC 2010 on sn-devel-104
2010-11-05 11:24:41 +00:00
Volker Lendecke
c133fcc0b1 s3: Remove an unused prototype
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Nov  4 17:44:09 UTC 2010 on sn-devel-104
2010-11-04 17:44:09 +00:00
Volker Lendecke
f6a1f46b5e s3: Align nttrans replies the same way Windows does it
If you look at traces of "smbcacls" reading a secdesc from Samba and from W2k3
shows this difference in the querysecdesc nttrans reply. This patch is
necessary to enable viewing previous versions via the shadow copy modules from
Windows 2008. The other client versions seem not to care, but W2k8 does.

Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Nov  3 17:04:28 UTC 2010 on sn-devel-104
2010-11-03 17:04:28 +00:00
Andrew Bartlett
ed111d11eb s3-debug Move 'load_case_tables()' before lp_set_cmdline() and popt calls
The problem here is that we cannot run lp_set_cmdline() (directly or
indirectly via the popt helpers) until load_case_tables() has been run.

However, load_case_tables does not have auto-initialisation, so we
must init it once, and once only.

Andrew Bartlett
2010-11-02 04:36:04 +00:00
Andrew Bartlett
9da4ace1d9 s3-debug Impove setup_logging() to specify logging to stderr
This change improves the setup_logging() API so that callers which
wish to set up logging to stderr can simply ask for it, rather than
directly modify the dbf global variable.

Andrew Bartlett
2010-11-02 04:36:04 +00:00