From 9dbdf28577550927f9ed7b8811bd6b8b414e40c3 Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Fri, 25 Sep 2015 21:00:05 +0200 Subject: [PATCH] Update module --- debian/extra_modules/krfbcfg/main.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/extra_modules/krfbcfg/main.py b/debian/extra_modules/krfbcfg/main.py index 87ad730..d0f5cf8 100644 --- a/debian/extra_modules/krfbcfg/main.py +++ b/debian/extra_modules/krfbcfg/main.py @@ -19,19 +19,25 @@ # along with Calamares. If not, see . import libcalamares - +import os +from pwd import getpwnam def run(): """ Setup network configuration """ obfuscatedPassword = libcalamares.globalstorage.value("password") - cfgPath = libcalamares.target_env_output("kde4-config --path").split(":")[0] + user = libcalamares.globalstorage.value("autologinUser") + cfgPath = libcalamares.utils.check_target_env_output(["sudo", "-u", user, "kde4-config", "--path", "config"]).split(":")[0] + os.makedirs(cfgPath, exist_ok=True) with open(cfgPath + "krfbrc", 'w') as krfbrc: krfbrc.write("[Security]\n" + "allowUnattendedAccess=true\n" + - "desktopPassword=ᄈᄊᄅᄎ" + obfuscatedPassword + "\n" + + "desktopPassword=" + obfuscatedPassword + "\n" + "noWallet=true" + - "unattendedPassword=ᄈᄊᄅᄎ" + obfuscatedPassword + "\n") + "unattendedPassword=" + obfuscatedPassword + "\n") + + userEntry = getpwnam(user) + libcalamares.utils.check_target_env_output(["chown", "-R", "{0}:{1}".format(userEntry.pw_uid, userEntry.pw_gid), userEntry.pw_dir]) return None