Commit Graph

50 Commits (2c11aaa2aa9900f24f09c6903c3b9fdb79e38689)

Author SHA1 Message Date
Jean-Pierre André 2c11aaa2aa Fixed the range of valid subauthority counts in a SID
ntfs_valid_sid() required that the subauthority count be between 1 and 8
inclusively.  However, Windows permits more than 8 subauthorities as well
as 0 subauthorities:

  - The install.wim file for the latest Windows 10 build contains a file
    whose DACL contains a SID with 10 subauthorities.
    ntfs_set_ntfs_acl() was failing on this file.

  - The IsValidSid() function on Windows returns true for subauthority
    less than or equal to 15, including 0.

There was actually already a another SID validation function that had the
Windows-compatible behavior, so I merged the two together.

Contributed by Eric Biggers
2015-07-14 08:37:01 +02:00
Jean-Pierre André 46716df541 Simplified NTFS ACLs when group same as owner and same permission as all
When the owner and the group of a file have the same SID, and permissions
for the group is the same as permissions for other, no ACE is needed for
the group.
2015-04-17 11:17:51 +02:00
Jean-Pierre André 935ce8d08b Fixed inappropriate description of ntfs_build_basic_posix() (cosmetic)
Fixed a missing description and wrongly copied+pasted comment
2014-06-23 11:46:58 +02:00
Jean-Pierre André ab8f021861 Fixed checking permissions when Posix ACLs are compiled in but not enabled
When the Posix ACLs are not enabled in the mount options, the permission
checks should not take into account the extra owners and groups of the
file.
2014-06-23 11:26:00 +02:00
Jean-Pierre André bfc5f3dd3d Fixed processing umask when Posix ACLs are compiled in but not enabled
When Posix ACLs are used, the umask is ignored and the initial permissions
of created files are taken for the parent directory. However the umask
should still be used when the Posix ACLs are not enabled in the mount
options.
2014-06-23 11:20:21 +02:00
Jean-Pierre André 8390ac4dee Recognized interactive users as any user
Since Vista, the standard directory /Users/Public which should be accessed
by any user is actually restricted to a few group of users, among them
the interactive ones. To make this directory accessible without using
the Posix ACLs, all Linux users are considered as interactive.
However, when Posix ACLs are used, users supposed to be interactive have
to be put into a secondary group mapped to the equivalent Windows group.
2014-05-22 09:30:07 +02:00
Jean-Pierre André c2af343c03 Improved the conditions for double inheritance of an ACE
The Windows-type inheritance of an ACE may imply creating two ACE's : one
for access and one for further inheritance. The conditions for doing so,
and the flags set on created ACE were sometimes wrong.
Note : the rules have been derived from testing multiple situations, but
there still are some gray cases.
2014-05-22 09:07:43 +02:00
Jean-Pierre André eefa41c385 Allowed group mapping of a few well-known SIDs
Since Vista, Windows defines a /Users/Public directory supposed to be
public, but actually only allowed to a few user categories (interactive,
batch, etc.) This patch makes possible to create equivalent Unix groups
and group users the same way as in Windows. Posix ACLs have to be enabled
for access to /Users/Public to be allowed to several groups.
2014-05-22 08:36:41 +02:00
Jean-Pierre André 91a44b438c Allowed DACLs to to not have any ACE
Windows server 2012 apparently uses files with no ACEs in their DACL,
thus denying any access to any process except system backup.
Such DACLs should however be considered valid.
2013-09-20 16:14:55 +02:00
Erik Larsson 2bee30c2f7 acls.c: Fix compiler warning regarding usage of uninitialized variable.
This warning is really a false alarm, but fix it anyway.
2012-11-06 02:12:48 +01:00
Jean-Pierre André c31c7463e8 Allowed SACLs to to not have any ACE
Accept security descriptors in which the SACL is present though it does not
contain any ACE. Such security descriptors have been found in Windows
installation files.
2012-09-12 09:36:21 +02:00
Jean-Pierre André 3953e929bb Fixed Windows-type inheritance for creator-owner ACE
Inheriting a creator-owner ACE the Windows way led to a buggy ACL
2012-08-20 14:29:51 +02:00
Jean-Pierre André 3103a6c383 Extended Windows-type ACL inheritance, as needed by Windows 8
Windows 8 uses "Authenticated user" principals which needs to be replaced
by the actual owner when inheriting
2012-08-20 12:36:45 +02:00
Jean-Pierre André 4b651b9340 Processed ACLs with no mentioned rights for owner (used by Windows8)
Windows 8 uses ACL patterns in which the owner has only implicit rights
(pattern not used by previous Windows versions)
2012-08-20 12:28:15 +02:00
Jean-Pierre André 9704ff9396 Processed ACL inheritance for authenticated users
Under some conditions, Windows defines an ACL inheritance for an
unidentified authenticated user. With this patch, such an unidentified
user is treated as any user (same as "world").
2012-06-18 12:27:38 +02:00
Jean-Pierre André 5cd49257b0 Removed unneeded variables as warned by gcc 4.6 2011-07-05 12:17:29 +02:00
Jean-Pierre André 351aec3f7a Enabled renaming of system extended attributes 2010-10-26 08:59:52 +02:00
Jean-Pierre André 891b7e97b3 Improved sanity checks on a security descriptor 2010-07-22 14:49:46 +02:00
Jean-Pierre André b1f9d5201a fixed a bug in ACL inheritance 2010-04-19 11:05:20 +02:00
jpandre 985ef5c2e8 Avoid a compiler warning 2009-12-15 18:21:57 +00:00
jpandre bae437d845 Included <sys/stat.h> needed in acls.c on some platforms 2009-12-14 17:17:08 +00:00
jpandre 716fdbaf33 Updated a copyright notice 2009-11-03 14:05:58 +00:00
jpandre 3a95774575 Accepted ACL_REVISION_DS as a valid ACL revision 2009-10-28 15:08:21 +00:00
jpandre f40b6edb32 Avoided a compiler warning 2009-10-28 15:07:02 +00:00
jpandre 588d9099b2 Inserted <stdarg.h>, useful for testing 2009-07-20 12:57:38 +00:00
jpandre 06e553b04d Fixed permissions of created files when parent directory has a default ACL 2009-07-04 19:14:56 +00:00
jpandre d76c7f6172 Logged user mapping errors (which occur before mounting) 2009-06-17 08:05:09 +00:00
jpandre c453008681 Fixed native NTFS inheritance 2009-05-17 19:54:08 +00:00
jpandre 2a2cb4ffb2 Fixed interpretation of ACLs for default Posix ACLS (inheritance) 2009-05-17 19:50:53 +00:00
jpandre d898b64a04 Changed interface for translating permissions to avoid a version dependency 2009-04-10 07:10:04 +00:00
jpandre 4898e594b8 Avoided sorting Posix ACEs when there is only one 2008-12-24 15:35:21 +00:00
jpandre f443601201 Avoided a full ACL compare when not needed to determine a default user mapping 2008-12-24 15:33:08 +00:00
jpandre 25e3cad534 Changed the sequencing of operations to compute the size of an ACL 2008-12-24 15:30:25 +00:00
jpandre 33cb0cbd7e Strengthened the consistency checks on ACLs 2008-12-24 15:27:34 +00:00
jpandre a675f60863 Declared mapping data as const in a few interfaces 2008-09-09 15:26:38 +00:00
jpandre 5770560fab Subdivided the building of NTFS ACLs 2008-09-09 15:19:42 +00:00
jpandre 8b0358876a Reverted wrong fix for parent directory having a default Posix ACL - feed back from fuse needed 2008-09-05 14:06:43 +00:00
jpandre 1b9bbc0993 Removed temporary logging of bad Posix ACLs 2008-09-05 14:03:25 +00:00
jpandre 2cc7b4536e Fixed initial permissions when there is a default ACL 2008-09-02 15:19:47 +00:00
jpandre 92985f750c Fixed mask avoidance in Posix ACLs when there is no designated user/group 2008-09-01 15:41:16 +00:00
jpandre 94d299b848 Fixed ACE size while decoding a Posix ACL 2008-08-30 10:34:27 +00:00
jpandre 6bfd3ed546 Fixed a stupid name prefixing 2008-08-30 10:31:40 +00:00
jpandre fd60178d8f Made possible to mention root as a designated user or group 2008-08-27 08:35:53 +00:00
jpandre 7d0293dc3c Enabled full endianness type checks 2008-08-25 09:06:48 +00:00
jpandre 58b3f86be6 Improved group permissions when using Posix ACLs 2008-08-25 09:04:26 +00:00
jpandre 62780e137b Cleaned and fixed endianness conversions 2008-08-21 11:02:35 +00:00
jpandre 225ec94d5c Fixed owner of files when different from Windows owner 2008-08-21 10:58:19 +00:00
jpandre 012684d116 Made possible to have the owner mentioned again as a designated user 2008-08-21 10:32:40 +00:00
jpandre 38c3d868a4 Improved approximation for ACLs built by Windows Administrator 2008-08-21 10:30:38 +00:00
jpandre 7f42da0b07 Reorganized and split the security source file, a few interfaces changed 2008-08-21 10:27:46 +00:00