From 3b5633de56c2367d19122f0f3c01698af34a21e9 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Wed, 11 Mar 2015 09:42:02 +0100 Subject: [PATCH] ctl: use uid/gid from the core if not set for the module - otherwise it cannot do clean created files at shut down --- modules/ctl/ctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/ctl/ctl.c b/modules/ctl/ctl.c index 2a05435c8d1..f630f8a67c8 100644 --- a/modules/ctl/ctl.c +++ b/modules/ctl/ctl.c @@ -264,6 +264,9 @@ static int mod_init(void) goto error; } } + /* get the uid/gid from core if not set for the module */ + if(usock_uid==-1 && sock_uid!=-1) usock_uid = sock_uid; + if(usock_gid==-1 && sock_gid!=-1) usock_gid = sock_gid; /* open socket now, before suid */ if (init_ctrl_sockets(&ctrl_sock_lst, listen_lst, DEFAULT_CTL_PORT, usock_mode, usock_uid, usock_gid)<0){