]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
dahdiras: Only set plugin dahdi.so to pppd if we're running as root.
authorJaco Kroon <jaco@uls.co.za>
Wed, 18 Mar 2020 09:21:21 +0000 (11:21 +0200)
committerKevin Harwell <kharwell@digium.com>
Wed, 25 Mar 2020 22:23:54 +0000 (17:23 -0500)
Users of this should set plugin dahdi.so in their options file.

ASTERISK-16676

Change-Id: I6d01ad0a10e9fea477876d0941c3f38aac357e91

apps/app_dahdiras.c

index 28cf6d19b1bbc32e89feda19cc19dfdbb44bf431..87a7fafd3448aef65d0bb8bccf258acb291bdcd7 100644 (file)
@@ -120,8 +120,10 @@ static pid_t spawn_ras(struct ast_channel *chan, char *args)
                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 */