]> git.ipfire.org Git - pakfire.git/commitdiff
buildservice: Fetch keytab setting from config
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 Oct 2023 09:56:00 +0000 (09:56 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 Oct 2023 09:56:00 +0000 (09:56 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/buildservice.c

index 1f4d146fbb667e15a6adbf426b9cff7ebde7afc7..28753256b55e99e569b45220ef6d14f0ebbc08d0 100644 (file)
 #include <pakfire/private.h>
 #include <pakfire/string.h>
 
+#define DEFAULT_KEYTAB "/etc/krb5.keytab"
+
 struct pakfire_buildservice {
        struct pakfire_ctx* ctx;
        int nrefs;
 
        char url[PATH_MAX];
+       char keytab[PATH_MAX];
 };
 
 static int pakfire_buildservice_setup(struct pakfire_buildservice* service) {
        struct pakfire_config* config = NULL;
        const char* url = NULL;
+       const char* keytab = NULL;
        int r;
 
        // Fetch the configuration
@@ -61,6 +65,14 @@ static int pakfire_buildservice_setup(struct pakfire_buildservice* service) {
        if (r)
                goto ERROR;
 
+       // Fetch the keytab
+       keytab = pakfire_config_get(config, "client", "keytab", DEFAULT_KEYTAB);
+
+       // Store the keytab
+       r = pakfire_string_set(service->keytab, keytab);
+       if (r)
+               goto ERROR;
+
 ERROR:
        if (config)
                pakfire_config_unref(config);