Skip to content

Commit 8ddb1bf

Browse files
committedFeb 19, 2025
cmake: win: Set LPAC ACLs required for sandbox support (fixes #3791)
1 parent bfd1110 commit 8ddb1bf

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed
 

‎cmake/cef_macros.cmake.in

+11
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,17 @@ macro(ADD_WINDOWS_MANIFEST manifest_path target extension)
271271
)
272272
endmacro()
273273

274+
# Set LPAC ACLs required for Windows sandbox support.
275+
# See https://github.com/chromiumembedded/cef/issues/3791#issuecomment-2664128961
276+
macro(SET_LPAC_ACLS target)
277+
add_custom_command(
278+
TARGET ${target}
279+
POST_BUILD
280+
COMMAND "icacls" "${CEF_TARGET_OUT_DIR}" "/grant" "*S-1-15-2-2:(OI)(CI)(RX)"
281+
COMMENT "Setting LPAC ACLs..."
282+
)
283+
endmacro()
284+
274285
endif(OS_WINDOWS)
275286

276287

‎tests/cefclient/CMakeLists.txt.in

+5
Original file line numberDiff line numberDiff line change
@@ -317,4 +317,9 @@ if(OS_WINDOWS)
317317
# Copy CEF binary and resource files to the target output directory.
318318
COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")
319319
COPY_FILES("${CEF_TARGET}" "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${CEF_TARGET_OUT_DIR}")
320+
321+
if(USE_SANDBOX)
322+
# Set LPAC ACLs required for Windows sandbox support.
323+
SET_LPAC_ACLS("${CEF_TARGET}")
324+
endif()
320325
endif()

‎tests/cefsimple/CMakeLists.txt.in

+5
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,9 @@ if(OS_WINDOWS)
212212
# Copy binary and resource files to the target output directory.
213213
COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")
214214
COPY_FILES("${CEF_TARGET}" "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${CEF_TARGET_OUT_DIR}")
215+
216+
if(USE_SANDBOX)
217+
# Set LPAC ACLs required for Windows sandbox support.
218+
SET_LPAC_ACLS("${CEF_TARGET}")
219+
endif()
215220
endif()

‎tests/ceftests/CMakeLists.txt.in

+5
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,9 @@ if(OS_WINDOWS)
260260
"resources/"
261261
)
262262
COPY_RESOURCES("${CEF_TARGET}" "${UNITTESTS_DATA_RESOURCES_SRCS}" "${PREFIXES}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_TARGET_OUT_DIR}/ceftests_files")
263+
264+
if(USE_SANDBOX)
265+
# Set LPAC ACLs required for Windows sandbox support.
266+
SET_LPAC_ACLS("${CEF_TARGET}")
267+
endif()
263268
endif()

0 commit comments

Comments
 (0)
Please sign in to comment.