diff options
| author | Eli Zaretskii | 2012-12-17 21:14:34 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-12-17 21:14:34 +0200 |
| commit | 66447e07c1aa037730127d6fcdd2658f87f13dc0 (patch) | |
| tree | 0547cb5e75ae1ffeb51d7b3f80275e0a65f70720 /nt | |
| parent | 207a7ef0531ca92468e19115a2c2064c9b22bfd4 (diff) | |
| download | emacs-66447e07c1aa037730127d6fcdd2658f87f13dc0.tar.gz emacs-66447e07c1aa037730127d6fcdd2658f87f13dc0.zip | |
Support Posix ACL APIs on MS-Windows.
src/w32.c: Include sddl.h and sys/acl.h.
(SDDL_REVISION_1): Define if not already defined.
(g_b_init_get_security_descriptor_dacl)
(g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
(g_b_init_is_valid_security_descriptor)
(g_b_init_set_file_security): New static flags.
(globals_of_w32): Initialize them to zero.
(SetFileSecurity_Name): New string constant.
(SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
(ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
(ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
(IsValidSecurityDescriptor_Proc): New typedefs.
(get_file_security, get_security_descriptor_owner)
(get_security_descriptor_group): Set errno to ENOTSUP.
(set_file_security, get_security_descriptor_dacl)
(is_valid_security_descriptor, convert_sd_to_sddl)
(convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
(acl_free, acl_get_file, acl_set_file): New functions.
src/fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
nt/inc/sys/acl.h: New file.
nt/inc/ms-w32.h (ENOTSUP): Define if undefined.
nt/config.nt (HAVE_POSIX_ACL): Define.
doc/lispref/files.texi (File Attributes, Changing Files): Update to include
MS-Windows support for ACLs.
Diffstat (limited to 'nt')
| -rw-r--r-- | nt/ChangeLog | 8 | ||||
| -rw-r--r-- | nt/config.nt | 3 | ||||
| -rw-r--r-- | nt/inc/ms-w32.h | 4 | ||||
| -rw-r--r-- | nt/inc/sys/acl.h | 25 |
4 files changed, 40 insertions, 0 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog index bcd15422bdf..114fa826b2b 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-12-17 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * inc/sys/acl.h: New file. | ||
| 4 | |||
| 5 | * inc/ms-w32.h (ENOTSUP): Define if undefined. | ||
| 6 | |||
| 7 | * config.nt (HAVE_POSIX_ACL): Define. | ||
| 8 | |||
| 1 | 2012-12-15 Eli Zaretskii <eliz@gnu.org> | 9 | 2012-12-15 Eli Zaretskii <eliz@gnu.org> |
| 2 | 10 | ||
| 3 | * inc/ms-w32.h (sys_unlink): Provide prototype. | 11 | * inc/ms-w32.h (sys_unlink): Provide prototype. |
diff --git a/nt/config.nt b/nt/config.nt index db26bf6cbae..aef92a8cccd 100644 --- a/nt/config.nt +++ b/nt/config.nt | |||
| @@ -725,6 +725,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 725 | /* Define to 1 if you have the <png.h> header file. */ | 725 | /* Define to 1 if you have the <png.h> header file. */ |
| 726 | #undef HAVE_PNG_H | 726 | #undef HAVE_PNG_H |
| 727 | 727 | ||
| 728 | /* Define to 1 if you have the POSIX ACL support. */ | ||
| 729 | #define HAVE_POSIX_ACL 1 | ||
| 730 | |||
| 728 | /* Define to 1 if you have the `posix_memalign' function. */ | 731 | /* Define to 1 if you have the `posix_memalign' function. */ |
| 729 | #undef HAVE_POSIX_MEMALIGN | 732 | #undef HAVE_POSIX_MEMALIGN |
| 730 | 733 | ||
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index aab30391063..78e1d544cde 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h | |||
| @@ -293,6 +293,10 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); | |||
| 293 | #define NSIG 23 | 293 | #define NSIG 23 |
| 294 | #endif | 294 | #endif |
| 295 | 295 | ||
| 296 | #ifndef ENOTSUP | ||
| 297 | #define ENOTSUP ENOSYS | ||
| 298 | #endif | ||
| 299 | |||
| 296 | #ifdef _MSC_VER | 300 | #ifdef _MSC_VER |
| 297 | typedef int sigset_t; | 301 | typedef int sigset_t; |
| 298 | typedef int ssize_t; | 302 | typedef int ssize_t; |
diff --git a/nt/inc/sys/acl.h b/nt/inc/sys/acl.h new file mode 100644 index 00000000000..3133e3bfc09 --- /dev/null +++ b/nt/inc/sys/acl.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* Emulation of Posix ACLs for Windows. */ | ||
| 2 | |||
| 3 | #ifndef ACL_H | ||
| 4 | #define ACL_H | ||
| 5 | |||
| 6 | #define NOMINMAX 1 /* don't define min and max */ | ||
| 7 | #include <windows.h> | ||
| 8 | |||
| 9 | typedef PSECURITY_DESCRIPTOR acl_t; | ||
| 10 | typedef unsigned acl_type_t; | ||
| 11 | |||
| 12 | /* Values of acl_type_t */ | ||
| 13 | #define ACL_TYPE_ACCESS 0 | ||
| 14 | #define ACL_TYPE_DEFAULT 1 | ||
| 15 | |||
| 16 | typedef unsigned acl_perm_t; | ||
| 17 | |||
| 18 | extern int acl_valid (acl_t); | ||
| 19 | extern acl_t acl_get_file (const char *, acl_type_t); | ||
| 20 | extern int acl_set_file (const char *, acl_type_t, acl_t); | ||
| 21 | extern char * acl_to_text (acl_t, ssize_t *); | ||
| 22 | extern acl_t acl_from_text (const char *); | ||
| 23 | extern int acl_free (void *); | ||
| 24 | |||
| 25 | #endif /* ACL_H */ | ||