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 /doc | |
| 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 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 16 |
2 files changed, 17 insertions, 4 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 922147844bd..a0bbafb116f 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-12-17 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * files.texi (File Attributes, Changing Files): Update to include | ||
| 4 | MS-Windows support for ACLs. | ||
| 5 | |||
| 1 | 2012-12-16 Romain Francoise <romain@orebokech.com> | 6 | 2012-12-16 Romain Francoise <romain@orebokech.com> |
| 2 | 7 | ||
| 3 | * files.texi (File Attributes): Document ACL support and new | 8 | * files.texi (File Attributes): Document ACL support and new |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 93bee961929..5440388fe70 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -1357,13 +1357,14 @@ support, then the return value is @code{(nil nil nil nil)}. | |||
| 1357 | If Emacs has been compiled with @dfn{ACL} (access control list) | 1357 | If Emacs has been compiled with @dfn{ACL} (access control list) |
| 1358 | support, you can use the function @code{file-acl} to retrieve a file's | 1358 | support, you can use the function @code{file-acl} to retrieve a file's |
| 1359 | ACL entries. The format is platform-specific; on GNU/Linux and BSD, | 1359 | ACL entries. The format is platform-specific; on GNU/Linux and BSD, |
| 1360 | Emacs uses the POSIX ACL interface. For the function | 1360 | Emacs uses the POSIX ACL interface, while on MS-Windows Emacs emulates |
| 1361 | @code{set-file-acl}, see @ref{Changing Files}. | 1361 | the POSIX ACL interface with native file security APIs. For the |
| 1362 | function @code{set-file-acl}, see @ref{Changing Files}. | ||
| 1362 | 1363 | ||
| 1363 | @defun file-acl filename | 1364 | @defun file-acl filename |
| 1364 | This function returns the ACL entries of the file @var{filename}. | 1365 | This function returns the ACL entries of the file @var{filename}. |
| 1365 | The return value is a string containing the textual representation of | 1366 | The return value is a string containing the textual representation of |
| 1366 | the ACL entries, like the following: | 1367 | the ACL entries. On Posix hosts, it looks like this: |
| 1367 | 1368 | ||
| 1368 | @example | 1369 | @example |
| 1369 | @group | 1370 | @group |
| @@ -1375,6 +1376,12 @@ other::r-- | |||
| 1375 | @end group | 1376 | @end group |
| 1376 | @end example | 1377 | @end example |
| 1377 | 1378 | ||
| 1379 | @cindex security descriptor, file | ||
| 1380 | @cindex SDDL, MS-Windows | ||
| 1381 | On MS-Windows, the return value is a textual description of the file's | ||
| 1382 | @dfn{security descriptor} in @acronym{SDDL}, the @dfn{Security | ||
| 1383 | Descriptor Definition Language}. | ||
| 1384 | |||
| 1378 | If the file does not exist or is inaccessible, or if Emacs was unable to | 1385 | If the file does not exist or is inaccessible, or if Emacs was unable to |
| 1379 | determine the ACL entries, then the return value is @code{nil}. The | 1386 | determine the ACL entries, then the return value is @code{nil}. The |
| 1380 | latter can happen for local files if Emacs was not compiled with ACL | 1387 | latter can happen for local files if Emacs was not compiled with ACL |
| @@ -1719,7 +1726,8 @@ SELinux support. | |||
| 1719 | This function sets the ACL entries of the file @var{filename} to | 1726 | This function sets the ACL entries of the file @var{filename} to |
| 1720 | @var{acl-string}. @xref{File Attributes}, for a brief description of | 1727 | @var{acl-string}. @xref{File Attributes}, for a brief description of |
| 1721 | ACLs. The @var{acl-string} argument should be a string containing the | 1728 | ACLs. The @var{acl-string} argument should be a string containing the |
| 1722 | textual representation of the desired ACL entries. | 1729 | textual representation of the desired ACL entries in the format |
| 1730 | appropriate for the ACL interface being used. | ||
| 1723 | @end defun | 1731 | @end defun |
| 1724 | 1732 | ||
| 1725 | @node File Names | 1733 | @node File Names |