diff -ruNabi ntfs-3g_ntfsprogs-2012.1.15/libntfs-3g/acls.c /Users/mklatt/ntfs-3g_ntfsprogs-2012.1.15/libntfs-3g/acls.c
old
|
new
|
|
2037 | 2037 | } |
2038 | 2038 | |
2039 | 2039 | /* |
2040 | | * for directories, insert a world execution denial |
2041 | | * inherited to plain files. |
2042 | | * This is to prevent Windows from granting execution |
2043 | | * of files through inheritance from parent directory |
2044 | | */ |
2045 | | |
2046 | | if (isdir && ok) { |
2047 | | pos = le16_to_cpu(pacl->size); |
2048 | | pdace = (ACCESS_DENIED_ACE*) &secattr[offs + pos]; |
2049 | | pdace->type = ACCESS_DENIED_ACE_TYPE; |
2050 | | pdace->flags = INHERIT_ONLY_ACE | OBJECT_INHERIT_ACE; |
2051 | | pdace->size = cpu_to_le16(wsidsz + 8); |
2052 | | pdace->mask = FILE_EXEC; |
2053 | | memcpy((char*)&pdace->sid, worldsid, wsidsz); |
2054 | | pos += wsidsz + 8; |
2055 | | acecnt = le16_to_cpu(pacl->ace_count) + 1; |
2056 | | pacl->ace_count = cpu_to_le16(acecnt); |
2057 | | pacl->size = cpu_to_le16(pos); |
2058 | | } |
2059 | | |
2060 | | /* |
2061 | 2040 | * now insert (if needed) |
2062 | 2041 | * - grants to owner and designated users |
2063 | 2042 | * - mask and denials for all groups |
… |
… |
|
2318 | 2297 | acecnt++; |
2319 | 2298 | } |
2320 | 2299 | } |
2321 | | /* |
2322 | | * for directories, a world execution denial |
2323 | | * inherited to plain files |
2324 | | */ |
2325 | | |
2326 | | if (isdir) { |
2327 | | pdace = (ACCESS_DENIED_ACE*) &secattr[offs + pos]; |
2328 | | pdace->type = ACCESS_DENIED_ACE_TYPE; |
2329 | | pdace->flags = INHERIT_ONLY_ACE | OBJECT_INHERIT_ACE; |
2330 | | pdace->size = cpu_to_le16(wsidsz + 8); |
2331 | | pdace->mask = FILE_EXEC; |
2332 | | memcpy((char*)&pdace->sid, worldsid, wsidsz); |
2333 | | pos += wsidsz + 8; |
2334 | | acecnt++; |
2335 | | } |
2336 | | |
2337 | | |
2338 | 2300 | /* now insert grants to owner */ |
2339 | 2301 | pgace = (ACCESS_ALLOWED_ACE*) &secattr[offs + pos]; |
2340 | 2302 | pgace->type = ACCESS_ALLOWED_ACE_TYPE; |