[cups.development] Re: [cups.commit] [CUPS] r5709 - in branches/kerberos: man scheduler

Michael Sweet mike at easysw.com
Sun Jul 9 13:36:44 PDT 2006


cups-dev at easysw.com wrote:
> Author: jelmer
> Date: 2006-07-09 15:39:39 -0400 (Sun, 09 Jul 2006)
> New Revision: 5709
> Log:
> Add 'Krb5Keytab' option. Setting the KRB5_KTNAME environment
> variable seems to be the only way to override the key tab location
> and this is also how other users of the GSSAPI library 
> seem to do it.
> ...
> Modified: branches/kerberos/scheduler/conf.c
> ===================================================================
> --- branches/kerberos/scheduler/conf.c	2006-07-09 15:39:54 UTC (rev 5708)
> +++ branches/kerberos/scheduler/conf.c	2006-07-09 19:39:39 UTC (rev 5709)
> @@ -1762,6 +1762,10 @@
>  		    "using \"Require @%s\" on line %d.",
>  		    value, value, linenum);
>    }
> +  else if (!strcasecmp(line, "Krb5Keytab"))
> +  {
> +     setenv("KRB5_KTNAME", value, 1);
> +  }

The setenv() function is not portable.  putenv() is universally
available and can be used in its place for this, just add:

     VAR char Krb5Keytab[1024];

to conf.h and then use:

     snprintf(Krb5Keytab, sizeof(Krb5Keytab), "KRB5_KTNAME=%s", value);
     putenv(Krb5Keytab);

in conf.c...

If this setting needs to be passed to backends, then you'll also want
to call cupsdSetEnv() to add it to the environment...

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Publishing Software        http://www.easysw.com





More information about the cups-devel mailing list