[sr-dev] git:master:3b5633de: ctl: use uid/gid from the core if not set for the module

Daniel-Constantin Mierla miconda at gmail.com
Wed Mar 11 09:43:22 CET 2015


Module: kamailio
Branch: master
Commit: 3b5633de56c2367d19122f0f3c01698af34a21e9
URL: https://github.com/kamailio/kamailio/commit/3b5633de56c2367d19122f0f3c01698af34a21e9

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-03-11T09:42:02+01:00

ctl: use uid/gid from the core if not set for the module

- otherwise it cannot do clean created files at shut down

---

Modified: modules/ctl/ctl.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3b5633de56c2367d19122f0f3c01698af34a21e9.diff
Patch: https://github.com/kamailio/kamailio/commit/3b5633de56c2367d19122f0f3c01698af34a21e9.patch

---

diff --git a/modules/ctl/ctl.c b/modules/ctl/ctl.c
index 2a05435..f630f8a 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){




More information about the sr-dev mailing list