diff common/util.h @ 1208:0a803c3fb5a6

(issue138) Set the ACL explictly on existing files or directories
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 23 Sep 2014 19:15:49 +0200
parents fd85a02d771d
children 8362e30f7b55
line wrap: on
line diff
--- a/common/util.h	Tue Sep 23 17:05:17 2014 +0200
+++ b/common/util.h	Tue Sep 23 19:15:49 2014 +0200
@@ -124,8 +124,9 @@
   * in that directory.
   * Basically a very complicated version of mkdir path -m 644
   *
-  * If the directory exists the permissions of that directory are checked if
-  * they are acceptable and true or false is returned accordingly.
+  * If the directory exists and propagate_acl is set the permissions
+  * of that directory are overwritten with the DACL that would have
+  * been used to create the directory.
   *
   * Code based on msdn example:
   * http://msdn.microsoft.com/en-us/library/windows/desktop/aa446595%28v=vs.85%29.aspx
@@ -133,12 +134,15 @@
   * @param[in] path Path of the directory to create
   * @param[in] propagate_acl weather or not objects should inherit
   * the ACL of this directory.
+  * @param[out] rACL optional pointer to an PACL pointer that should be
+  * the returned value. If rACL is not NULL the caller needs to free the
+  * returned pointer with LocalFree.
   *
   * @returns true on success of if the directory exists, false on error
   */
-bool create_restricted_directory (LPWSTR path, bool propagate_acl);
+bool create_restricted_directory (LPWSTR path, bool propagate_acl, PACL *rACL);
 
-/**@briefu Check the integrity level of the token
+/**@brief Check the integrity level of the token
   *
   * Returns true if the token has at least SECURITY_MANADTORY_HIGH_RID or
   * higher.

http://wald.intevation.org/projects/trustbridge/