summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.c
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2014-06-21 13:15:44 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-06-21 13:15:44 (GMT)
commiteb85a612a3321c57efbd672f8b11bfefbc659876 (patch)
tree6ac50ffdffff6926da7e4412559970dba823f376 /lib/utils_base.c
parent8a932865eb6082a66d2ceb73354bd6bb5a2b90ab (diff)
downloadmonitoring-plugins-eb85a612a3321c57efbd672f8b11bfefbc659876.tar.gz
Add UID to state retention file path
Add the UID of the invoking user to the state retention file path. This helps solving permission issues when different users run the same plugin.
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r--lib/utils_base.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c
index 04c4b4f..55d35fd 100644
--- a/lib/utils_base.c
+++ b/lib/utils_base.c
@@ -489,7 +489,9 @@ void np_enable_state(char *keyname, int expected_data_version) {
489 this_state->state_data=NULL; 489 this_state->state_data=NULL;
490 490
491 /* Calculate filename */ 491 /* Calculate filename */
492 asprintf(&temp_filename, "%s/%s/%s", _np_state_calculate_location_prefix(), this_monitoring_plugin->plugin_name, this_state->name); 492 asprintf(&temp_filename, "%s/%lu/%s/%s",
493 _np_state_calculate_location_prefix(), (unsigned long)geteuid(),
494 this_monitoring_plugin->plugin_name, this_state->name);
493 this_state->_filename=temp_filename; 495 this_state->_filename=temp_filename;
494 496
495 this_monitoring_plugin->state = this_state; 497 this_monitoring_plugin->state = this_state;