[lxc-devel] [lxc/master] log: fix too wide or inconsistent non-owner permissions

2xsec on Github lxc-bot at linuxcontainers.org
Fri Nov 2 06:25:53 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 346 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181102/f6643f8c/attachment.bin>
-------------- next part --------------
From 9b681921e597541226eb9ecccb4a7d9e3f410879 Mon Sep 17 00:00:00 2001
From: 2xsec <dh48.jeong at samsung.com>
Date: Fri, 2 Nov 2018 15:25:14 +0900
Subject: [PATCH] log: fix too wide or inconsistent non-owner permissions

Signed-off-by: 2xsec <dh48.jeong at samsung.com>
---
 src/lxc/log.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/log.c b/src/lxc/log.c
index 2f1a9385e..998f6517a 100644
--- a/src/lxc/log.c
+++ b/src/lxc/log.c
@@ -488,7 +488,7 @@ static int build_dir(const char *name)
 
 		ret = lxc_unpriv(mkdir(n, 0755));
 		if (ret && errno != EEXIST) {
-			SYSERROR("Failed to create directory %s", n);
+			SYSERROR("Failed to create directory \"%s\"", n);
 			free(n);
 			return -1;
 		}
@@ -506,7 +506,7 @@ static int log_open(const char *name)
 	int fd;
 	int newfd;
 
-	fd = lxc_unpriv(open(name, O_CREAT | O_WRONLY | O_APPEND | O_CLOEXEC, 0666));
+	fd = lxc_unpriv(open(name, O_CREAT | O_WRONLY | O_APPEND | O_CLOEXEC, 0660));
 	if (fd < 0) {
 		SYSERROR("Failed to open log file \"%s\"", name);
 		return -1;


More information about the lxc-devel mailing list