diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,14 +28,8 @@ ${LIBGCRYPT_INCLUDE_DIR} ) -add_definitions(-DKWALLET5) set(library_name "pam_kwallet5") -if ("${KWALLET4}" STREQUAL "1") - remove_definitions(-DKWALLET5) - set(library_name "pam_kwallet") -endif() - set(pam_kwallet_SRCS pam_kwallet.c ) diff --git a/pam_kwallet.c b/pam_kwallet.c --- a/pam_kwallet.c +++ b/pam_kwallet.c @@ -76,11 +76,7 @@ const static char *logPrefix = NULL; static int force_run = 0; -#ifdef KWALLET5 const static char *envVar = "PAM_KWALLET5_LOGIN"; -#else -const static char *envVar = "PAM_KWALLET_LOGIN"; -#endif static int argumentsParsed = -1; @@ -105,7 +101,6 @@ force_run = 1; } } -#ifdef KWALLET5 if (kdehome == NULL) { kdehome = ".local/share"; } @@ -118,20 +113,6 @@ if (logPrefix == NULL) { logPrefix = "pam_kwallet5"; } -#else - if (kdehome == NULL) { - kdehome = ".kde"; - } - if (kwalletd == NULL) { - kwalletd = "/usr/bin/kwalletd"; - } - if (kwalletPamDataKey == NULL) { - kwalletPamDataKey = "kwallet_key"; - } - if (logPrefix == NULL) { - logPrefix = "pam_kwallet"; - } -#endif } static const char* get_env(pam_handle_t *ph, const char *name) @@ -452,12 +433,7 @@ char sockIn[4]; sprintf(sockIn, "%d", envSocket); -#ifdef KWALLET5 - char* extraArg = NULL; -#else - char* extraArg = "--nofork"; -#endif - char *args[] = {strdup(kwalletd), "--pam-login", pipeInt, sockIn, extraArg, NULL}; + char *args[] = {strdup(kwalletd), "--pam-login", pipeInt, sockIn, NULL, NULL}; execve(args[0], args, pam_getenvlist(pamh)); syslog(LOG_ERR, "%s: could not execute kwalletd from %s", logPrefix, kwalletd); @@ -495,11 +471,7 @@ pam_syslog(pamh, LOG_ERR, "%s: Couldn't create pipes", logPrefix); } -#ifdef KWALLET5 const char *socketPrefix = "kwallet5"; -#else - const char *socketPrefix = "kwallet"; -#endif char *fullSocket = NULL; if (socketPath) { @@ -814,11 +786,7 @@ return 1; } -#ifdef KWALLET5 const char *fixpath = "kwalletd/kdewallet.salt"; -#else - const char *fixpath = "share/apps/kwallet/kdewallet.salt"; -#endif size_t pathSize = strlen(userInfo->pw_dir) + strlen(kdehome) + strlen(fixpath) + 3;//3 == /, / and \0 char *path = (char*) malloc(pathSize); sprintf(path, "%s/%s/%s", userInfo->pw_dir, kdehome, fixpath); diff --git a/pam_kwallet_init b/pam_kwallet_init --- a/pam_kwallet_init +++ b/pam_kwallet_init @@ -1,9 +1,5 @@ #!/bin/sh -if test -n "$PAM_KWALLET_LOGIN" ; then - env | socat STDIN UNIX-CONNECT:$PAM_KWALLET_LOGIN -fi - if test -n "$PAM_KWALLET5_LOGIN" ; then env | socat STDIN UNIX-CONNECT:$PAM_KWALLET5_LOGIN fi