tools: Cleanup deprecated symbolic file permissions
authorBrian Gix <brian.gix@intel.com>
Tue, 23 Feb 2021 18:51:20 +0000 (10:51 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:34 +0000 (19:08 +0530)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
tools/btsnoop.c
tools/create-image.c
tools/hcidump.c
tools/rctest.c

index bb10916..599b13f 100644 (file)
@@ -60,8 +60,7 @@ static int create_btsnoop(const char *path)
        ssize_t written;
        int fd;
 
-       fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC,
-                               S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+       fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
        if (fd < 0) {
                perror("failed to output file");
                return -1;
index 06c2af6..3f0586f 100755 (executable)
@@ -52,8 +52,7 @@
 
 static unsigned int ino_cnt = 721;
 
-#define REG_EXE        S_IFREG | \
-               S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH
+#define REG_EXE        S_IFREG | 0555
 
 static const struct {
        const char *source;
index 6df1b85..c324cce 100644 (file)
@@ -478,7 +478,7 @@ static int open_file(char *file, int mode, unsigned long flags)
        else
                open_flags = O_RDONLY;
 
-       fd = open(file, open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+       fd = open(file, open_flags, 0644);
        if (fd < 0) {
                perror("Can't open dump file");
                exit(1);
index f55a927..b19b156 100755 (executable)
@@ -630,8 +630,7 @@ static void automated_send_recv()
                        do_listen(recv_mode);
                }
 
-               save_fd = open(savefile, O_CREAT | O_WRONLY,
-                                               S_IRUSR | S_IWUSR);
+               save_fd = open(savefile, O_CREAT | O_WRONLY, 0600);
                if (save_fd < 0)
                        syslog(LOG_ERR, "Failed to open file to save data");