You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/07/01 18:56:12 UTC

(nuttx) branch master updated: mkstemp: permission 0666 to 0600

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new b08d219849 mkstemp: permission 0666 to 0600
b08d219849 is described below

commit b08d21984908c93f75ffb255e610e83d9cdc0244
Author: buxiasen <bu...@xiaomi.com>
AuthorDate: Mon Jul 1 11:50:28 2024 +0800

    mkstemp: permission 0666 to 0600
    
    https://man7.org/linux/man-pages/man3/mkstemp.3.html
    remove the read/write permission of other users for temp file
    
    Signed-off-by: buxiasen <bu...@xiaomi.com>
---
 libs/libc/stdlib/lib_mkstemp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libs/libc/stdlib/lib_mkstemp.c b/libs/libc/stdlib/lib_mkstemp.c
index b6ef6c5cd0..1c64f2ef74 100644
--- a/libs/libc/stdlib/lib_mkstemp.c
+++ b/libs/libc/stdlib/lib_mkstemp.c
@@ -66,7 +66,7 @@ int mkstemp(FAR char *path_template)
 
   if (path)
     {
-      ret = open(path, O_RDWR | O_CREAT | O_EXCL, 0666);
+      ret = open(path, O_RDWR | O_CREAT | O_EXCL, 0600);
     }
 
   return ret;