[Asterisk-code-review] dahdiras: Only set plugin dahdi.so to pppd if we're running as root. (asterisk[16])

Kevin Harwell asteriskteam at digium.com
Wed Mar 25 17:24:10 CDT 2020


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13996 )

Change subject: dahdiras: Only set plugin dahdi.so to pppd if we're running as root.
......................................................................

dahdiras: Only set plugin dahdi.so to pppd if we're running as root.

Users of this should set plugin dahdi.so in their options file.

ASTERISK-16676

Change-Id: I6d01ad0a10e9fea477876d0941c3f38aac357e91
---
M apps/app_dahdiras.c
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit
  George Joseph: Looks good to me, but someone else must approve



diff --git a/apps/app_dahdiras.c b/apps/app_dahdiras.c
index dffa2a4..b5b1ae9 100644
--- a/apps/app_dahdiras.c
+++ b/apps/app_dahdiras.c
@@ -113,8 +113,10 @@
 		c = strsep(&stringp, ",");
 	}
 
-	argv[argc++] = "plugin";
-	argv[argc++] = "dahdi.so";
+	if (geteuid() == 0) {
+		argv[argc++] = "plugin";
+		argv[argc++] = "dahdi.so";
+	}
 	argv[argc++] = "stdin";
 
 	/* Finally launch PPP */

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13996
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I6d01ad0a10e9fea477876d0941c3f38aac357e91
Gerrit-Change-Number: 13996
Gerrit-PatchSet: 2
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200325/8b6af321/attachment-0001.html>


More information about the asterisk-code-review mailing list