[asterisk-dev] [Code Review] 3972: Change DAHDI_UDEV_HOOK_DIR to honor --prefix
Oron Peled
oron.peled at xorcom.com
Wed Sep 3 19:15:24 CDT 2014
Hi,
On Wednesday 03 September 2014 13:57:11 David Lee wrote:
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3972/
> -----------------------------------------------------------
> ...
> I'm a bit wierd, and I configure asterisk with --prefix=/opt/asterisk,
> so that I can install it without running as root. The install script
> for the DAHDI hook scripts were hard coded to install into /usr/share,
> which foils my weirdness.
>
> This patch changes the install location for the DAHDI hook scripts to
> honor --prefix. It also moves the variable in the Makefile so that it
> doesn't get between the _MAKEOPTS variables and the comment describing
> them.
The first problem, is that installing the hook script into an arbitrary
location is useless, since DAHDI will not run it -- DAHDI looks at
very specific directories to run its hooks and that's why the directory
was hard-coded in the first place.
But your scenario has a problem at a deeper level:
* DAHDI runs the hook scripts via udev rules.
* This means they are running as root.
* If it was possible for a regular user to run their own scripts
as root... well you see the implications.
While we could think about "dropping-privileges" while running these scripts:
* It won't solve your problem, because the scripts would still run as
a *specific* user -- not necessarily yourself.
* Also, such a move would make most of these scripts useless as they won't
be able to write configuration into DAHDI drivers (via sysfs) -- which
is the reason for their existence.
So I don't see a way which would achieve what you want -- i.e: install
as a regular user *and* with DAHDI support. OTOH, build+install of
asterisk *without* DAHDI support should not have this problem (otherwise
it's a bug which should be fixed).
Sorry,
--
Oron Peled Voice: +972-4-8228492
oron at actcom.co.il http://users.actcom.co.il/~oron
"There are lies, damned lies, and statistics" -- Benjamin Disraeli
"...and benchmarks" -- Garry Hodgson
More information about the asterisk-dev
mailing list