1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00
Commit Graph

107 Commits

Author SHA1 Message Date
Andrew Tridgell
00a8ff5fe9 fixed a problem with group policy writes causing policy corruption
This bug was caused by two things:

  1) in the unix ACL mapping, we were not taking into account group
  write permssions for the SEC_STD_DELETE flag

  2) when a file is created using OVERWRITE mode, a fchmod() would
  fail if the user is not the file owner. We resolve that by only
  doing the fchmod() if the mapped file attribute does not match the
  desired file attribute
2009-08-05 17:51:58 +10:00
Andrew Tridgell
15a6a93d35 fixed the sense of the pvfs_acl uwrap check 2009-08-05 12:08:30 +10:00
Andrew Tridgell
58e5e1ea8d make the UID_WRAPPER skip checks at runtime
This fixes two issues pointed out by Andrew. It adds a runtime
uwrap_enabled() call that wraps the skips needed for uid emulation. It
also makes the skip in the directory_create_or_exist() function only
change the uid checking code, not the permissions code
2009-08-05 11:21:06 +10:00
Andrew Tridgell
fd43e0ee09 added a uid_wrapper library
This library intercepts seteuid and related calls, and simulates them
in a manner similar to the nss_wrapper and socket_wrapper
libraries. This allows us to enable the vfs_unixuid NTVFS module in
the build farm, which means we are more likely to catch errors in the
token manipulation.

The simulation is not complete, but it is enough for Samba4 for
now. The major areas of incompleteness are:

 - no emulation of setreuid, setresuid or saved uids. These would be
   needed for use in Samba3

 - no emulation of ruid changing. That would also be needed for Samba3

 - no attempt to emulate file ownership changing, so code that (for
   example) tests whether st.st_uid matches geteuid() needs special
   handling
2009-08-05 10:51:00 +10:00
Stefan Metzmacher
5fbbddec35 s4:pvfs: fix some talloc related compiler warnings
metze
2009-02-05 17:48:06 +01:00
Andrew Tridgell
d2bdb8fb16 empty access mask is only denied on SMB2 2008-09-24 18:10:23 -07:00
Andrew Tridgell
d3c6c71ff2 zero access mask should give ACCESS_DENIED 2008-09-24 18:10:23 -07:00
Stefan Metzmacher
98014c5668 pvfs: create a pvfs_acl subsystem
That means that the pvfs_acl implementations no longer register
as ntvfs modules (which was wrong)

metze
(This used to be commit 89e90556ec)
2008-06-28 10:30:25 +02:00
Andrew Tridgell
f0bc7c07fe don't mask out SEC_FILE_READ_ATTRIBUTE on SMB2
(This used to be commit 1dfa50a480)
2008-05-29 22:22:42 +10:00
Andrew Tridgell
c86dc11be6 added support for returning the maximal access MXAC tag in SMB2 create
(This used to be commit 4eb49335d5)
2008-05-29 19:16:26 +10:00
Andrew Tridgell
e42ded24a0 SEC_FILE_READ_ATTRIBUTE is only automatically granted on SMB, not SMB2
(This used to be commit 7bff069142)
2008-05-29 18:23:20 +10:00
Andrew Tridgell
9a37e7ed93 Vista returns ACCESS_DENIED here
(This used to be commit f5068c6e50)
2008-05-27 14:06:51 +10:00
Andrew Tridgell
79af7ff2f7 fixed a valgrind error in id mapping
the status field is sent on both call and reply, but was only being
initialised on reply
(This used to be commit 2ebd7b8099)
2008-04-14 18:59:40 +02:00
Kai Blin
4133bd85e9 ntvfs: Use wbclient for pvfs_acl and pvfs_acl_nfs4
(This used to be commit ac5e5fee1d)
2008-04-02 23:07:27 +02:00
Jelmer Vernooij
afe3e8172d Install public header files again and include required prototypes.
(This used to be commit 47ffbbf674)
2008-04-02 04:53:27 +02:00
Jelmer Vernooij
2151cde580 r25554: Convert last instances of BOOL, True and False to the standard types.
(This used to be commit 566aa14139)
2007-10-10 15:07:55 -05:00
Andrew Tridgell
0479a2f1cb r23792: convert Samba4 to GPLv3
There are still a few tidyups of old FSF addresses to come (in both s3
and s4). More commits soon.
(This used to be commit fcf38a38ac)
2007-10-10 14:59:12 -05:00
Andrew Tridgell
2338e97832 r19199: split out the xattr NTACL code into a separate part of the posix
backend, allowing other ACL backends to be added. The xattr backend is
still the default backend
(This used to be commit 90f044e63b)
2007-10-10 14:20:52 -05:00
Andrew Tridgell
c5e67b8555 r18581: also check for SEC_STD_DELETE, and split out the check into a separate
static function
(This used to be commit 024ca6a91c)
2007-10-10 14:18:51 -05:00
Andrew Tridgell
9c53e14602 r18580: map the PVFS_FLAG_READONLY bit in the posix backend onto
NT_STATUS_ACCESS_DENIED in the access mask checks
(This used to be commit ceffc34f3e)
2007-10-10 14:18:51 -05:00
Stefan Metzmacher
0f2c93016d r15774: take care of the SYSTEM_SECURITY flag
metze
(This used to be commit 98f58d710a)
2007-10-10 14:08:17 -05:00
Stefan Metzmacher
44ba105503 r15118: - do access checks also when the owner and group are not changed
- only call chown/fchown when we want to change something

metze
(This used to be commit 46b3096d93)
2007-10-10 14:04:10 -05:00
Stefan Metzmacher
732027b87a r15071: fix typo
metze
(This used to be commit fde8922947)
2007-10-10 14:04:06 -05:00
Stefan Metzmacher
0dd63e0432 r15069: - don't crash on a NULL acl
- add the correct access checks for changing sd->group and sd->dacl

metze
(This used to be commit 2a61f65cd4)
2007-10-10 14:04:06 -05:00
Stefan Metzmacher
1af925f394 r14860: create libcli/security/security.h
metze
(This used to be commit 9ec706238c)
2007-10-10 13:59:44 -05:00
Stefan Metzmacher
d3087451c4 r14487: split smbsrv_request into two parts, one will be moved to ntvfs_request
but I don't to get the commit to large, to I'll do this tomorrow...

metze
(This used to be commit 10e627032d)
2007-10-10 13:57:32 -05:00
Jelmer Vernooij
8528016978 r14464: Don't include ndr_BASENAME.h files unless strictly required, instead
try to include just the BASENAME.h files (containing only structs)
(This used to be commit 3dd477ca51)
2007-10-10 13:57:27 -05:00
Stefan Metzmacher
307e43bb56 r14173: change smb interface structures to always use
a union smb_file, to abtract
- const char *path fot qpathinfo and setpathinfo
- uint16_t fnum for SMB
- smb2_handle handle for SMB2

the idea is to later add a struct ntvfs_handle *ntvfs
so that the ntvfs subsystem don't need to know the difference between SMB and SMB2

metze
(This used to be commit 2ef3f59709)
2007-10-10 13:56:57 -05:00
Stefan Metzmacher
86497db611 r14157: - pass a struct ntvfs_request to the ntvfs layer
(for now we just do #define ntvfs_request smbsrv_request,
   but it's the first step...)
- rename ntvfs_openfile() -> ntvfs_open()
- fix the talloc hierachie in some places in the ntvfs_map_*() code

metze
(This used to be commit ed9ed1f48f)
2007-10-10 13:56:55 -05:00
Jelmer Vernooij
4ac2be9958 r13924: Split more prototypes out of include/proto.h + initial work on header
file dependencies
(This used to be commit 1228358767)
2007-10-10 13:52:24 -05:00
Andrew Tridgell
d9c15b0f28 r6342: fixed a bad union assumption that caused ACLs to fail on 64 bit machines
Thanks to lars and agruen for finding this
(This used to be commit 2acc069185)
2007-10-10 13:11:33 -05:00
Andrew Tridgell
e82aad1ce3 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
(This used to be commit 9db6c79e90)
2007-10-10 13:09:38 -05:00
Andrew Tridgell
cc869963e8 r5050: make sure we translate the generic to the specific bits before doing a
pvfs_access_check_unix().

Fixes a problem with the cifsfs filesystem
(This used to be commit 8ebc61a229)
2007-10-10 13:09:17 -05:00
Andrew Tridgell
759da3b915 r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the
large commit. I thought this was worthwhile to get done for
consistency.
(This used to be commit ec32b22ed5)
2007-10-10 13:09:15 -05:00
Andrew Tridgell
3feb4423f3 r4615: added acl checking on directory search in pvfs
(This used to be commit 0e61a422bd)
2007-10-10 13:08:33 -05:00
Andrew Tridgell
c012669b55 r4595: on create check access against parent not child ...
(This used to be commit 5a1a17d3fc)
2007-10-10 13:08:31 -05:00
Andrew Tridgell
ad7da47948 r4584: fix pvfs backend to pass the new enhanced RAW-ACLS test. Easy once I really the
strange behaviour I saw was a w2k3 bug :-)
(This used to be commit e729061bcd)
2007-10-10 13:08:29 -05:00
Andrew Tridgell
5869493626 r4501: when copying files it is common for clients to copy the ACL. When the
ACL is the default ACL this menas the copied file would have an xattr
but the original would not. Avoid this by checking if the ACL being
set is the original ACL, and avoid the copy.
(This used to be commit 1df985a49b)
2007-10-10 13:08:15 -05:00
Andrew Tridgell
d4b1657396 r4464: added pvfs backend support for the special CREATOR_OWNER and CREATOR_GROUP inheritance rules
(This used to be commit 0a29fb45c3)
2007-10-10 13:07:53 -05:00
Andrew Tridgell
291b02a639 r4448: - fixed access_mask checking on acl set
- honor the change ownership requests of acl set, changing the underlying
  unix owner/group

- fix the access mask on file create with SEC_FLAG_MAXIMUM_ALLOWED
(This used to be commit 5761fa35ab)
2007-10-10 13:07:51 -05:00
Andrew Tridgell
ef179fddb3 r4412: SEC_FILE_READ_ATTRIBUTE is always granted, even if not requested. This was being done
in the full ACL code, but not in the unix access check code, which meant that qfileinfo
was failing for some parameters
(This used to be commit 96d017e521)
2007-10-10 13:07:45 -05:00
Andrew Tridgell
373bca5bcd r4411: when checking for create permissions, we need to check the parent, not the child!
(This used to be commit 30b4c20b1c)
2007-10-10 13:07:45 -05:00
Andrew Tridgell
e913a48ded r4408: added the remaining access check hooks into pvfs. All calls should now have acl checking,
and obey the various inheritance rules.
(This used to be commit 5fe51807d6)
2007-10-10 13:07:44 -05:00
Andrew Tridgell
abe22d0351 r4403: - added ACL inheritance in the pvfs backend. ACLs are now inherited on
file and directory creation via ntcreatex. pvfs now passes the
  inheritance test in RAW-ACLS

- cleaned up the error handling a bit in pvfs_open()
(This used to be commit f4dfb63d53)
2007-10-10 13:07:43 -05:00
Andrew Tridgell
359cf872df r4391: bring the default ACL inline with what w2k3 uses
(This used to be commit 16967f7502)
2007-10-10 13:07:42 -05:00
Andrew Tridgell
a66a985cde r4314: added ACL checking on unlink
(This used to be commit f25c469693)
2007-10-10 13:07:33 -05:00
Andrew Tridgell
d21a55dda7 r4205: fixed the default acl mapping from posix permissions to use the mapped
uid->sid and gid->sid
(This used to be commit 590e1a91bf)
2007-10-10 13:07:26 -05:00
Andrew Tridgell
6ca874f71a r4147: converted from NT_USER_TOKEN to struct security_token
this is mostly just a tidyup, but also adds the privilege_mask, which
I will be using shortly in ACL checking.

note that I had to move the definition of struct security_token out of
security.idl as pidl doesn't yet handle arrays of pointers, and the
usual workaround (to use a intermediate structure) would make things
too cumbersome for this structure, especially given we never encode it
to NDR.
(This used to be commit 7b446af09b)
2007-10-10 13:06:31 -05:00
Andrew Tridgell
4075e28a4f r4056: modified the access check code based on results from RAW-ACLS
test. Also added generic mapping bits for pvfs. We don't pass RAW-ACLS
yet, but its close.
(This used to be commit c7cbd966d4)
2007-10-10 13:06:20 -05:00
Andrew Tridgell
cc8f4358cc r4035: more effort on consistent naming of the access mask bits.
This removes the duplicate named SEC_RIGHTS_MAXIMUM_ALLOWED and
SEC_RIGHTS_FULL_CONTROL, which are just other names for
SEC_FLAG_MAXIMUM_ALLOWED and SEC_RIGHTS_FILE_ALL. The latter names
match the new naming conventions in security.idl

Also added names for the generic->specific mappings for files are
directories
(This used to be commit 17a4e0b3ac)
2007-10-10 13:06:16 -05:00
Andrew Tridgell
a8a3fec528 r4026: added NT ACL checking on pvfs_open() for existing files. I need to
work out some way to do a decent test suite for this.
(This used to be commit 9a9a0d0e79)
2007-10-10 13:06:15 -05:00
Andrew Tridgell
fdc9f417d8 r4011: get rid of rpc_secdes.h and replace it with a single sane set of
definitions for security access masks, in security.idl

The previous definitions were inconsistently named, and contained many
duplicate and misleading entries. I kept finding myself tripping up
while using them.
(This used to be commit 01c0fa722f)
2007-10-10 13:06:13 -05:00
Andrew Tridgell
77be33e31c r3995: improved the default ACL mapping from unix perms
(This used to be commit 01e89697fe)
2007-10-10 13:06:12 -05:00
Andrew Tridgell
71a81e9dcb r3990: take advantage of the uid->sid and gid->sid code to create a much
better default NT ACL in pvfs
(This used to be commit 9ff6ecbdb6)
2007-10-10 13:06:11 -05:00
Andrew Tridgell
0b691afe81 r3836: - fixed the handling of NT_STATUS_BUFFER_TOO_SMALL in nttrans server
- fixed revision number on default DACL

- fixed DACL_PRESENT bit in acl query

with these fixes cacls.exe and the GUI ACL editor in w2k both work
against pvfs. The GUI editor is slow as it times out looking up the
SID -> name mappings.
(This used to be commit 4468018cb6)
2007-10-10 13:05:58 -05:00
Andrew Tridgell
82da254ece r3833: NTACL is a better xattr name than DosAcl (tpot suggested this)
(This used to be commit 17911eea59)
2007-10-10 13:05:58 -05:00
Andrew Tridgell
bc7b4abc3a r3832: added NT ACL query/set to the posix NTVFS backend. The default ACL is
based on the current nttoken, which is completely wrong, but works as a start.

The ACL is stored in the xattr system.DosAcl, using a NDR encoded IDL
union with a version number to allow for future expansion.

pvfs does not yet check the ACL for file access. At the moment the ACL
is just query/set.

We also need to do some RPC work to allow the windows ACL editor to be
used. At the moment is queries the ACL fine, but displays an error
when it fails to map the SIDs via rpc.
(This used to be commit 3a1f20d874)
2007-10-10 13:05:57 -05:00