Commit 905b00d3 authored by David Edmundson's avatar David Edmundson

Remove kwallet4 support

Summary:
Kwallet5 migrates the old wallet and kdelibs4 code can connect to the
kwalletd5 daemon.

I can't envision any situation where a person would need to be compiling
the latest version of this Plasma code without having the KF5 wallet
runtime.

Test Plan: N/A

Reviewers: #plasma, apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D20217
parent b0ac7bbd
......@@ -28,14 +28,8 @@ include_directories (
${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
)
......
......@@ -76,11 +76,7 @@ const static char *kwalletPamDataKey = NULL;
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 @@ static void parseArguments(int argc, const char **argv)
force_run = 1;
}
}
#ifdef KWALLET5
if (kdehome == NULL) {
kdehome = ".local/share";
}
......@@ -118,20 +113,6 @@ static void parseArguments(int argc, const char **argv)
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 @@ static void execute_kwallet(pam_handle_t *pamh, struct passwd *userInfo, int toW
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 @@ static void start_kwallet(pam_handle_t *pamh, struct passwd *userInfo, const cha
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 @@ int kwallet_hash(pam_handle_t *pamh, const char *passphrase, struct passwd *user
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);
......
#!/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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment