=== modified file 'bin/ubiquity-dm' --- bin/ubiquity-dm 2014-04-12 04:55:32 +0000 +++ bin/ubiquity-dm 2014-12-08 02:47:09 +0000 @@ -167,7 +167,9 @@ def drop_privileges(self): os.setgroups(self.groups) os.setgid(self.gid) + os.setegid(self.gid) os.setuid(self.uid) + os.seteuid(self.uid) def server_preexec(self): signal.signal(signal.SIGUSR1, signal.SIG_IGN) @@ -365,6 +367,7 @@ background_image = None for background in ( + '/usr/share/backgrounds/warty-final-ubuntu.png', '/usr/share/xfce4/backdrops/ubuntustudio-1310.png', '/usr/share/xfce4/backdrops/xubuntu-wallpaper.png', '/usr/share/lubuntu/wallpapers/' @@ -376,6 +379,9 @@ accessibility = False if gsettings._gsettings_exists(): + usd = '/usr/lib/unity-settings-daemon/unity-settings-daemon' + gsd = '/usr/lib/gnome-settings-daemon/gnome-settings-daemon' + accessibility = gsettings.get( 'org.gnome.desktop.interface', 'toolkit-accessibility', self.username) @@ -414,25 +420,34 @@ ('org.gnome.desktop.wm.preferences', 'num-workspaces', '1')) + if osextras.find_on_path(usd): + gsettings_keys.append( + ('org.gnome.settings-daemon.plugins.background', + 'active', 'false')) + for gs_schema, gs_key, gs_value in gsettings_keys: subprocess.call( ['gsettings', 'set', gs_schema, gs_key, gs_value], stdin=null, stdout=logfile, stderr=logfile, preexec_fn=self.drop_privileges) - usd = '/usr/lib/unity-settings-daemon/unity-settings-daemon' - gsd = '/usr/lib/gnome-settings-daemon/gnome-settings-daemon' if osextras.find_on_path(usd): extras.append(subprocess.Popen( [usd], stdin=null, stdout=logfile, stderr=logfile, preexec_fn=self.drop_privileges)) + cmd = "xwininfo -root -tree | awk '{print $1}' | grep ^0x" + cmd += " | while read id; do xprop -id $id; done | grep " + cmd += "_XSETTINGS_SETTINGS > /dev/null" + while not subprocess.call(cmd, shell=True): + log('Waitting for xsettings plugin to be ready') + time.sleep(1) elif osextras.find_on_path(gsd): extras.append(subprocess.Popen( [gsd], stdin=null, stdout=logfile, stderr=logfile, preexec_fn=self.drop_privileges)) - elif background_image and osextras.find_on_path('feh'): + if background_image and osextras.find_on_path('feh'): subprocess.call( ['feh', '--bg-fill', background_image], stdin=null, stdout=logfile, stderr=logfile, @@ -557,7 +572,7 @@ stdin=null, stdout=logfile, stderr=logfile, preexec_fn=self.drop_privileges)) elif self.frontend == 'kde_ui': - if not 'access=v1' in proc_cmdline: + if 'access=v1' not in proc_cmdline: log('paint background') path = '/usr/share/wallpapers/kde-default.png' extras.append(subprocess.Popen( === modified file 'ubiquity/gsettings.py' --- ubiquity/gsettings.py 2013-02-19 11:33:07 +0000 +++ ubiquity/gsettings.py 2014-12-08 02:47:09 +0000 @@ -48,7 +48,7 @@ user = os.getenv("SUDO_USER", os.getenv("USER", "root")) subp = subprocess.Popen( - ['sudo', '-u', user, 'gsettings', 'get', schema, key], + ['sudo', '-H', '-u', user, 'gsettings', 'get', schema, key], stdout=subprocess.PIPE, stderr=subprocess.PIPE, preexec_fn=misc.drop_all_privileges, universal_newlines=True) value = subp.communicate()[0].rstrip('\n') @@ -103,7 +103,8 @@ value = "true" if value else "false" subprocess.call( - ['sudo', '-u', user, 'gsettings', 'set', schema, key, str(value)], + ['sudo', '-H', '-u', user, 'gsettings', 'set', schema, key, + str(value)], preexec_fn=misc.drop_all_privileges) @@ -123,5 +124,5 @@ user = os.getenv("SUDO_USER", os.getenv("USER", "root")) subprocess.call( - ['sudo', '-u', user, 'gsettings', 'reset', schema, key], + ['sudo', '-H', '-u', user, 'gsettings', 'reset', schema, key], preexec_fn=misc.drop_all_privileges)