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

41799 Commits

Author SHA1 Message Date
Andrew Bartlett
51e3547426 s3-pysmbd: Allow a mode to be specified for the simple ACL
The additional group for the ACL is now optional.

Andrew Bartlett
2012-08-23 15:02:26 +02:00
Andrew Bartlett
8518dd6406 file_server: Move default VFS module settings to loadparm.c
This means that any utility that calls into the VFS layer will get the
right modules.

Because we use the fake_acls backend we need to override this whole
list in Samba4.pm however.

Andrew Bartlett
2012-08-23 15:02:26 +02:00
Stefan Metzmacher
069db9b630 s3:smb2_break: encrypt OPLOCK BREAK notifications
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Aug 23 10:01:14 CEST 2012 on sn-devel-104
2012-08-23 10:01:14 +02:00
Stefan Metzmacher
54dfd08cb2 s3:smb2_server: use smbXsrv_session->nonce_*
metze
2012-08-23 08:23:07 +02:00
Stefan Metzmacher
6f9610e618 smbXsrv.idl: add nonce_* to smbsrv_session
metze
2012-08-23 08:23:07 +02:00
Stefan Metzmacher
6c7ffa9092 s3:smb2_server: remove dump_data() from smbd_smb2_request_pending_timer()
This was just for debugging...

metze
2012-08-23 08:23:07 +02:00
Jeremy Allison
63ea42853c Remove align_string(). No longer used.
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug 22 20:38:50 CEST 2012 on sn-devel-104
2012-08-22 20:38:50 +02:00
Jeremy Allison
7eee4947f3 Fix bug in SMB_FIND_INFO_STANDARD parsing found by Volker.
The function align_string() is now broken as base_ptr no longer
points at the start of the SMB data packet, but
at the start of the returned TRANS2 data area.

Replace it with a check for FLAGS2_UNICODE_STRINGS and
a call to ucs2_align().
2012-08-22 10:03:20 -07:00
Andrew Bartlett
125e93cdde s3-pysmbd: Correct the python type for smb_acl_t
The t is weird, but the python bindings trim the traditional IDL name
prefix of each element, as it is usually rudundent.

Andrew Bartlett
2012-08-22 01:31:57 +02:00
Andrew Bartlett
450fcd79c7 s3-vfs: Remove extra calls to SMB_VFS_HANDLE_GET_DATA
Found by the talloc_stackframe() out of order checker!

Andrew Bartlett
2012-08-22 01:31:57 +02:00
Jeremy Allison
c84e6aebc2 Fix bug #9098 - winbind does not refresh kerberos tickets.
Based on work from Ian Gordon <ian.gordon@strath.ac.uk>.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 21 22:01:15 CEST 2012 on sn-devel-104
2012-08-21 22:01:15 +02:00
Andrew Bartlett
ebb776f51f selftest: Add tests for vfs_aio_fork
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 21 13:12:33 CEST 2012 on sn-devel-104
2012-08-21 13:12:33 +02:00
Andrew Bartlett
e79ed4fe72 s3-vfs: Make vfs_aio_fork erratic timing behaviour a run-time option
This will allow this to be tested as part of a normal selftest.

Andrew Bartlett
2012-08-21 11:35:20 +02:00
Andrew Bartlett
dc063bf3bd s3-pysmbd: Add get/set functions for the posix ACL layer
These will be used to verify that an ACL set as an NT ACL creates
the correct posix ACL.

Andrew Bartlett
2012-08-21 15:25:50 +10:00
Andrew Bartlett
4df2c65ea6 s3-pysmbd: Correct comments in python VFS bindings 2012-08-21 15:25:50 +10:00
Andrew Bartlett
02e25b2a43 s3-passdb: Allow pdb_sid_to_id to work on any SID
This is needed so that pdb_samba4 can map any SID during a provision.

At runtime, winbindd will be asked first, but this shortcut direct to the
ldb file makes it possible to set the permissions on the sysvol share at
provision time.

Andrew Bartlett
2012-08-21 15:25:49 +10:00
Andrew Bartlett
d963aaf73b s3-pysmbd: Add hook for a VFS chown() 2012-08-21 15:25:49 +10:00
Andrew Bartlett
4d5471f1c6 build: Remove special case for the build farm
Except in the formatting of the selftest output, this removes the special case
of the build farm, so that an autobuild, a manual make test and the build farm
are more similar.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 21 06:39:04 CEST 2012 on sn-devel-104
2012-08-21 06:39:04 +02:00
Herb Lewis
21e67bdcee Fix bug #9104 - winbindd can mis-identify idle clients - can cause crashes and NDR parsing errors.
A connection is idle when both struct winbindd_cli_state->request AND
struct winbindd_cli_state->response are NULL. Otherwise we can flag
as idle a connection in the state of having sent the request to
the winbindd child (request != NULL) but not yet received a reply
(response == NULL).

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 21 01:31:46 CEST 2012 on sn-devel-104
2012-08-21 01:31:46 +02:00
Andrew Bartlett
7a59c3d9b8 s3-build: Enable vfs_fake_acls when in developer mode or on the build farm 2012-08-20 21:58:06 +10:00
Andrew Bartlett
ae4195dd40 s3-vfs: Add lstat and lchown hooks to the vfs_fake_acls module 2012-08-20 21:58:05 +10:00
Andrew Bartlett
cbe758cfbb s3-vfs: Correct the implementation of fake_acls_sys_acl_delete_def_file() 2012-08-20 21:57:47 +10:00
Andrew Bartlett
6c0bef1756 s3-vfs: Use the system. namespace for fake ACLs
By using the system. namespace, we make sure this is only run on top of a TDB
based ACL store (ie in make test).

Andrew Bartlett
2012-08-20 21:57:47 +10:00
Andrew Bartlett
0f2d288f76 s3-smbd: ensure we give appropriate errors for EA requests on streams 2012-08-20 21:57:47 +10:00
Andrew Bartlett
6ce084f092 s3-smbd: Do not look for EA information on a stream
The estimated EA size needs to be of the main file.  However, the fsp
may point to the stream, so we need to ignore it if this is the case.

This may mean we estimate wrong if there has been a rename.

Andrew Bartlett
2012-08-20 21:57:46 +10:00
Andrew Bartlett
f9f8a8c3d8 s3-smbd: Push smb_fname into estimate_ea_size
This ensures that we return the ea size of the stream, not the overall file.

This is important as if there is an EA on the main file, the raw.streams
test was failing.

Andrew Bartlett
2012-08-20 21:57:46 +10:00
Andrew Bartlett
9699c335fd s3-vfs: Allow vfs_xattr_tdb to work without a connected share
This is needed to that get_nt_acl_no_snum() can work.

Andrew Bartlett
2012-08-20 21:57:46 +10:00
Michael Adam
c35bdb34da s3: add a debug message for failed execv in sys_popen()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-17 20:07:07 +02:00
Stefan Metzmacher
6457fb5c39 s3:lib: implement interpret_pid() as wrapper of server_id_from_string()
metze
2012-08-17 20:07:07 +02:00
Stefan Metzmacher
6a58c5fc64 s3:lib: implement serverid_equal() as macro of server_id_equal()
metze
2012-08-17 20:07:07 +02:00
Christian Ambach
f46c4dfe28 s3:vfs_tsmsm only send notifications when file was offline before
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Fri Aug 17 20:05:30 CEST 2012 on sn-devel-104
2012-08-17 20:05:30 +02:00
Volker Lendecke
dda4c5d794 s3: Adapt the tsmsm module to the new aio routines
Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-17 18:25:53 +02:00
Volker Lendecke
d1e1f8224f s3-vfs: Fix calls of lp_parm_talloc_string
Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-17 18:25:53 +02:00
Volker Lendecke
3755a418cc s3: Remove the gpfs_hsm_notify module
The functionality has been merged into vfs_gpfs

Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-17 18:25:53 +02:00
Volker Lendecke
2c3a58db9e s3: Merge vfs_gpfs_hsm_notify into vfs_gpfs.c
It was separated out because formerly our async I/O was not properly
stackable. aio_fork could for example catch aio and not get aio_return
get through to vfs_gpfs

Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-17 18:25:53 +02:00
Stefan Metzmacher
1b487ad3d7 s3:selftest: add some tests against a share the requires encryption
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Aug 17 16:34:26 CEST 2012 on sn-devel-104
2012-08-17 16:34:26 +02:00
Stefan Metzmacher
45471f4d8f s3:smb2_negprot: annouce/negotiate SMB3 encryption support
metze
2012-08-17 14:51:57 +02:00
Stefan Metzmacher
9397d6709f s3:smb2_server: add SMB3 encryption support
metze
2012-08-17 14:51:57 +02:00
Stefan Metzmacher
9f1dfd8fac s3:smbd: don't disconnect the client when a share has "smb encrypt = required"
It's not the client fault, if he doesn't know that encryption is required.
We should just return ACCESS_DENIED and let the client work on other
shares and open files on the current SMB connection.

metze
2012-08-17 14:51:57 +02:00
Stefan Metzmacher
e5d4e8df6b s3:smbd: lp_smb_encrypt() returns SMB_SIGNING_* values
metze
2012-08-17 14:51:57 +02:00
Stefan Metzmacher
8b3da9a1f4 s3:smbd: make use of ENCRYPTION_REQUIRED()
metze
2012-08-17 14:51:57 +02:00
S Hargagan
21c8fa2566 Fix bug #9085 - NMB registration for a duplicate workstation fails with registration refuse
Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 17 04:15:21 CEST 2012 on sn-devel-104
2012-08-17 04:15:21 +02:00
Andrew Bartlett
6b7a99107d s3-torture: Allow vfstest to set ACLs on a directory
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 17 02:35:49 CEST 2012 on sn-devel-104
2012-08-17 02:35:49 +02:00
Stefan Metzmacher
16edb6eb7b s3:smb2_server: try to sign an error response if we have a signing key
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Aug 17 00:54:01 CEST 2012 on sn-devel-104
2012-08-17 00:54:01 +02:00
Stefan Metzmacher
19ca98a162 s3:smb2_server: verify the signature before the session_status
metze
2012-08-16 23:13:07 +02:00
Stefan Metzmacher
f4432fea6a s3:smb2_server: add some const to print_req_vectors()
metze
2012-08-16 23:13:07 +02:00
Volker Lendecke
fbebd7530e s3-libsmb: Add a python wrapper
Please note that this is not finished and only for internal use.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-16 21:10:32 +02:00
Volker Lendecke
cbe25105c7 s3-g_lock: Make g_lock_lock more robust
If for some reason the cleanup of dbwrap_watch_send does not work
properly, we might starve indefinitely. Make the lock routine more
robust by retrying every 5-10 seconds. g_lock_trylock will clean up
orphaned entries.

Signed-off-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Thu Aug 16 19:44:00 CEST 2012 on sn-devel-104
2012-08-16 19:44:00 +02:00
Volker Lendecke
b83cd05ce1 s3-msg: For msg_channel, correct the talloc hierarchy
talloc_free() of a channel must free all immediate requests that have
piled up

Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-16 18:05:34 +02:00
Volker Lendecke
8e50ff02f1 s3-msg: Rename msg_channel_init_destructor
Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-16 18:05:34 +02:00
Volker Lendecke
c2b29de2b1 s3-autoconf: Fix deps for dbwrap_torture
Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-16 18:05:34 +02:00
Volker Lendecke
494003fb67 s3-g_lock: Properly free "rec" on retry to avoid deadlock
Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-16 18:05:34 +02:00
Christian Ambach
7c56d80bee s3:brlock: give traverse_fn a proper name 2012-08-16 18:05:29 +02:00
Christian Ambach
6e3901194b s3:vfs_gpfs: make sure parameters are set correctly for leases
gpfs:leases requires kernel oplocks = yes and level2 oplocks = no
to work properly

make sure those are set correctly for a share
2012-08-16 18:05:29 +02:00
Christof Schmitt
a8b583089b s3:vfs_gpfs: Fix compile error in gpfs module
Fix this compile error by adding fcntl.h as a include that defines F_RDLCK
and F_WRLCK:

modules/gpfs.c: In function ‘set_gpfs_lease’:
modules/gpfs.c:102: error: ‘F_RDLCK’ undeclared (first use in this function)
modules/gpfs.c:102: error: (Each undeclared identifier is reported only once
modules/gpfs.c:102: error: for each function it appears in.)
modules/gpfs.c:105: error: ‘F_WRLCK’ undeclared (first use in this function)
2012-08-16 18:05:21 +02:00
Andrew Bartlett
df8e9c1287 s3-selftest: Add a seperate test for ACL tests using vfstest
This does not check for consistency or correctness yet, that will be
done with python unit tests.  The purpose of this test is to ensure
that the vfstest wrapper doesn't crash.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug 16 09:32:25 CEST 2012 on sn-devel-104
2012-08-16 09:32:25 +02:00
Andrew Bartlett
05885a84f9 s3-torture: Add ACL commands to vfstest
This will allow easier investigation of our ACL layer.

Andrew Bartlett
2012-08-16 15:25:40 +10:00
Andrew Bartlett
345b980c3e s3-torture: Use talloc more in vfstest
This matches the rest of Samba, which allocates many of these structures with talloc.

Andrew Bartlett
2012-08-16 15:25:40 +10:00
Andrew Bartlett
43255a1d18 s3-torture: Initialise fsp fully in vfstest open 2012-08-16 15:25:40 +10:00
Andrew Bartlett
1157db293f s3-smbd: Do not check no_acl_syscall_error(errno) after sys_acl_init()
This is no longer a VFS call, so will no longer fail in this way.

Andrew Bartlett
2012-08-16 15:25:39 +10:00
Andrew Bartlett
802d67cabe selftest: Extend xattr-tdb-1 vfstest to call stat 2012-08-16 15:25:39 +10:00
Andrew Bartlett
820d1795d7 s3-vfs: Continue to make vfs_xattr_tdb non-recursive
We now always use _NEXT_ VFS calls, even to build the file id.

Andrew Bartlett
2012-08-16 15:25:38 +10:00
Andrew Bartlett
843e19eff4 s3-vfs: Add new VFS module to fake setting an ACL
The purpose of this module is to remove the relience on the system having ACL support
to test NT ACLs.

Andrew Bartlett
2012-08-16 15:19:17 +10:00
Andrew Bartlett
97e7c3b8bd s3-selftest: convert xattr-tdb-1 vfstest driver into a subunit test
We don't use the simple smb.conf because we need to override all the
paths for this to work as non-root without a panic, so we use the s3dc
environment, which already loads this module.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug 16 02:55:19 CEST 2012 on sn-devel-104
2012-08-16 02:55:19 +02:00
Andrew Bartlett
748d8f5310 s3-selftest: convert stream_depot vfstest driver into a subunit test
This gives us our first automated coverage of the vfstest binary.

We don't use the simple smb.conf because we need to override all the
paths for this to work as non-root without a panic, so we use the s3dc
environment, which already loads this module.

Andrew Bartlett
2012-08-16 09:15:45 +10:00
Andrew Bartlett
08baa11ab8 fix printf warning in net connections 2012-08-16 07:48:06 +10:00
Gregor Beck
31980cf5cb s3:utils: remove standalone cclean tool
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-16 06:57:08 +10:00
Gregor Beck
1c2bae062d s3:net add command "connections cleanup"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-16 06:56:51 +10:00
Andrew Bartlett
65976d680a s3-vfs: Set errno in xattr emulation
The caller may check this errno.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Aug 15 18:05:33 CEST 2012 on sn-devel-104
2012-08-15 18:05:33 +02:00
Andrew Bartlett
cc3bdaaf0a s3-vfs: Avoid loops in VFS modules: call _NEXT functions in xattr emulation
We need to call the next module in the stack otherwise we will loop if
the stat call is in turn implemented in terms of extended attribute
lookup.

Andrew Bartlett
2012-08-15 16:28:03 +02:00
Andrew Bartlett
898c5e140d s3-vfs: ensure we strictly free the talloc_stackframe
We must do this when leaving the function or else in development, we
will panic.

Andrew Bartlett
2012-08-15 16:28:03 +02:00
Andrew Bartlett
fd42bc1846 librpc/idl: Make smb_acl_t public so we can pull/push it as a blob 2012-08-15 16:28:03 +02:00
Stefan Metzmacher
b596a116fd s3:smb2_server: do calculations based on SMBD_SMB2_NUM_IOV_PER_REQ in smbd_smb2_request_validate()
metze
2012-08-15 14:45:04 +02:00
Andrew Bartlett
24b1143068 s3-sysacls: Remove sys_acl_free_qualifier() as it is a no-op
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Aug 15 05:23:18 CEST 2012 on sn-devel-104
2012-08-15 05:23:18 +02:00
Andrew Bartlett
6ccfd05e72 s3-sysacls: Remove sys_acl_free_acl() and replace with TALLOC_FREE() 2012-08-15 11:44:50 +10:00
Andrew Bartlett
e25830dcd8 s3-smbd: Remove sys_acl_*() VFS wrapper functions
We no longer do struct smb_acl_t manipuations via the VFS layer,
which is now reduced to handling the get/set functions.

The only backend that implemented these functions (aside from audit)
was the vfs_default module calling the sys_acl code.  The various ACL
implementation modules either worked on the fully initilaised
smb_acl_t object or on NT ACLs.

This not only makes the operation of the posix ACL code more efficient
(as allocation and free is not put via the VFS), it makes it easier to
test and removes the fantasy that a module could safely redefine this
structure or the behaviour here.

The smb_acls.idl now defines the structure, and it is now allocated
with talloc.

These operations were originally added to the VFS in commit
3bb219161a.

Andrew Bartlett
2012-08-15 11:44:50 +10:00
Andrew Bartlett
a63a2a72eb s3-smbd: Remove unused conn argument from convert_permset_to_mode_t() 2012-08-15 11:44:50 +10:00
Andrew Bartlett
3d031f2189 s3-smbd: Call sys_acl_set_permset() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:49 +10:00
Andrew Bartlett
9f16fcfd3f s3-smbd: Call sys_acl_set_qualifier() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:49 +10:00
Andrew Bartlett
21e0b91e9c s3-smbd: Call sys_acl_set_tag_type() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:49 +10:00
Andrew Bartlett
50d147b858 s3-smbd: Call sys_acl_create_entry() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:48 +10:00
Andrew Bartlett
db544790f1 s3-smbd: Call sys_acl_add_perm() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:48 +10:00
Andrew Bartlett
631a356ea2 s3-smbd: Call sys_acl_clear_perms() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:48 +10:00
Andrew Bartlett
d78c7c32dc s3-smbd: Call sys_acl_init() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:47 +10:00
Andrew Bartlett
8b3227eb45 s3-smbd: Call sys_acl_free_acl() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:47 +10:00
Andrew Bartlett
6a46fbb393 s3-smbd: Call sys_acl_free_qualifier() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:47 +10:00
Andrew Bartlett
e019b93f0e s3-smbd: Call sys_acl_get_entry() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:46 +10:00
Andrew Bartlett
d8fb9e77ec s3-smbd: Call sys_acl_free_qualifier() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:46 +10:00
Andrew Bartlett
6a2f142b49 s3-smbd: Call sys_acl_get_qualifier() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:45 +10:00
Andrew Bartlett
d83276c13f s3-smbd: Call sys_acl_get_tagtype() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:45 +10:00
Andrew Bartlett
3b409324d3 s3-smbd: Call sys_acl_get_permset() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:45 +10:00
Andrew Bartlett
7dff34f5d0 s3-smbd: Call sys_acl_get_perm() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:44 +10:00
Andrew Bartlett
0705391ed0 s3-smbd: Move smb_acl_t declaration to smb_acl.idl
This will allow us to marshall this into and from an NDR blob on disk, which will
allow us to fake up ACL support during make test, and to test the NT ACL emulation
using python bindings via the VFS.

Andrew Bartlett
2012-08-15 11:44:44 +10:00
Andrew Bartlett
dcfb6aad16 s3-smbd: Change allocation of smb_acl_t to talloc()
The acl element is changed to be a talloc child, and is no longer one element
longer than requested by virtue of the acl[1] base pointer.

This also avoids one of the few remaining cases of over-allocation of a structure.

Andrew Bartlett
2012-08-15 11:44:43 +10:00
Christof Schmitt
bd23c8f1ce s3-winbind: Return the DC name from DC_PING
The DC that was attempted to ping is useful for troubleshooting. Return
the DC name in the response to the wbclient.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-15 11:44:42 +10:00
Christof Schmitt
7baa7091b7 s3-winbind: Pass ping-dc result to client
The client checks for an error code in response.data.auth.nt_status,
make sure the result is stored there.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-15 11:44:42 +10:00
Andrew Bartlett
ff5d177a69 s3-passdb: Silence scary DEBUG(0) message on first use of secrets.tdb databases
When pdb_samba4 first opens this databse, this message is printed.

Andrew Bartlett
2012-08-14 15:37:22 +02:00
Andrew Bartlett
fe295358df s3-vfs: Put vfs_aixacl_util.c helper functions into a header file
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 14 02:16:11 CEST 2012 on sn-devel-104
2012-08-14 02:16:11 +02:00
Salvador I. Gonzalez
34c4664dc0 s3-selftest: Add smbclient tarmode test
(With small changes to have test complete by Andrew Bartlett)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-14 08:37:48 +10:00
Salvador I. Gonzalez
14285005ec s3-selftest: Fix copy/paste error in test usage string
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-14 07:48:05 +10:00
Salvador I. Gonzalez
4e4c3062bc Fix smbclient/tarmode panic on connecting to Windows 2000 clients.
'Freed frame ../source3/libsmb/clilist.c:934, expected ../source3/client/clitar.c:821'
  Cause: (strequal(finfo->name,"..") || strequal(finfo->name,"."))
    evaluates to true, do_tar returns without freeing ctx

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug 13 23:12:50 CEST 2012 on sn-devel-104
2012-08-13 23:12:50 +02:00
Jeremy Allison
aaeb3f5d9b Ensure we update last_access on the winbindd child struct on each request. 2012-08-13 10:35:41 -07:00
Björn Jacke
f7403d838f s3: skip loading vfs modules for printer connections
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sun Aug 12 23:40:23 CEST 2012 on sn-devel-104
2012-08-12 23:40:23 +02:00
Andrew Bartlett
f36e28d131 s3-nfs4acls: Remove lookup_sid and sidmap from NFSv4 ACL mapping and check gid first
By checking just the IDMAP, and by removing the sidmap and lookup_sid calls, we support
IDMAP_BOTH.  This is because by checking for a mapping to a GID first, we can rely on
the fact that IDMAP_BOTH will resolve to a GID.

If the sidmap idea is valued - it allows multiple SIDs to map to a single unix ID, this should
be done in the IDMAP layer.

Andrew Bartlett

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug 11 01:17:36 CEST 2012 on sn-devel-104
2012-08-11 01:17:36 +02:00
Andrew Bartlett
c991ac0ebf s3-smbd: Merge ACE entries based on mapped UID/GID not SID
As the test for a valid posix ACL is based on the unix uid/gid only appearing once in the ACL
the merge process also needs to be UID/GID based.

This is a problem when we have multiple builtin groups mapped to the same POSIX group
as happens in a Samba4 provision.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-08-10 14:38:47 -07:00
Andrew Bartlett
d3188a0480 s3-smbd: Convert posix_acls.c to use struct unixid internally
This is consistent with the rest of Samba which uses this structure to represent
a unix uid or gid.

World values remain represented by the owner_type being WORLD_ACE in the containing
structure.  A -1 value is filled in to the unixid.id in the same way the .world value
was initialised in the union.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-08-10 14:38:47 -07:00
Andrew Bartlett
1c3c5e2156 s3-smbd: Create a shortcut for building the token of a user by SID for posix_acls
When a user owns a file, but does not have specific permissions on that file, we need to
make up the user permissions.  This change ensures that the first thing that we do
is to look up the SID, and confirm it is a user.  Then, we avoid the getpwnam()
and directly create the token via the SID.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-08-10 14:38:47 -07:00
Stefan Metzmacher
8defcb8bd1 Revert "s3:smbd: include smbXsrv.h before smbd/proto.h to have the smbXsrv_ structs available"
This reverts commit 98ccca8dca.

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Aug 10 17:35:38 CEST 2012 on sn-devel-104
2012-08-10 17:35:38 +02:00
Stefan Metzmacher
0e76bbc520 Revert "s3:smbd: Include smbXsrv.h before vfs.h (in smbd.h) so that the smbXsrv structures are available"
This reverts commit e332bfaff5.
2012-08-10 15:56:33 +02:00
Stefan Metzmacher
2cbfdd433e Revert "s3:smb: include "smbXsrv.h" before "vfs.h""
This reverts commit db0c233624.
2012-08-10 15:56:33 +02:00
Stefan Metzmacher
205185e88c s3:smbXsrv.idl: remove smbXsrv_*0 defines
This makes ctags more usable.

metze
2012-08-10 15:56:13 +02:00
Stefan Metzmacher
2b41f3702f s3:param: fix compiler warnings with FN_GLOBAL_CONST_STRING()
metze
2012-08-10 15:56:05 +02:00
Björn Jacke
13f8674a15 build: rename security → samba-security
there is a libsecurity on OSF1 which clasheѕ with our security lib. see bug #9023.

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Aug 10 14:22:21 CEST 2012 on sn-devel-104
2012-08-10 14:22:20 +02:00
Jeremy Allison
a5495bc6b0 Remove smb_panic() from unix_strlower(). Just rely on error code return.
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug  9 23:52:53 CEST 2012 on sn-devel-104
2012-08-09 23:52:53 +02:00
Jeremy Allison
b70f23c2b5 Correctly check for errors in strlower_m() returns. 2012-08-09 12:08:18 -07:00
Jeremy Allison
ce21d08040 Fix strlower_m() to return an error indication. 2012-08-09 12:07:41 -07:00
Jeremy Allison
c13887defc Check error returns on strnorm(). 2012-08-09 12:07:32 -07:00
Jeremy Allison
526e875cec Check error returns from strupper_m() (in all reasonable places). 2012-08-09 12:06:54 -07:00
Jeremy Allison
e1ec86a49c Fix missing ads_destroy in error path. 2012-08-09 09:47:35 -07:00
Jeremy Allison
9fcc6f27fb Change strupper_m() to return a value. 2012-08-09 09:47:35 -07:00
Jeremy Allison
af3e529c18 Fix bad return in unix_strupper. 2012-08-09 09:47:35 -07:00
Jeremy Allison
b6eb3a6808 Prepare to remove smb_panic() from unix_strlower(). 2012-08-09 09:47:35 -07:00
Jeremy Allison
8605b35e88 Fix bad return values in unix_strlower/unix_strupper. 2012-08-09 09:47:35 -07:00
Michael Adam
523602863a s3:torture:delete: add a 12th subtest to the delete-on-close tests
test whether second open is possible with initial delete on close
and how setting and unsetting delete on close on the handle affects
the initial delete on close (it does not...)
2012-08-09 16:22:53 +02:00
Michael Adam
db160bf510 s3:torture:delete: fix 11th test to work against windows 2012-08-09 16:22:50 +02:00
Michael Adam
2e53fb109f s3:torture:delete: simplify return code handling, fixing a couple of return codes in error cases 2012-08-09 15:29:51 +02:00
Michael Adam
49a2c68011 s3:torture:delete: reduce indentation 2012-08-09 15:29:50 +02:00
Michael Adam
54e5810638 s3:torture:delete: add a comment 2012-08-09 15:29:49 +02:00
Michael Adam
c228b7abee s3:torture:delete: add a comment 2012-08-09 15:29:47 +02:00
Michael Adam
7a7b86d3c7 s3:torture:delete: add a comment 2012-08-09 15:29:46 +02:00
Michael Adam
5b1afa6307 s3:torture:delete: move the success message for a subtest to the correct place 2012-08-09 15:29:45 +02:00
Michael Adam
2f7a371b92 s3:torture:delete: remove an else, reducing indentation 2012-08-09 15:29:44 +02:00
Michael Adam
3668a4c94c s3:torture:delete: remove an else, reducing indentation 2012-08-09 15:29:42 +02:00
Michael Adam
777c7a965b s3:torture:delete: remove an else, reducing indentation 2012-08-09 15:29:41 +02:00
Michael Adam
c36deaf3af s3:torture:delete: remove an else, reducing indentation 2012-08-09 15:29:40 +02:00
Michael Adam
e833141622 s3:torture:delete: really fail the test in a failure case 2012-08-09 15:29:39 +02:00
Michael Adam
9058288d6a s3:torture:delete: fix a comment 2012-08-09 15:29:38 +02:00
Michael Adam
bf492d1ffb s3:torture:delete: fix a message 2012-08-09 15:29:37 +02:00
Michael Adam
ff5e6e33fd s3:torture:delete: fix a message 2012-08-09 15:29:36 +02:00
Michael Adam
4aac6d00a9 s3:torture:delete: fix a message 2012-08-09 15:29:35 +02:00
Michael Adam
595845ca30 s3:torture:delete: fix a message (counting the opens) 2012-08-09 15:29:33 +02:00
Michael Adam
2aded6aebd s3:torture:delete: untangle function call from result check 2012-08-09 15:29:32 +02:00
Michael Adam
ef3684739a s3:torture:delete: untangle function call from result check 2012-08-09 15:29:26 +02:00
Michael Adam
4e75b0c717 s3:torture:delete: untangle function call from result check 2012-08-09 15:27:16 +02:00
Michael Adam
ccb25831e2 s3:torture:delete: untanlge function call from result check 2012-08-09 15:27:15 +02:00
Michael Adam
8a92ae23fe s3:torture:delete: untangle function call from result check 2012-08-09 15:26:09 +02:00
Michael Adam
02b092533a s3:torture:delete: untangle function call from result check 2012-08-09 15:26:08 +02:00
Michael Adam
5138eb50a3 s3:torture:delete: untangle function call from result check 2012-08-09 15:26:07 +02:00
Michael Adam
5bc7c77cd8 s3:torture:delete: untangle function call from result check 2012-08-09 15:26:06 +02:00
Michael Adam
b5e9378e28 s3:torture:delete: untangle function call from result check 2012-08-09 15:25:19 +02:00
Michael Adam
361429d02f s3:torture:delete: untangle function call from result check 2012-08-09 15:25:18 +02:00
Michael Adam
8684506478 s3:torture:delete: untangle function call from result check 2012-08-09 15:25:17 +02:00
Michael Adam
1db70c0b8b s3:torture:delete: untangle function call from result check 2012-08-09 15:25:16 +02:00
Michael Adam
a70a4ad731 s3:torture:delete: untangle function call from result check 2012-08-09 15:13:33 +02:00
Andrew Bartlett
434bed75c4 s3-events: Do not vasprintf() the tevent debug messages that will not be shown
This malloc() and free() actually shows up quite high on a call profile of
provision of the AD DC (and this is the matching patch for source3).

Andrew Bartlett
2012-08-09 20:14:22 +10:00
Stefan Metzmacher
0d7b17f4db s3:smb2_sesssetup: setup global->[en|de]cryption_key
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Aug  9 09:59:02 CEST 2012 on sn-devel-104
2012-08-09 09:59:02 +02:00
Stefan Metzmacher
0cb11efa87 s3:smb2_read: don't try sendfile if encryption is used
metze
2012-08-09 08:21:35 +02:00
Stefan Metzmacher
a0cf42b709 s3:smb2_server: add smbd_smb2_request->do_encryption
For now it's always false...

metze
2012-08-09 08:21:35 +02:00
Stefan Metzmacher
95e4270813 s3:smb2_tcon: set global->encryption_required and enforce it
This the account or client doesn't support encryption we should
reject the tree connect.

metze
2012-08-09 08:21:35 +02:00
Stefan Metzmacher
64dce26533 s3:smb2_sesssetup: set global->encryption_required and enforce it
This the account or client doesn't support encryption we should
reject the session setup.

metze
2012-08-09 08:21:35 +02:00
Stefan Metzmacher
8734887348 s3:smbXsrv.idl: add encryption_required to smbXsrv_tcon_global0
metze
2012-08-09 08:21:35 +02:00
Stefan Metzmacher
b5a72f4f35 s3:smb2_server: check the session before we could response with an error.
metze
2012-08-09 08:21:35 +02:00
Stefan Metzmacher
f15d9a6670 s3:smb2_server: do central file_id check if the operation requires it
Note that it's fine to call file_fsp_smb2() twice, the 2nd call
just returns smb2req->compat_chain_fsp without a 2nd lookup.

metze
2012-08-09 08:21:35 +02:00
Stefan Metzmacher
47c5900040 s3:nmbd: log a failure in get_domain_master_name_node_status_success() as level 1
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Aug  8 20:14:29 CEST 2012 on sn-devel-104
2012-08-08 20:14:29 +02:00
Stefan Metzmacher
a3ccdafd1b s3:nmbd: don't log get_domain_master_name_node_status_fail at level 0
metze
2012-08-08 18:20:47 +02:00
Stefan Metzmacher
1c76e99ae4 s3:smb2_server: s/i/idx in smbd_smb2_request_pending_queue()
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Aug  8 17:32:26 CEST 2012 on sn-devel-104
2012-08-08 17:32:26 +02:00
Stefan Metzmacher
83d262088b s3:smb2_server: make use of SMBD_SMB2_OUT_HDR_PTR() in smbd_smb2_request_pending_queue()
metze
2012-08-08 12:52:52 +02:00
Stefan Metzmacher
0067de2074 s3:smb2_server: remove useless variable 'i'
metze
2012-08-08 12:52:51 +02:00
Stefan Metzmacher
63d92a192d s3:smb2_server: rewrite dup_smb2_vec3() using SMBD_SMB2_*_IOV_OFS and helper variables
metze
2012-08-08 12:52:51 +02:00
Stefan Metzmacher
fc8e3bd569 s3:smb2_server: make use of SMBD_SMB2_* macros in smbd_smb2_request_done_ex()
metze
2012-08-08 12:52:51 +02:00
Stefan Metzmacher
97b5aaa648 s3:smb2_server: make use of SMBD_SMB2_* macros in smbd_smb2_request_verify_sizes()
metze
2012-08-08 12:52:50 +02:00
Stefan Metzmacher
05ae95a0d5 s3:smb2_server: use the common buffer layout for smbd_smb2_request_pending*
metze
2012-08-08 12:52:50 +02:00
Stefan Metzmacher
644eab32af s3:smb2_read: use SMBD_SMB2_NUM_IOV_PER_REQ when checking for sendfile() support
metze
2012-08-08 12:52:50 +02:00
Stefan Metzmacher
2b9dd9049e s3:smb2_read: fix indentation in schedule_smb2_sendfile_read()
metze
2012-08-08 12:52:50 +02:00
Stefan Metzmacher
9f51d610d2 s3:smb2_server: don't try to update req->in.vector[0] in smbd_smb2_request_pending_queue()
req->in.vector[0] is reserved for the transport and might be removed in future.
This is currently always { NULL, 0 }, as it's not used, by our
transport layer code. The SMB2 layer should never touch this!

metze
2012-08-08 12:50:22 +02:00
Andrew Bartlett
b7b4879350 s3-torture: Extend pdbtest to also run an authentication unit-test
This tests both the builtin auth_sam against passdb directly and the
configured auth module.

Andrew Bartlett
2012-08-08 08:03:21 +02:00
Andrew Bartlett
de2d813898 build: Remove pdbtest from the autoconf build
pdbtest is internal test utility that is not installed.  It is only
run from the full (waf) make test, and does not need to be built in
the autoconf build.

Removing it from the autoconf build makes it easier to expand this
test to depend on more parts of Samba.

Andrew Bartlett
2012-08-08 08:03:21 +02:00
Stefan Metzmacher
6bfdca4786 s3:smb2_sesssetup: remove unused code in smbd_smb2_reauth_generic_return()
A reauth exchange is already signed, with the channel signing key.

metze
2012-08-08 05:37:49 +02:00
Stefan Metzmacher
5f7d786b08 s3:smb2_sesssetup: remove TALLOC_FREE(session) from smbd_smb2_[re]auth_generic_return
The caller does this via the smbd_smb2_session_setup_state_destructor()

metze
2012-08-08 05:37:49 +02:00
Stefan Metzmacher
c9ecfd6f3d s3:smb2_server: sign the last request at the start of smbd_smb2_request_reply()
This means we correctly sign all responses in a compound chain.

metze
2012-08-08 05:13:42 +02:00
Volker Lendecke
64c0367335 s3: Fix a crash in reply_lockingX_error
A timed brlock with 2 locks comes in and the second one blocks,
file is closed. smbd_cancel_pending_lock_requests_by_fid sets
blr->fsp to NULL. reply_lockingX_error (called via
MSG_SMB_BLOCKING_LOCK_CANCEL) deferences blr->fsp because
blr->lock_num==1 (the second one blocked).

This patch fixes the bug by only undoing the locks if fsp!=NULL.
fsp==NULL is the close case where everything is undone anyway.

Thanks to Peter Somogyi, somogyi@hu.ibm.com for this bug report.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug  8 04:12:04 CEST 2012 on sn-devel-104
2012-08-08 04:12:04 +02:00
Björn Jacke
c2dee12d67 vfs_dirsort: Remove unnecessary return; statement
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Wed Aug  8 02:17:13 CEST 2012 on sn-devel-104
2012-08-08 02:17:13 +02:00
Björn Jacke
375ba1b483 vfs_afsacl.c: Remove some unnecessary return; statements 2012-08-08 00:21:26 +02:00
Björn Jacke
ebc92d0715 vfs_full_audit: Remove some unnecessary return; statements 2012-08-08 00:21:26 +02:00
Björn Jacke
dab8fe5dea vfs_time_audit: Remove unnecessary return; statement 2012-08-08 00:21:26 +02:00
Björn Jacke
3f9b2cc682 vfs_time_audit: Remove some unnecessary return; statements 2012-08-08 00:21:26 +02:00
Volker Lendecke
9adf6a061a vfs-mediaharmony: Remove some unnecessary return; statements 2012-08-08 00:21:26 +02:00
Björn Jacke
da4057fdca vfs_media_harmony: fix return of void
caught by the Studio Compiler

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Tue Aug  7 22:22:48 CEST 2012 on sn-devel-104
2012-08-07 22:22:48 +02:00
Stefan Metzmacher
c3016915a1 s3:smb2_server: fix SMB2 signing of compound responses
We need to defer the signing until we know the response
doesn't change anymore before it goes over the wire.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug  7 20:29:30 CEST 2012 on sn-devel-104
2012-08-07 20:29:30 +02:00
Stefan Metzmacher
40f771e010 s3:smb2_server: there's no need to copy req->out.vector when we just keep the last request
metze
2012-08-07 18:32:47 +02:00
Stefan Metzmacher
8d63efe273 s3:smb2_server: use memmove instead of copying single vector elements
metze
2012-08-07 18:32:47 +02:00
Stefan Metzmacher
9b8973d3b5 s3:smb2_server: make use of SMBD_SMB2_OUT_HDR_PTR() smbd_smb2_request_pending_queue()
metze
2012-08-07 18:32:46 +02:00
Stefan Metzmacher
bfc87a4a76 s3:smb2_server: check for compound based on SMBD_SMB2_NUM_IOV_PER_REQ
metze
2012-08-07 18:32:46 +02:00
Stefan Metzmacher
5730272690 s3:smb2_server: make use of SMBD_SMB2_OUT_*_IOV smbd_smb2_request_reply()
metze
2012-08-07 18:32:46 +02:00
Stefan Metzmacher
727b1d1fa8 s3:smb2_server: check for compound based on SMBD_SMB2_NUM_IOV_PER_REQ
metze
2012-08-07 18:32:45 +02:00
Stefan Metzmacher
2da62179de s3:smb2_server: make use of SMBD_SMB2_*_IOV_OFS
metze
2012-08-07 18:32:45 +02:00
Stefan Metzmacher
d609bb9b42 s3:smb2_server: make use of helper macros in smb2_calculate_credits()
metze
2012-08-07 18:32:45 +02:00
Stefan Metzmacher
efaea8e0e1 s3:smb2_server: make use of helper macros in smbd_smb2_request_validate()
metze
2012-08-07 18:32:45 +02:00
Stefan Metzmacher
4e6e1ecb6e s3:smb2_server: make use of SMBD_SMB2_NUM_IOV_PER_REQ
metze
2012-08-07 18:32:44 +02:00
Stefan Metzmacher
337604a0cf s3:smb2_server: add some more SMBD_SMB2_* defines/macros
metze
2012-08-07 18:32:44 +02:00