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

75 Commits

Author SHA1 Message Date
Ralph Boehme
5ff72827c3 s3:smbd: ignore dacls with MS NFS ACEs
Ignore NFS ACEs in code the modifies
* default POSIX ACLs
* VFS: NFSv4 ACLs
* VFS: xattr and tdb ACLs

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:08 +01:00
Ralph Boehme
0c53b293ab vfs_acl_common: dacl size must be updated
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 11 03:54:42 CEST 2014 on sn-devel-104
2014-09-11 03:54:42 +02:00
Andrew Bartlett
f0e49b015b vfs_acl_common: Do not fetch the underlying NT ACL unless we need it
This avoids asking for the posix ACL on disk twice, and avoids running
a good deal of mapping code if it is not needed.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-04 12:19:30 +01:00
Andrew Bartlett
4e8c8952ad vfs: Whitespace fix only to get_nt_acl_internal indentation
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-04 12:19:30 +01:00
Andrew Bartlett
25526ed3f5 vfs: Implement an improved vfs_acl_common that uses the hash of the system ACL
Where supported by the system ACL backend, this avoids hashing the
result of the ACL mapping, instead hashing the original ACL,
linearlised.

For maximum robustness, the hash of the NT and system ACL are stored,
along with the time and a description of the system ACL.  This variety
of extra metadata may assist some future implementation in determining
which hash to validate.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-04 12:19:30 +01:00
Andrew Bartlett
6a5f65b0e9 vfs: Add helper function hash_blob_sha256 to vfs_acl_common.c
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-04 12:19:29 +01:00
Michael Adam
4a8028a96e s3:smbd:vfs_acl: fix a PANIC when setting an ACL fails with ACCESS_DENIED
Omission to free the talloc frame causes a panic (at least in developer mode)
in the next main event loop due to "Frame not freed in order."
(Freed frame ../source3/smbd/process.c:3617, expected ../source3/modules/vfs_acl_common.c:534.)

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Dec  4 09:03:25 CET 2012 on sn-devel-104
2012-12-04 09:03:25 +01:00
Andrew Bartlett
60cf4cb5a6 vfs_acl_common: In add_directory_inheritable_components allocate on psd as parent
When we add a new DACL to the security descriptor, we need to use the
SD as the memory context, so we can talloc_move() it as a tree to a
new parent.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Nov  2 22:16:14 CET 2012 on sn-devel-104
2012-11-02 22:16:14 +01:00
Andrew Bartlett
c8ade07760 smbd: Add mem_ctx to {f,}get_nt_acl VFS call
This makes it clear which context the returned SD is allocated on, as
a number of callers do not want it on talloc_tos().

As the ACL transformation allocates and then no longer needs a great
deal of memory, a talloc_stackframe() call is used to contain the
memory that is not returned further up the stack.

Andrew Bartlett
2012-10-11 12:25:11 +11:00
Andrew Bartlett
33d9a22dcb smbd: Print ACL used to create hash in vfs_xattr_common
This should help us understand why sometimes an ACL set won't stick.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Sep 11 18:19:53 CEST 2012 on sn-devel-104
2012-09-11 18:19:53 +02:00
Jeremy Allison
254e8c46c4 Add debug message when SD hash doesn't match. 2012-07-17 10:04:03 -07:00
Richard Sharpe
632af66453 Check the return from create_acl_blob
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Thu May 17 07:17:29 CEST 2012 on sn-devel-104
2012-05-17 07:17:29 +02:00
Richard Sharpe
bfe4a2baee Fix the overwriting of errno before use in a DEBUG statement and use the return value from store_acl_blob_fsp rather than ignoring it.
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Wed May 16 03:43:41 CEST 2012 on sn-devel-104
2012-05-16 03:43:40 +02:00
Jeremy Allison
9d7444bfce Fix second part of bug #8811 - sd_has_inheritable_components segfaults on an SD that se_access_check accepts.
This fixes a coredump with a NULL DACL in add_directory_inheritable_components().

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Mar 17 01:05:57 CET 2012 on sn-devel-104
2012-03-17 01:05:57 +01:00
Jeremy Allison
45a3b14bea Fix bug #7933 - samba fails to honor SEC_STD_WRITE_OWNER bit with the acl_xattr module. 2012-02-03 14:55:34 -08:00
Jeremy Allison
6aafd8684b First part of fix for bug #8673 - NT ACL issue.
Simplify the logic in the unlink/rmdir calls - makes it readable
(and correct).
2012-01-11 08:54:08 -08:00
Jeremy Allison
46551d750d Fix bug #8644 - vfs_acl_xattr and vfs_acl_tdb modules can fail to add inheritable entries on a directory with no stored ACL.
If referring to an fsp sbuf can be left as an uninitialized variable,
causing the 'is_directory' variable to be false when it should be true.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Dec  2 22:13:03 CET 2011 on sn-devel-104
2011-12-02 22:13:03 +01:00
Jeremy Allison
da992be64f Fix bug 8636 - When returning an ACL without SECINFO_DACL requested, we still set SEC_DESC_DACL_PRESENT in the type field.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Nov 30 04:59:07 CET 2011 on sn-devel-104
2011-11-30 04:59:07 +01:00
Jeremy Allison
7ef4d08a98 Remove the setting of the inherited ACL on new files/directories. This is
now done correctly in the main codepath. The vfs_acl_XXXX modules are
now thin shims that simply store/retrieve ACLs as they should be.
2011-11-22 12:33:54 -08:00
Jeremy Allison
cde73e2ece Remove opendir() VFS code from ACL modules.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Nov  2 02:13:51 CET 2011 on sn-devel-104
2011-11-02 02:13:51 +01:00
Jeremy Allison
30a599684a Remove the mkdir and open functions from the ACL modules - main code paths now handle this. 2011-10-28 12:16:42 -07:00
Stefan Metzmacher
b3b69064d3 s3:vfs_acl_common: also parse xattr.NTACL version 1
This is what the source4/ntvfs/posix code uses.
It's also used at provision time to setup the sysvol permissions.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Oct 11 14:16:25 CEST 2011 on sn-devel-104
2011-10-11 14:16:25 +02:00
David Disseldorp
ca8c25abeb Fix bug 8480 - acl_xattr can free an invalid pointer if no blob is loaded.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Sep 23 22:20:55 CEST 2011 on sn-devel-104
2011-09-23 22:20:55 +02:00
Volker Lendecke
31c1c49b58 s3: Fix a c++ warning
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Sep 18 18:55:48 CEST 2011 on sn-devel-104
2011-09-18 18:55:48 +02:00
Jeremy Allison
218cccfdf1 Fix bug Bug 8422 - Infinite loop in ACL module code.
Missing assignment means this loop will never terminate. Need to be applied
to 3.5.x and 3.6.1.
2011-08-29 16:46:15 -07:00
Jeremy Allison
a6d06c0697 Fix bug #8370 - vfs_chown_fsp broken -- returns in the wrong directory
Ensure we always use vfs_ChDir() to keep the singleton cache coherent.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Aug 19 00:43:05 CEST 2011 on sn-devel-104
2011-08-19 00:43:04 +02:00
Andrew Bartlett
6e6aaacedb lib/util Move bitmap.c to lib/util 2011-07-08 11:23:23 +02:00
Andrew Bartlett
5e26e94092 s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Jeremy Allison
aff6c52370 Fix re-opened bug 8083 - "inherit owner = yes" doesn't interact correctly with vfs_acl_xattr or vfs_acl_tdb module.
Fix incorrect interaction when all of

"inherit permissions = yes"
"inherit acls = yes"
"inherit owner = yes"

are set. Found by Björn Jacke. Thanks Björn !

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Jun  7 22:32:18 CEST 2011 on sn-devel-104
2011-06-07 22:32:18 +02:00
Jeremy Allison
7d6ebe0de7 More const fixes. Remove CONST_DISCARD. 2011-05-06 01:44:07 +02:00
Jeremy Allison
182eea9ae2 Fix bug #8083 - "inherit owner = yes" doesn't interact correctly with vfs_acl_xattr or vfs_acl_tdb module.
If "inherit owner = yes", pass in the directory owner and group
owner as the target for CREATOR_OWNER and CREATOR_GROUP substitutions,
and also as the owner and primary group of the new security descriptor
being applied to the object.

Jeremy.
2011-04-14 13:20:08 -07:00
Björn Baumbach
e6cf92c574 s3-modules: Fix debug message
Print child descriptor instead of parent.

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

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Apr 11 11:48:42 CEST 2011 on sn-devel-104
2011-04-11 11:48:42 +02:00
Jeremy Allison
af45636166 Fix bug 8072 - PANIC: create_file_acl_common frees handle two times.
Caused by premature optimisation storing the parent ACL on the
module handle instead of (correctly) on the file fsp. Previous
code wasn't reentrant safe. This is less optimal but doesn't
crash in the specific case :-).

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Apr  9 02:05:15 CEST 2011 on sn-devel-104
2011-04-09 02:05:15 +02:00
Andrew Tridgell
49ab2df28a lib/crypto: rename the SHA256_ functions to samba_SHA256_
this prevents a symbol duplication with the openssl library, which may
be linked in via a secondary library dependency

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-04-06 08:12:19 +02:00
Jeremy Allison
00224d06c3 Fix bug #7987 - ACL can get lost when files are being renamed.
There is no reason for smbd with Windows ACLs to use chmod
or fchmod unless it's a file opened with UNIX extensions or
with posix pathnames.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Apr  2 02:40:43 CEST 2011 on sn-devel-104
2011-04-02 02:40:43 +02:00
Günther Deschner
45364f5e69 s3-vfs: include smbd/smbd.h in vfs modules.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Andrew Bartlett
2e69e89456 s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
These variables, of type struct auth_serversupplied_info were poorly
named when added into 2001, and in good consistant practice, this has
extended all over the codebase in the years since.

The structure is also not ideal for it's current purpose.  Originally
intended to convey the results of the authentication modules, it
really describes all the essential attributes of a session.  This
rename will reduce the volume of a future patch to replaced these with
a struct auth_session_info, with auth_serversupplied_info confined to
the lower levels of the auth subsystem, and then eliminated.

(The new structure will be the output of create_local_token(), and the
change in struct definition will ensure that this is always run, populating
local groups and privileges).

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-02-22 16:20:10 +11: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
Günther Deschner
50be0b2c1e s3: Remove superfluous ;
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Feb  2 15:44:21 CET 2011 on sn-devel-104
2011-02-02 15:44:21 +01:00
Jeremy Allison
6af05f10c1 Fix bug #7812 - vfs_acl_xattr/vfs_acl_tdb: ACL inheritance cannot be disabled
We were losing the incoming security descriptor revision number and
most importantly the "type" field as sent by the client. Ensure we
correctly store these in the xattr object.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Nov 24 00:18:57 CET 2010 on sn-devel-104
2010-11-24 00:18:57 +01:00
Jeremy Allison
06fc79f1fd Add acl_xattr:ignore system acls boolean (normally false) to allow
Samba ACL module to ignore mapping to lower POSIX layer. With this
fix Samba 3.6.x now passes RAW-ACLs (with certain smb.conf parameters
set).

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Oct 16 01:26:31 UTC 2010 on sn-devel-104
2010-10-16 01:26:30 +00:00
Jeremy Allison
f4a9d25cfc Add debug message to get_nt_acl_internal() to see what we got. 2010-10-15 17:38:21 -07:00
Jeremy Allison
625126dc8d Fix valgrind "uninitialized read" error on "info" when returning !NT_STATUS_OK.
Jeremy.
2010-10-15 17:38:21 -07:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Jeremy Allison
6f6094076f Make the vfs_acl_xattr and other modules work with NULL SD's. Fix
the "protected" inheritance problem (bleeding up from the POSIX
layer).

Jeremy

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Oct 12 00:57:41 UTC 2010 on sn-devel-104
2010-10-12 00:57:41 +00:00
Volker Lendecke
75c6e0e5c7 s3: Lift smbd_server_conn from file_find_di_first 2010-09-28 07:36:17 +02:00
Andrew Bartlett
8c15cf54ae s3-auth Rename NT_USER_TOKEN user_sids -> sids
This is closer to the struct security_token from security.idl
2010-08-31 10:20:14 +10:00
Volker Lendecke
c59ab01e33 s3: Fix an uninitialized variable 2010-08-01 18:16:19 +02:00
Günther Deschner
a75436e3ee s3-security: use shared SECINFO_DACL define.
Guenther
2010-06-03 11:00:12 +02:00