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

209 Commits

Author SHA1 Message Date
Stefan Metzmacher
628af0e0ad s3:smbd: pass smbXsrv_connection to reply_special()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:13 +02:00
Stefan Metzmacher
314ef691ba s3:smbd: move sconn->smb1.signing_state to xconn->smb1.signing_state
This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:11 +02:00
Volker Lendecke
823215bf98 smbd: "err" is no longer set in get_lock_offset
This was only referenced in the !HAVE_LONGLONG section

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-22 15:32:39 +02:00
Michael Adam
f365f9f8af s3:smbd: make dptr_ReadDirName() static.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-10 00:26:14 +02:00
Christof Schmitt
654ca0590a smbd: Make messaging_send_to_children static
This function is only used in server.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jun 30 17:20:00 CEST 2014 on sn-devel-104
2014-06-30 17:20:00 +02:00
Volker Lendecke
0ead434b84 smbd: Store "struct deferred_open_record" instead of anonymous data on pml
The main point is to get a talloc parent that will go away when the
request is cancelled

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-21 20:38:11 +02:00
Michael Adam
ddb7d7fc94 vfs: remove unused function vfs_pread_data()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-06-13 17:29:10 +02:00
Ralph Boehme
f03e8b12c6 Convert samba_private_attr_name() to a public function
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-13 13:22:18 +02:00
Jeremy Allison
ffaa2849e5 s3: smbd: Remove open_file_fchmod().
No longer used (hurrah!).

Bug 10564 - Lock order violation and file lost

https://bugzilla.samba.org/show_bug.cgi?id=10564

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May  2 23:47:38 CEST 2014 on sn-devel-104
2014-05-02 23:47:38 +02:00
Volker Lendecke
da1778f445 smbd: Pass timespec_current through the notify_callback
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:08 +02:00
Volker Lendecke
3e24e07467 lib: Move full_path_tos to util_str.c
This can be useful elsewhere

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:08 +02:00
Stefan Metzmacher
427db654ac s3:smbd: let srvstr_pull_req_talloc() take 'const uint8_t *src'
This is the correct thing to do the smb request buffer contains
just bytes (uint8_t).

It also avoids strange casting in the callers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:43 +02:00
Volker Lendecke
5baa7402ba smbd: Implement and use full_path_tos
Yes, this looks like a hack, but talloc_asprintf does show up high in
profiles called from these routines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-12-14 11:21:32 +01:00
Jeremy Allison
fc611dd6e8 s3-lib: smbclient shows no error if deleting a directory with del failed
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10260

Move dir_check_ftype() to util.c

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-11-14 19:29:00 +01:00
Jeremy Allison
7d8e22c7c1 s3-smbd: smbclient shows no error if deleting a directory with del failed
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10260

Remove unneeded conn argument to dir_check_ftype().
Move to correct uint32_t types.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-11-14 19:29:00 +01:00
Andreas Schneider
327b0ddcd9 s3-smbd: Do not declare change_to_root_user() twice.
This is already in include/proto.h for smbd_shim.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:53:19 +01:00
Andreas Schneider
13d840ad2f s3-smbd_shim: Add become_authenticated_pipe_user().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:52:58 +01:00
Volker Lendecke
184cc138b6 smbd: Remove separate oplock_type parameter from set_file_oplock
This avoids the question where it could happen that something else but
fsp->oplock_type might be useful as an argument here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-10-24 14:22:03 +02:00
Volker Lendecke
670da42bfb smbd: Make release_file_oplock static
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-10-24 14:21:56 +02:00
Shekhar Amlekar
69470a2efd s3:smbd/session: Added a routine find_sessions()
this routine builds a list of sessions from a
particular remote machine or user.

Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-10 11:32:46 -07:00
Volker Lendecke
051b9121bc smbd: Apply some const to message_to_share_mode_entry
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06 13:40:25 +02:00
Volker Lendecke
cdc99b362f smbd: Remove unused should_notify_deferred_opens
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06 13:34:48 +02:00
Volker Lendecke
54d9ec7517 smbd: Make break_level2_to_none_async static
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-16 16:52:58 +02:00
Jeremy Allison
50a288cb6a Add the ability to send an NTSTATUS result back with a trans2 reply so we can return a parameter block with an error code.
This is needed when returning a STATUS_INVALID_NAME result (tested
from Windows 2012).

Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":"

Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-07-19 17:52:39 +10:00
Volker Lendecke
a7e803485d smbd: We don't use DEFERRED_OPEN_ENTRY anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26 15:17:22 -07:00
Volker Lendecke
3e7923d7af smbd: Remove unused reply_to_oplock_break_requests
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26 15:17:22 -07:00
Jeremy Allison
f340795144 Cleanup. Remove unused function dptr_DirCacheAdd(). Make DirCacheAdd() static.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Apr 16 12:05:13 CEST 2013 on sn-devel-104
2013-04-16 12:05:13 +02:00
Ralph Wuerthner
a70e9db0f3 s3:smbd: convert srvstr_pull_req_talloc() into a function
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-10 00:13:45 +02:00
Stefan Metzmacher
b80111adb3 s3:smbd: add some const to req_is_in_chain()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-20 09:32:26 -07:00
Stefan Metzmacher
ae1cb5ca04 s3:smbd: s/struct timed_event/struct tevent_timer
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:56 +01:00
Stefan Metzmacher
415e8e0513 s3:smbd: s/struct event_context/struct tevent_context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:51 +01:00
David Disseldorp
7ca8663e31 smbd: split out file_fsp_get from file_fsp_smb2
Obtain the files_struct from smb2req, persistent_id and
volatile_id.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:07 +01:00
Jeremy Allison
b668c9077b Move create_share_access_mask() from smbd/service.c to smbd/uid.c.
Make it static. Only called from uid.c now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:35 +11:00
Jeremy Allison
8475f206b2 Add check_user_share_access() which factors out the share security and read_only flag setting code.
Allows this to be called from both make_connection_snum() as well as check_user_ok().
Gives a consistent share security check function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:22 +11:00
Jeremy Allison
5e9eebf5de Change API for create_share_access_mask() - remove conn struct.
Eventually this will be indepentent of conn, just pass in the
readonly flag.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:08 +11:00
Jeremy Allison
926d9307f7 Change API for create_share_access_mask() to pass in the token.
Don't automatically use the one from conn->session_info->security_token.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:00 +11:00
Jeremy Allison
00de188e1f Fix API for create_share_access_mask().
Return the uint32_t share_access rather than directly
changing the conn struct.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:53 +11:00
Jeremy Allison
f7464bbf72 Remove static from create_share_access_mask().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:50 +11:00
Andrew Bartlett
813a3f0df9 pysmbd: Convert pysmbd to take an optional service to connect to
This uses create_conn_struct to correctly call VFS_CONNECT(), but only
if a service has been specified.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
2013-01-07 16:18:35 -08:00
Andrew Bartlett
6c80cf747d smbd: Split create_conn_struct into a fn that does not change the working dir
The python bindings do not want the current working directory changed
during operations, so we provide two functions, one providing the
original behaviour, and other providing the python bindings with just
the memory allocation and initilisation stuff.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
2013-01-07 16:09:39 -08:00
Jeremy Allison
1c5c492f7e Remove unused append_parent_acl().
Get rid of a large chunk of unused code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Dec  4 11:59:30 CET 2012 on sn-devel-104
2012-12-04 11:59:30 +01:00
Andrew Bartlett
d6c7e9b1ed smbd: Remove NT4 compatability handling in posix -> NT ACL conversion
NT4 is long dead, and we should not change which ACL we return based
on what we think the client is.  The reason we should not do this, is
that if we are using vfs_acl_xattr then the hash will break if we do.
Additionally, it would require that the python VFS interface set the
global remote_arch to fake up being a modern client.

This instead seems cleaner and removes untested code (the tests are
updated to then handle the results of the modern codepath).

The supporting 'acl compatability' parameter is also removed.

Andrew Bartlett

Reviewed by: Jeremy Allison <jra@samba.org>
2012-11-13 22:48:19 +01:00
Andrew Bartlett
236977bf46 Change get_nt_acl_no_snum() to return an NTSTATUS, not a struct security_descriptor *.
Internally change the implementation to use SMB_VFS_GET_NT_ACL()
instead of SMB_VFS_FGET_NT_ACL() with a faked-up file struct.

Andrew Bartlett

Reviewed by: Jeremy Allison <jra@samba.org>
2012-11-13 22:48:19 +01:00
Stefan Metzmacher
3d9361612d s3:smbd: pass the current time to make_connection[_smb1]()
Otherwise smbstatus reports the wrong time for tree connects.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Mon Nov  5 20:43:23 CET 2012 on sn-devel-104
2012-11-05 20:43:23 +01:00
Jeremy Allison
3a4b755ce5 Fix bug #9329 - Directory listing with SeBackup can crash smbd.
When we do a become_root()/unbecome_root() pair to temporarily
raise privilege, this NULLs out the NT token. If we're within
a become_root()/unbecome_root() pair then return the previous
token on the stack as our NT token. This is what we should be
using to check against NT ACLs in the file server. This copes
with security context changing when removing a file on close
under the context of another user (when 2 users have a file
open, one sets delete on close and then the other user has
to actually do the delete).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Oct 29 16:26:20 CET 2012 on sn-devel-104
2012-10-29 16:26:20 +01:00
Stefan Metzmacher
d4f369c470 s3:smbd: remove unused claim_connection/yield_connection
metze

Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:15:03 +02:00
Gregor Beck
02b9b79447 s3:smbd: remove smbd_server_connection argument from session_claim()
retrieve the server connection from the smbXsrv_session  argument instead.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:59 +02:00
Gregor Beck
4878769f8e s3:smbd: pass smbXsrv_session instead of user_struct to session_claim() and session_yield()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:59 +02:00
Gregor Beck
77906e7cdf s3:count_current_connections: do not clear orphaned entries from connections.tdb
This removes one of the last callers of connetions_forall.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:59 +02:00
Stefan Metzmacher
9b2a3ebf5c s3:smbd/utmp: remove ip address from utmp record
1. This was broken since Samba 3.2. when ipv6 support was
   added, it only worked for ipv6 addresses.
2. userspace tools only display the hostname field.
3. This is not really portable

metze

Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:58 +02:00