From 68fe713335183dd37ced78821711c2a3f1ea2cc7 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Sat, 25 Jan 2014 04:22:09 -0500 Subject: Ignore MP_STATE_DIRECTORY in suid plugins If a plugin still has suid privileges at the time np_enable_state() is called, the MP_STATE_DIRECTORY environment will be ignored. There is no need for a NEWS entry as no suid plugins use np_enable_state yet. --- lib/utils_base.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/utils_base.h') diff --git a/lib/utils_base.h b/lib/utils_base.h index 86adecf8..b4bd92ee 100644 --- a/lib/utils_base.h +++ b/lib/utils_base.h @@ -102,4 +102,8 @@ void np_init(char *, int argc, char **argv); void np_set_args(int argc, char **argv); void np_cleanup(); +/* mp_suid() returns true if the real and effective uids differs, such as when + * running a suid plugin */ +#define mp_suid() (getuid() != geteuid()) + #endif /* _UTILS_BASE_ */ -- cgit v1.2.3-74-g34f1