[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: User invocation of pppd (Re: diald & pppd trouble query)



>> I'm hopeful that I can get diald working, it seems to offer great
>> convenience: I won't have to login and out as root to fire up a
>> connection. 
>I posted a related question - on how to let users fire up the ppp
>connection - a while ago, but never got around to summarising the
>result. Sorry, here it is:

[ saga deleted ]

>Ian Jackson <ian@chiark.chu.cam.ac.uk> pointed out that my permissions will
>get messed up again if I update the ppp package, and said it would be
>better for me to leave the permissions unchanged, and instead put a suid
>root C-wrapper in /usr/local/bin. Thanks. (Suid shell scripts don't work.)
>I guess this must be easy to do, but I haven't tracked down that C textbook
>I never did finish reading, so I'm just living with this problem for
>now. However I think that under this approach the ownership and permissions
>on /etc/ppp/ppp-connect will still have to be fixed up.

Well, it just so happens that I've done the same thing here.  I've
been playing around with packagizing it, but just haven't gotten
around to it yet.  Here's the basic idea:

/*
 * ppp-on.c
 *
 * $Id: ppp-on.c,v 1.1.1.1 1995/11/21 05:25:23 joelh Exp $
 *
 */

#include <stdio.h>
#include <unistd.h>

void main(void)
{
  execl("/usr/sbin/start-stop-daemon","/usr/sbin/start-stop-daemon",
	"--start",
	"--verbose",
	"--exec","/usr/sbin/pppd","--","/dev/modem","38400",
	NULL);
  perror("ppp-on");
}

ppp-off is very, very similar.  Note: do *NOT* remove the absolute
paths (/usr/sbin).  This will introduce a security hole.  That's why
I'm using execl instead of execlp.  I know, it makes it non-portable,
and that'll be fixed up before packaging and release.

-- 
http://www.wp.com/joelh --- Joel Ray Holveck --- joelh@gnu.ai.mit.edu

Fourth law of computing:
  Anything that can go wro
.signature: segmentation violation -- core dumped


Reply to: