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