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

6500 Commits

Author SHA1 Message Date
Stefan Metzmacher
da8e8e5fa5 s3:smb2_sessetup: call set_current_user_info() and reload_services() on success
This matches the smb1 code.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Jan 25 08:39:35 CET 2012 on sn-devel-104
2012-01-25 08:39:35 +01:00
Jeremy Allison
869fd8eeba Another fix for bug #8556 - ACL permissions ignored when SMBsetatr is requested.
Remove erroneous check on FILE_WRITE_ATTRIBUTES when changing POSIX
permissions - this isn't an attribute set call (unless you're storing
attributes in POSIX permissions, which is not recommended).

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Jan 24 00:44:24 CET 2012 on sn-devel-104
2012-01-24 00:44:22 +01:00
Richard Sharpe
3191040c3d Another fix for bug #8556 - ACL permissions ignored when SMBsetatr is requested.
Prevent systems with "store dos attributes = yes" from overriding
FILE_WRITE_ATTRIBUITES.
2012-01-23 12:50:25 -08:00
Andrew Bartlett
41ed715d42 s3-libsmb: use struct gensec_security directly
This is rather than via a now one-element union.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-20 23:55:55 +01:00
Andrew Bartlett
06f7105490 s3-libcli Change krb5 smb sealing to call via gensec and gensec_gse
This also fixes the support for smb sealing with krb5 in make test, as
this now relies on secrets.tdb rather than /etc/krb5.keytab.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-20 23:55:54 +01:00
Stefan Metzmacher
a7275e57fd s3:smbd/proto.h: remove unused do_map_to_guest() prototype
metze
2012-01-20 23:55:52 +01:00
Jeremy Allison
95c514a010 Now make_connection_snum() is a static function that takes a
connection_struct as a parameter, fix the interface to allow
it to return an NTSTATUS.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Jan 19 07:25:49 CET 2012 on sn-devel-104
2012-01-19 07:25:49 +01:00
Jeremy Allison
39c627b607 Fix bug 8710 - connections.tdb - major leak with SMB2.
Ensure the cnum used to claim the connection for SMB2 is the
id that will be used for the SMB2 tcon. Based on code from
Ira Cooper <ira@wakeful.net>.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jan 18 23:14:32 CET 2012 on sn-devel-104
2012-01-18 23:14:32 +01:00
Volker Lendecke
b9e806050f Revert "Fix bug #8175 - smbd deadlock."
This reverts commit 5a2b5b6cfe.
2012-01-18 14:48:04 +01:00
Volker Lendecke
cf77a21c63 s3: Change locking order between brlock and locking
But 8175 was fixed in a way that brlock.tdb was always locked before
locking.tdb. This patch fixes the bug in a different way. locking.tdb
is the central tdb for files and should always be locked first.
This patch solves the problem by postponing the level2 break messages,
which are async anyway.
2012-01-18 14:48:04 +01:00
Volker Lendecke
45e61fcf61 s3: Add a "lock_order" argument to db_open
This will be used to enforce a lock hierarchy between the databases. We have
seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb.
These should be fixed by refusing a dbwrap_fetch_locked that does not follow a
defined lock hierarchy.
2012-01-18 14:48:04 +01:00
Volker Lendecke
cfebba96bd s3: Put an indirection layer into share_mode_lock
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-01-12 23:59:22 +01:00
Volker Lendecke
9cf6d735d4 s3: Introduce get_share_mode_lock_fresh()
This slightly simplifies the code path for all callers which assume
that a share mode exists already. Only the callers in open_file_ntcreate
and open_directory will ever create new share modes.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-01-12 23:59:22 +01:00
Stefan Metzmacher
d3e5a0bea4 s3:smbd: explicitly ask for GENSEC_FEATURE_UNIX_TOKEN
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jan 12 11:22:53 CET 2012 on sn-devel-104
2012-01-12 11:22:53 +01:00
Jeremy Allison
ddc1f3df51 Ensure we always free aio_ex on all error paths by moving the TALLOC_FREE
call out of smbd_aio_complete_aio_ex() and into the caller.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Jan 12 03:10:52 CET 2012 on sn-devel-104
2012-01-12 03:10:52 +01:00
Andrew Bartlett
09928fbcf6 s3-auth Rename make_auth_ntlmssp() -> make_auth_gensec()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-06 08:12:48 +01:00
Andrew Bartlett
1b738963ee s3-auth remove outdated comment
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jan  5 18:51:47 CET 2012 on sn-devel-104
2012-01-05 18:51:47 +01:00
Andrew Bartlett
6abb880519 s3-auth remove unused ntlmssp.h
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-05 17:17:29 +01:00
Andrew Bartlett
16e463e169 s3-auth Remove ntlmssp_wrap.h which is no longer required
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-05 17:17:28 +01:00
Andrew Bartlett
3042e38d51 s3-auth use gensec directly rather than via auth_generic_state
This is possible because the s3 gensec modules are started as
normal gensec modules, so we do not need a wrapper any more.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-05 17:17:28 +01:00
Andrew Bartlett
1075efabc7 s3-auth Add TALLOC_CTX * to auth_generic_prepare()
This makes the long term owner of this memory more clear.  So far only the
clear cases have been moved from NULL however.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-05 17:17:28 +01:00
Volker Lendecke
fed2fba0a9 s3: Move basic SMB checking to a much earlier point 2012-01-05 13:09:35 +01:00
Volker Lendecke
f7439f81be s3: Add a suicide mode to smbd
To test our cleanup code paths properly, we need a way to make smbd exit hard
without cleaning up
2012-01-05 13:09:35 +01:00
Volker Lendecke
69a67a1b73 s3: Check for the packet size before accessing it
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jan  4 15:16:20 CET 2012 on sn-devel-104
2012-01-04 15:16:20 +01:00
Volker Lendecke
bed281dad7 s3: Remove the unused "file_existed" parameter from smbd_calculate_access_mask
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Jan  3 15:16:50 CET 2012 on sn-devel-104
2012-01-03 15:16:49 +01:00
Volker Lendecke
c01f02a4b9 s3: Avoid "file_existed" in smbd_calculate_maximum_allowed_access
We access the file by name anyway, so we can just try to access it. The file
system will for sure tell us if the file does not exist.
2012-01-03 13:38:02 +01:00
Volker Lendecke
49a520217c s3: Remove some else{} branches in smbd_calculate_maximum_allowed_access 2012-01-03 13:38:01 +01:00
Volker Lendecke
8cadd19a91 s3: Directly use *p_access_mask in smbd_calculate_maximum_allowed_access 2012-01-03 13:38:01 +01:00
Volker Lendecke
a5a4b581b7 s3: Factor out smbd_calculate_maximum_allowed_access 2012-01-03 13:38:00 +01:00
Jeremy Allison
e39df67669 Final part of fix for bug #8679 - recvfile code path using splice() on Linux leaves data in the pipe on short write.
The code to set a DOS error on short writeX return is amazingly
legacy code, and also breaks the reply as fixup_chain_error_packet()
enforces a 2-byte wct on any reply where smb_rcls != 0.

Found in testing by Andrew Bartlett. Thanks Andrew !

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Dec 31 08:05:35 CET 2011 on sn-devel-104
2011-12-31 08:05:35 +01:00
Andrew Bartlett
c17131685c s3-auth remove auth_ntlmssp_start(), call auth_generic_start() directly
This makes it clear that this can support more than just NTLMSSP.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-12-22 19:25:10 +01:00
Andrew Bartlett
1100f6eca5 s3-auth rename auth_ntlmssp_prepare() -> auth_generic_prepare()
This function handles more than NTLMSSP now, at least when we are an AD DC
and so changing the name may avoid some confusion in the future.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-12-22 19:25:10 +01:00
Andrew Bartlett
6391fff9da s3-auth rename auth_ntlmssp_state -> auth_generic_state
This structure handles more than NTLMSSP now, at least when we are an AD DC
and so changing the name may avoid some confusion in the future.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-12-22 19:25:10 +01:00
Stefan Metzmacher
460fc521cf s3:smb2_negprot: add support for PROTOCOL_SMB2_24
metze
2011-12-22 15:58:45 +01:00
Jeremy Allison
c23f1ee0c9 Allow an object to be deleted from a directory if the caller has DELETE_CHILD access
even if we don't have access to read the ACL on the object. Fixes bug #8673 - NT ACL issue.
Different fix needed for 3.6.x.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 20 22:13:51 CET 2011 on sn-devel-104
2011-12-20 22:13:51 +01:00
Volker Lendecke
75d3b9ce08 s3: Fix some False/NULL hickups
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 20 13:13:17 CET 2011 on sn-devel-104
2011-12-20 13:13:17 +01:00
Jeremy Allison
b939144071 check_name() not needed in mkdir.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Dec 17 02:44:55 CET 2011 on sn-devel-104
2011-12-17 02:44:55 +01:00
Jeremy Allison
1dfa3ee986 Ensure VALID_STAT before accessing fields. 2011-12-17 01:10:41 +01:00
Jeremy Allison
a6854f2c0a Fix bug #8664 - Renaming a symlink fails if the symlink target is outside of the share.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Dec 16 23:32:26 CET 2011 on sn-devel-104
2011-12-16 23:32:26 +01:00
Jeremy Allison
7dcef878cd Restrict UCF_UNIX_NAME_LOOKUP (symlink allowed) to restricted set of calls. 2011-12-16 21:54:23 +01:00
Stefan Metzmacher
cbb67e9e2e s3:smbd: remove unused sconn_server_id()
metze
2011-12-16 13:19:33 +01:00
Stefan Metzmacher
704cf10645 s3:smbd: avoid using sconn_server_id()
metze
2011-12-16 13:19:32 +01:00
Volker Lendecke
7000bb6933 s3: Add some const to find_oplock_types
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Dec 16 09:10:07 CET 2011 on sn-devel-104
2011-12-16 09:10:06 +01:00
Volker Lendecke
2349c027c1 s3: Make open_file_ntcreate a bit easier to read
Move the declaration of "id" closer to its use
2011-12-16 07:34:48 +01:00
Volker Lendecke
ce30a7ae7b s3: Make open_file_ntcreate a bit easier to read
Move the calculation of "new_file_created" closer to its use
2011-12-16 07:34:48 +01:00
Volker Lendecke
98f7ba52e3 s3: Make open_file_ntcreate a bit easier to read
Remove a negation where it's not necessary
2011-12-16 07:34:48 +01:00
Volker Lendecke
432ea5f5c6 s3: Slightly simplify delay_for_exclusive_oplocks 2011-12-16 07:34:48 +01:00
Volker Lendecke
b3d8ecaf52 s3: Slightly simplify delay_for_batch_oplocks 2011-12-16 07:34:47 +01:00
Jeremy Allison
c5cbe481a7 Third part of fix for bug #8663 - deleting a symlink fails if the symlink target is outside of the share.
smbd_check_access_rights() - we can always delete a symlink.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Dec 16 03:32:15 CET 2011 on sn-devel-104
2011-12-16 03:32:15 +01:00
Jeremy Allison
f448c0e6db Second part of fix for bug #8663 - deleting a symlink fails if the symlink target is outside of the share.
Ensure we use UCF_UNIX_NAME_LOOKUP flags on filename_convert()
when doing a UNIX infolevel in trans2setfilepathinfo().
2011-12-15 16:33:37 -08:00