( talisker | 2010. 05. 11., k – 11:39 )

Remek, hogy mindenki qrva okos ... ;)


------------
misc.c

/*
* Run execve() inside a fork(). Designed to replicate the semantics of system() but
* in a safer way that doesn't require the invocation of a shell or the risks
* assocated with formatting and parsing a command line.
*/
int
openvpn_execve (const struct argv *a, const struct env_set *es, const unsigned int flags)
{
...
------------
tun.c

...
if ((ctl_fd = socket (AF_INET, SOCK_DGRAM, 0)) >= 0)
{
CLEAR (netifr);
strncpynt (netifr.ifr_name, ifr.ifr_name, IFNAMSIZ);
netifr.ifr_qlen = tt->options.txqueuelen;
if (ioctl (ctl_fd, SIOCSIFTXQLEN, (void *) &netifr) >= 0)
msg (D_OSBUF, "TUN/TAP TX queue length set to %d", tt->options.txqueuelen);
else
msg (M_WARN | M_ERRNO, "Note: Cannot set tx queue length on %s", ifr.ifr_name);
close (ctl_fd);
}
else
{
msg (M_WARN | M_ERRNO, "Note: Cannot open control socket on %s", ifr.ifr_name);
}
...

Szóval kismillió helyen használja az ioctl-t egyébként.
Bizonyára annak is jó oka van, hogy execve-t használ a rendszerhíváshoz.

De azért mégsem olyan gagyi, mint amilyennek beállítod.

"Az, hogy szerinted mindegy hogy ifconfigot execve()-zik egy program, az a szakmai véleményed teljes devalválódásához vezet."
Mester, nyilatkoztasd ki a nagy igazságot, hogy szerinted hogy kellene e helyett?
Kérlek alacsonyodj le földi halandókhoz és lécci ne azon aggódj, devalválódik a szakmai véleményem.
---------------------------------------------------
Talisker Single Malt Scotch Whisky aged 10 years :)