git » nmdb » commit eb583f6

Set a decent mode when creating the log file

author Alberto Bertogli
2008-06-01 03:55:52 UTC
committer Alberto Bertogli
2008-06-01 03:55:52 UTC
parent 0b856ce9d403c8fec072e9d23b33c444283f54ea

Set a decent mode when creating the log file

If we don't set the mode at creation time, it can end up with totally
broken permissions.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

nmdb/log.c +2 -1

diff --git a/nmdb/log.c b/nmdb/log.c
index 89d107e..10e223d 100644
--- a/nmdb/log.c
+++ b/nmdb/log.c
@@ -26,7 +26,8 @@ int log_init(void)
 	if (strcmp(settings.logfname, "-") == 0) {
 		logfd = 1;
 	} else {
-		logfd = open(settings.logfname, O_WRONLY | O_APPEND | O_CREAT);
+		logfd = open(settings.logfname, O_WRONLY | O_APPEND | O_CREAT,
+				0660);
 		if (logfd < 0)
 			return 0;
 	}