ipmitool/fix_file_permissions.patch

36 lines
1.1 KiB
Diff
Raw Normal View History

Index: ipmitool-1.8.17/lib/helper.c
===================================================================
--- ipmitool-1.8.17.orig/lib/helper.c 2016-05-01 10:03:39.000000000 +0200
+++ ipmitool-1.8.17/lib/helper.c 2016-05-03 14:09:39.830095667 +0200
@@ -664,7 +664,6 @@ ipmi_start_daemon(struct ipmi_intf *intf
#endif
chdir("/");
- umask(0);
for (fd=0; fd<64; fd++) {
if (fd != intf->fd)
Index: ipmitool-1.8.17/src/ipmievd.c
===================================================================
--- ipmitool-1.8.17.orig/src/ipmievd.c 2016-05-01 10:03:39.000000000 +0200
+++ ipmitool-1.8.17/src/ipmievd.c 2016-05-03 14:09:39.838096118 +0200
@@ -702,6 +702,7 @@ ipmievd_main(struct ipmi_event_intf * ei
int i, rc;
int daemon = 1;
struct sigaction act;
+ mode_t oldumask;
memset(pidfile, 0, 64);
sprintf(pidfile, "%s%d", DEFAULT_PIDFILE, eintf->intf->devnum);
@@ -764,8 +765,9 @@ ipmievd_main(struct ipmi_event_intf * ei
ipmi_start_daemon(eintf->intf);
- umask(022);
+ oldumask = umask(022);
fp = ipmi_open_file_write(pidfile);
+ umask(oldumask);
if (fp == NULL) {
/* Failed to get fp on PID file -> exit. */
log_halt();