[tac_plus] Re: Patch for tac_plus to fix the -G option

Nathan Schrenk nschrenk at depthfirst.net
Mon Jun 16 17:04:42 UTC 2008


On Mon, Jun 16, 2008 at 9:51 AM, Kiss Gabor (Bitman)
<kissg at ssg.ki.iif.hu> wrote:
> Dear Nathan,
>
>> Attached is a patch against version F4.0.4.15 of the tacacs+ package
>> that fixes support for the -G command-line option.  My understanding
>> of -G is that it is supposed to keep tac_plus running in the
>> foreground: no forking, no detaching from the tty, etc.  The code in
>> the F4.0.4.15 distribution does not do this: it forks and detaches.
>
> Eeerrrr... tac_plus(8) writes:
>
>    -g     Single threaded mode.  The daemon will only accept and service a
>           single connection at a time without forking and without closing
>           file descriptors.  All log messages appear on standard output.
>
>    -G     Remain in the foreground, but not single-threaded nor logging to
>           the tty.
>
> So as far as I can understand -G never promised to log on tty.
> Maybe you wanted to use -g.
>
> How did you figure out if it "detached" from control terminal or not?
> Did process accept SIGINT (^C) from keyboard or not?

-G might not have promised to keep logging to the tty, but it
certainly is not remaining in the foreground as implemented in version
4.0.4.15 of the code.  Try it yourself -- running "tac_plus -G" from
an interactive shell will fork into the background and control will
return to the shell immediately.  Without -G tac_plus fork()s twice,
and with -G it still forks once and the parent process exits.  Maybe
my patch isn't correct, because it skips closing tty, but I think the
part of my patch that avoids the second fork when -G is specified is
correct.

Nathan


More information about the tac_plus mailing list