ipmitool/fix_file_permissions.patch
Thomas Renninger 570b85101b Accepting request 361388 from home:trenn:branches:systemsmanagement
- Update to latest ipmitool source code
  commit 9020b67347f46554009591ae91e4fa8875c65dfa
  Date:   Tue Jan 12 21:16:37 2016 +0500
- Fix memleak: bnc#968105
Add: ipmitool-sol_memleak.patch

OBS-URL: https://build.opensuse.org/request/show/361388
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ipmitool?expand=0&rev=35
2016-02-25 13:26:31 +00:00

36 lines
1.1 KiB
Diff

Index: ipmitool-1.8.16/lib/helper.c
===================================================================
--- ipmitool-1.8.16.orig/lib/helper.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/lib/helper.c 2016-02-25 13:25:40.147488838 +0100
@@ -659,7 +659,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.16/src/ipmievd.c
===================================================================
--- ipmitool-1.8.16.orig/src/ipmievd.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/src/ipmievd.c 2016-02-25 13:25:40.155489280 +0100
@@ -701,6 +701,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);
@@ -763,8 +764,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();