freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] Kerberos delegation question, and Solaris 10 x86 problems in unittests
- From: "James K. Lowden" <jklowden AT freetds.org>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] Kerberos delegation question, and Solaris 10 x86 problems in unittests
- Date: Wed, 15 Sep 2010 22:17:10 -0400
Peter C. Norton wrote:
>
> I've hacked in some simple support for this with very minor edits to
> gssapi.c, tds.h, and config.c. The support adds a new config option
> to freetds.conf that adds a boolean config option of "enable gssapi
> delegation = <true|false>" by adding a couple of defines in tds.h and an
> additional value to the TDSCONNECTION struct.
>
> So my first question is: Would this minor addition be accepted into
> the mainline freetds by the maintainers?
Hello Peter,
Absolutely. I don't understand the fine points of Kerberos, but I don't
see any downside to the changes you propose.
> The man page for fprintf only specifies that passing in a non-null
> terminated pointer to the *printf calls will result in "unspecified
> behavior"
We should never pass NULL to any form of printf. Yes, some
implementations may handle it gracefully, but it's poor form at the very
least. Your proposed change is fine. I have also used shortcuts such as
fprintf(stderr, "Operating-system error:\n\t%s\n",
oserrstr? oserrstr : "(none)");
> Test #2 ... actually bothers me more because it seems like the
> expected behavior of setting a SIGALARM handler isn't working properly:
Feh. We shouldn't do I/O in a signal handler. It would be hard to
convince me that ct_cancel() can be called in a signal handler, either.
Safely, I mean.
http://www.gnu.org/s/libc/manual/html_node/Nonreentrancy.html#Nonreentrancy
http://publications.gbdirect.co.uk/c_book/chapter9/signal_handling.html
The canonical catch_alrm() /* nice, saving one letter, there, eh?! [1] */
would look more like this:
static volatile unsigned char ftimed_out = 0;
void
catch_alrm(int sig_num)
{
signal(SIGALRM, catch_alrm);
ftimed_out = 1;
}
and the fetch loop (no prize itself) would call ct_cancel() if ftimed_out
is true. Which of course it could do on row 5 without all the signal
handler stuff.
I appreciate your thoroughness and look forward to your patch.
Regards,
--jkl
[1] I think it was Ken Thompson who, when asked if he'd do anything
differently if he had UNIX to do over again said, "I'd spell creat(2) with
its 'e'".
-
[freetds] Kerberos delegation question, and Solaris 10 x86 problems in unittests,
Peter C. Norton, 09/15/2010
-
Re: [freetds] Kerberos delegation question, and Solaris 10 x86 problems in unittests,
James K. Lowden, 09/15/2010
-
Re: [freetds] Kerberos delegation question, and Solaris 10 x86 problems in unittests,
Peter C. Norton, 09/16/2010
- Re: [freetds] Kerberos delegation question, and Solaris 10 x86 problems in unittests, Frediano Ziglio, 09/16/2010
-
Re: [freetds] Kerberos delegation question, and Solaris 10 x86 problems in unittests,
Peter C. Norton, 09/16/2010
- Re: [freetds] Kerberos delegation question, and Solaris 10 x86 problems in unittests, Frediano Ziglio, 09/16/2010
-
Re: [freetds] Kerberos delegation question, and Solaris 10 x86 problems in unittests,
James K. Lowden, 09/15/2010
Archive powered by MHonArc 2.6.24.