summarylogtreecommitdiffstats
path: root/001-fix-default-permissions.patch
blob: bf0337a087e9140d12fac22a3c1e549b86590488 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a14e409..813d493 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -334,9 +334,9 @@ if(WITH_SYSTEMD)
         FILES_MATCHING PATTERN "*.service")
 endif()
 
-INSTALL_YANG("ietf-netconf-notifications" "" "666")
-INSTALL_YANG("nc-notifications" "" "666")
-INSTALL_YANG("notifications" "" "666")
+INSTALL_YANG("ietf-netconf-notifications" "" "644")
+INSTALL_YANG("nc-notifications" "" "644")
+INSTALL_YANG("notifications" "" "644")
 
 # uninstall
 add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_MODULE_PATH}/uninstall.cmake")
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index e5916ca..3fd031f 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -41,7 +41,7 @@ target_link_libraries(event_notif_sub_tree_example sysrepo)
 
 macro(INSTALL_EXAMPLE_YANG MODULE_NAME REVISION)
     # install the YANG module
-    set(CMD "${CALL_SYSREPOCTL_BIN} --install --yang=${CMAKE_CURRENT_SOURCE_DIR}/yang/${MODULE_NAME}${REVISION}.yang --permissions=666")
+    set(CMD "${CALL_SYSREPOCTL_BIN} --install --yang=${CMAKE_CURRENT_SOURCE_DIR}/yang/${MODULE_NAME}${REVISION}.yang --permissions=644")
     if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/yang/${MODULE_NAME}.data.xml)
         # import data into module
         set(CMD "${CMD}\; ${CALL_SYSREPOCFG_BIN} --import=${CMAKE_CURRENT_SOURCE_DIR}/yang/${MODULE_NAME}.data.xml --datastore=startup --format=xml --level=0 ${MODULE_NAME}")
diff --git a/src/executables/sysrepocfg.c b/src/executables/sysrepocfg.c
index e2951c6..0aa9578 100644
--- a/src/executables/sysrepocfg.c
+++ b/src/executables/sysrepocfg.c
@@ -1326,7 +1326,7 @@ srcfg_export_operation(md_module_t *module, const char *filepath, LYD_FORMAT for
 
     /* try to open/create the output file if needed */
     if (filepath) {
-        fd_out = open(filepath, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+        fd_out = open(filepath, O_WRONLY | O_CREAT | O_TRUNC, 0644);
         CHECK_NOT_MINUS1_LOG_GOTO(fd_out, rc, SR_ERR_INTERNAL, fail,
                                   "Unable to open the output file '%s': %s.", filepath, sr_strerror_safe(errno));
     }
@@ -1374,7 +1374,7 @@ srcfg_export_xpath_operation(md_module_t *module, const char *filepath, const ch
 
     /* try to open/create the output file if needed */
     if (filepath) {
-        fd_out = open(filepath, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+        fd_out = open(filepath, O_WRONLY | O_CREAT | O_TRUNC, 0644);
         CHECK_NOT_MINUS1_LOG_GOTO(fd_out, rc, SR_ERR_INTERNAL, fail,
                                   "Unable to open the output file '%s': %s.", filepath, sr_strerror_safe(errno));
     }
diff --git a/src/executables/sysrepoctl.c b/src/executables/sysrepoctl.c
index 457cdfe..6796c45 100644
--- a/src/executables/sysrepoctl.c
+++ b/src/executables/sysrepoctl.c
@@ -296,7 +296,7 @@ srctl_file_create(const char *path, void *arg)
     (void)arg;
     mode_t old_umask = 0;
     old_umask = umask(0);
-    int fd = open(path, O_WRONLY | O_CREAT, 0666);
+    int fd = open(path, O_WRONLY | O_CREAT, 0644);
     umask(old_umask);
     return fd == -1 ? -1 : close(fd);
 }