Windows Permissions (#18443)
* wins_perm: Modify original netdata_claim manifest adding external version * wins_perm: Add resources to netdatacli * wins_perm: Add resources to netdata * win_rename: Restore lines removed. They will be removed in another PR. * win_perm: Update manifest
thiagoftsm committed
Sep 3, 2024 at 11:30 UTC
6075275dc413ddd08d1f73ae6d1134ed86ad370b
7 files changed
+53
-4
.gitignore
+1
@@ -179,6 +179,7 @@ Session.*.vim
179
180
# Special exceptions
181
!packaging/repoconfig/Makefile
182
+packaging/windows/resources/*.manifest
183
184
# Jupyter notebook checkpoints
185
.ipynb_checkpoints
CMakeLists.txt
+13
-3
@@ -2241,17 +2241,27 @@ endif()
2241
# build netdata (only Linux ATM)
2242
#
2243
2244
+if(OS_WINDOWS)
2245
+ set(NETDATA_CLAIM_RES_FILES "packaging/windows/resources/netdata_claim.rc")
2246
+ configure_file(packaging/windows/resources/netdata_claim.manifest.in ${CMAKE_SOURCE_DIR}/packaging/windows/resources/netdata_claim.manifest @ONLY)
2247
+
2248
+ set(NETDATACLI_RES_FILES "packaging/windows/resources/netdatacli.rc")
2249
+ configure_file(packaging/windows/resources/netdatacli.manifest.in ${CMAKE_SOURCE_DIR}/packaging/windows/resources/netdatacli.manifest @ONLY)
2250
+
2251
+ set(NETDATA_RES_FILES "packaging/windows/resources/netdata.rc")
2252
+ configure_file(packaging/windows/resources/netdata.manifest.in ${CMAKE_SOURCE_DIR}/packaging/windows/resources/netdata.manifest @ONLY)
2253
+endif()
2254
+
2255
add_executable(netdata
2256
${NETDATA_FILES}
2257
"${ACLK_FILES}"
2258
"$<$<BOOL:${ENABLE_H2O}>:${H2O_FILES}>"
2259
"$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGODB_EXPORTING_FILES}>"
2260
"$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES}>"
2261
+ "$<$<BOOL:${OS_WINDOWS}>:${NETDATA_RES_FILES}>"
2262
)
2263
2264
if(OS_WINDOWS)
2253
- set(NETDATA_CLAIM_RES_FILES "packaging/windows/resources/netdata_claim.rc")
2254
-
2265
add_executable(netdata_claim ${CLAIM_WINDOWS_FILES} ${NETDATA_CLAIM_RES_FILES})
2266
target_link_libraries(netdata_claim shell32;gdi32;msftedit)
2267
endif()
@@ -2353,7 +2363,7 @@ set(NETDATACLI_FILES
2363
src/cli/cli.c
2364
)
2365
2356
-add_executable(netdatacli ${NETDATACLI_FILES})
2366
+add_executable(netdatacli ${NETDATACLI_FILES} "$<$<BOOL:${OS_WINDOWS}>:${NETDATACLI_RES_FILES}>")
2367
target_link_libraries(netdatacli libnetdata)
2368
2369
install(TARGETS netdatacli
packaging/windows/resources/netdata.manifest.in
new
+16
@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3
+ <assemblyIdentity version="@CMAKE_PROJECT_VERSION@"
4
+ processorArchitecture="*"
5
+ name="netdata"
6
+ type="win32"/>
7
+ <description>Netdata is a high-performance, cloud-native, and on-premises observability platform designed to monitor metrics and logs with unparalleled efficiency.</description>
8
+ <!-- Identify the application security requirements. -->
9
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
10
+ <security>
11
+ <requestedPrivileges>
12
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
13
+ </requestedPrivileges>
14
+ </security>
15
+ </trustInfo>
16
+</assembly>
packaging/windows/resources/netdata.rc
new
+3
@@ -0,0 +1,3 @@
1
+#include "winuser.h"
2
+1 RT_MANIFEST "netdata.manifest"
3
+11 ICON "../NetdataWhite.ico"
packaging/windows/resources/netdata_claim.manifest.in
renamed
+1
-1
@@ -1,6 +1,6 @@
1
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3
- <assemblyIdentity version="1.99.0.0"
3
+ <assemblyIdentity version="@CMAKE_PROJECT_VERSION@"
4
processorArchitecture="*"
5
name="netdata_claim"
6
type="win32"/>
packaging/windows/resources/netdatacli.manifest.in
new
+16
@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3
+ <assemblyIdentity version="@CMAKE_PROJECT_VERSION@"
4
+ processorArchitecture="*"
5
+ name="netdatacli"
6
+ type="win32"/>
7
+ <description>The netdatacli executable provides a simple way to control the Netdata agent's operation.</description>
8
+ <!-- Identify the application security requirements. -->
9
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
10
+ <security>
11
+ <requestedPrivileges>
12
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
13
+ </requestedPrivileges>
14
+ </security>
15
+ </trustInfo>
16
+</assembly>
packaging/windows/resources/netdatacli.rc
new
+3
@@ -0,0 +1,3 @@
1
+#include "winuser.h"
2
+1 RT_MANIFEST "netdatacli.manifest"
3
+11 ICON "../NetdataWhite.ico"