From 3d05715415d6be820243746e3de00eea95b94b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=C3=A4tzold?= Date: Sun, 29 Mar 2026 13:29:31 +0200 Subject: [PATCH] KWallet: No Migration of old Wallet, instead use predefined ones --- client_software/0010_kwallet/install.sh | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/client_software/0010_kwallet/install.sh b/client_software/0010_kwallet/install.sh index 888d361..a328fcf 100755 --- a/client_software/0010_kwallet/install.sh +++ b/client_software/0010_kwallet/install.sh @@ -35,9 +35,6 @@ WALLETFILE="${WALLETNAME}.kwl" WALLETPATH="${DECRYPTEDDATADIR}/kwallet" WALLETPATH_CFG="$SUDO_HOME/.local/share/kwalletd" -# At the start of this script, the local wallet-directory should be empty and the encrpted directory should be mount to that path -# if thats not the case, will will move the files an configure them - # Stop the daemon anyway if running WALLET_PID=$( pgrep -u $USER kwalletd6 ) if [[ ! -z ${WALLET_PID} ]]; then @@ -50,23 +47,19 @@ fi #Setup encrypted path if not existing already mkdir -p ${WALLETPATH} +#Check, if wallet ist already setup in encryted dir. If not, copy our empty deafult wallets to it +if [ -f "${WALLETPATH}/${WALLETNAME}.kwl" ]; then + cp ${WALLETNAME}*.* ${WALLETPATH} +fi chown $SUDO_USER:$SUDO_USER ${WALLETPATH} -R chmod u=rwX,og-rwx ${WALLETPATH} -R -#Check for existing legacy wallets: should be empty. Otherwise: move them. +#Unmount to have free vision to Directory umount ${WALLETPATH_CFG} >/dev/null 2>&1 -PATTERN=(${WALLETPATH_CFG}/*.kwl) -if [ -f ${PATTERN[0]} ]; then - echo "Moving to ${WALLETPATH}, Files: ${PATTERN}" - mv ${WALLETPATH_CFG}/*.* ${WALLETPATH} - if [[ $? -ne 0 ]]; then - echo "Legacy wallets could not be moved, please do that manually:" - echo "Move ${WALLETPATH_CFG}/*.kwl to ${WALLETPATH}" - exit 1 - fi -else - echo "Found no legacy Files in ${WALLETPATH_CFG}, no migration needed." -fi + +#With every new start of KDE the Files will be recreated in ${WALLETPATH_CFG} containing no passwords but enrcypted with current user Password. +#We cannot use this wallet, so drop it +rm -f ${WALLETPATH_CFG}/*.* #Always restore configuration with defaults cp -f kwalletrc $HOME/.config/