// URL
char url[PATH_MAX];
+ // Kerberos Keytab
+ char keytab[PATH_MAX];
+
// Event Loop
sd_event* loop;
krb5_keytab keytab = NULL;
krb5_creds creds = {};
const char* error = NULL;
- const char* path = NULL;
char time[128];
char* p = NULL;
int r;
DEBUG(daemon->ctx, "Authenticating...\n");
- // XXX We should read this from the configuration
- path = KRB5_DEFAULT_KEYTAB;
-
// Resolve the keytab
- r = krb5_kt_resolve(daemon->krb5.ctx, path, &keytab);
+ r = krb5_kt_resolve(daemon->krb5.ctx, daemon->keytab, &keytab);
if (r) {
error = krb5_get_error_message(daemon->krb5.ctx, r);
static int pakfire_daemon_configure(struct pakfire_daemon* daemon) {
struct pakfire_config* config = NULL;
+ const char* keytab = NULL;
const char* url = NULL;
int r;
if (r < 0)
goto ERROR;
+ // Fetch the keytab
+ keytab = pakfire_config_get(config, "daemon", "keytab", KRB5_DEFAULT_KEYTAB);
+
+ // Store the keytab
+ r = pakfire_string_set(daemon->keytab, keytab);
+ if (r < 0)
+ goto ERROR;
+
ERROR:
if (config)
pakfire_config_unref(config);