Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 2001 13:46:32 +0100 (CET)
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        mpasini@club-internet.fr
Cc:        freebsd-isdn@FreeBSD.ORG
Subject:   Re: Software for start a "ifconfig isp0 up" on the server
Message-ID:  <200102131246.f1DCkYu03854@Magelan.Leidinger.net>
In-Reply-To: <20010213114454.A470@earth.domtek.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On 13 Feb, Matthieu Pasini wrote:
> Hi all,
> I would like to let all my family to be able connect to the Internet with my server running FreeBSD and I4B( it's running well).
> Well, all the family is using computers under Win98 and i don't want to leave the "auto-connection" on on my server ...
> So i just wanna know if something has already made a soft which run a "ifconfig isp0 up" on the server, or if there is another solution.
> I thought about a web solution but i have problems with permissions on ifconfig ;(

---snip---
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
   if(setreuid(0, 0) == -1)
   {
      perror("setreuid");
      exit(1);
   }

   return system("/sbin/ifconfig isp0 up");
};
/* *** EOF *** */
---snip---

Don't use any user supplied data for the system(3) call (everything will
be interpreted by /bin/sh)!

Just make the executable SUID root to be able to let everyone (with
access to the executable) issue an "ifconfig isp0 up". Don't forget to
protect your internal webserver from access from the outside.

Bye,
Alexander.

-- 
            Give a man a fish and you feed him for a day;
     teach him to use the Net and he won't bother you for weeks.

http://www.Leidinger.net                       Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isdn" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102131246.f1DCkYu03854>