Mercurial > trustbridge
comparison 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 |
comparison
equal
deleted
inserted
replaced
1207:e79fc57f1f9c | 1208:0a803c3fb5a6 |
---|---|
122 * This creates a security attributes structure that restricts | 122 * This creates a security attributes structure that restricts |
123 * write access to the Administrators group but allows everyone to read files | 123 * write access to the Administrators group but allows everyone to read files |
124 * in that directory. | 124 * in that directory. |
125 * Basically a very complicated version of mkdir path -m 644 | 125 * Basically a very complicated version of mkdir path -m 644 |
126 * | 126 * |
127 * If the directory exists the permissions of that directory are checked if | 127 * If the directory exists and propagate_acl is set the permissions |
128 * they are acceptable and true or false is returned accordingly. | 128 * of that directory are overwritten with the DACL that would have |
129 * been used to create the directory. | |
129 * | 130 * |
130 * Code based on msdn example: | 131 * Code based on msdn example: |
131 * http://msdn.microsoft.com/en-us/library/windows/desktop/aa446595%28v=vs.85%29.aspx | 132 * http://msdn.microsoft.com/en-us/library/windows/desktop/aa446595%28v=vs.85%29.aspx |
132 * | 133 * |
133 * @param[in] path Path of the directory to create | 134 * @param[in] path Path of the directory to create |
134 * @param[in] propagate_acl weather or not objects should inherit | 135 * @param[in] propagate_acl weather or not objects should inherit |
135 * the ACL of this directory. | 136 * the ACL of this directory. |
137 * @param[out] rACL optional pointer to an PACL pointer that should be | |
138 * the returned value. If rACL is not NULL the caller needs to free the | |
139 * returned pointer with LocalFree. | |
136 * | 140 * |
137 * @returns true on success of if the directory exists, false on error | 141 * @returns true on success of if the directory exists, false on error |
138 */ | 142 */ |
139 bool create_restricted_directory (LPWSTR path, bool propagate_acl); | 143 bool create_restricted_directory (LPWSTR path, bool propagate_acl, PACL *rACL); |
140 | 144 |
141 /**@briefu Check the integrity level of the token | 145 /**@brief Check the integrity level of the token |
142 * | 146 * |
143 * Returns true if the token has at least SECURITY_MANADTORY_HIGH_RID or | 147 * Returns true if the token has at least SECURITY_MANADTORY_HIGH_RID or |
144 * higher. | 148 * higher. |
145 * | 149 * |
146 * @param[in] hToken the Token to check | 150 * @param[in] hToken the Token to check |