From eb85a612a3321c57efbd672f8b11bfefbc659876 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 21 Jun 2014 15:15:44 +0200 Subject: 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. --- lib/utils_base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/utils_base.c') diff --git a/lib/utils_base.c b/lib/utils_base.c index 04c4b4f9..55d35fdd 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) { this_state->state_data=NULL; /* Calculate filename */ - asprintf(&temp_filename, "%s/%s/%s", _np_state_calculate_location_prefix(), this_monitoring_plugin->plugin_name, this_state->name); + asprintf(&temp_filename, "%s/%lu/%s/%s", + _np_state_calculate_location_prefix(), (unsigned long)geteuid(), + this_monitoring_plugin->plugin_name, this_state->name); this_state->_filename=temp_filename; this_monitoring_plugin->state = this_state; -- cgit v1.2.3-74-g34f1