Update module

ubuntu/focal
Rohan Garg 9 years ago committed by Simon Quigley
parent 5778c7754b
commit 9dbdf28577

@ -19,19 +19,25 @@
# along with Calamares. If not, see <http://www.gnu.org/licenses/>. # along with Calamares. If not, see <http://www.gnu.org/licenses/>.
import libcalamares import libcalamares
import os
from pwd import getpwnam
def run(): def run():
""" Setup network configuration """ """ Setup network configuration """
obfuscatedPassword = libcalamares.globalstorage.value("password") 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: with open(cfgPath + "krfbrc", 'w') as krfbrc:
krfbrc.write("[Security]\n" + krfbrc.write("[Security]\n" +
"allowUnattendedAccess=true\n" + "allowUnattendedAccess=true\n" +
"desktopPassword=ᄈᄊᄅᄎ" + obfuscatedPassword + "\n" + "desktopPassword=" + obfuscatedPassword + "\n" +
"noWallet=true" + "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 return None

Loading…
Cancel
Save