diff options
author | Papoteur <papoteur@mageia.org> | 2018-03-08 14:18:31 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2018-03-08 14:18:31 +0100 |
commit | 9242e2516b6bbe83010f80eea8ccc2158f7f8b1c (patch) | |
tree | c6d0fa8a862658e9ef5329d2f7a52e67d53b7e2d /src | |
parent | e3b9e60444d5e089798d57884ef6393f3d4f3a45 (diff) | |
download | msec-9242e2516b6bbe83010f80eea8ccc2158f7f8b1c.tar msec-9242e2516b6bbe83010f80eea8ccc2158f7f8b1c.tar.gz msec-9242e2516b6bbe83010f80eea8ccc2158f7f8b1c.tar.bz2 msec-9242e2516b6bbe83010f80eea8ccc2158f7f8b1c.tar.xz msec-9242e2516b6bbe83010f80eea8ccc2158f7f8b1c.zip |
Manage allow_Xserver_to_listen for SDDM, to be included in X11 section (mga#19612)
Manage allow_user_list for SDDM to be included in Users section
Diffstat (limited to 'src')
-rwxr-xr-x | src/msec/plugins/msec.py | 18 | ||||
-rwxr-xr-x | src/msec/version.py | 2 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/msec/plugins/msec.py b/src/msec/plugins/msec.py index 8610cc6..8aba2a0 100755 --- a/src/msec/plugins/msec.py +++ b/src/msec/plugins/msec.py @@ -214,9 +214,9 @@ class msec: val_startx = startx.get_match(STARTX_REGEXP) val_xservers = xservers.get_match(XSERVERS_REGEXP) val_gdmconf = gdmconf.get_shell_variable('DisallowTCP') - str = sddmconf.get_shell_variable('ServerArguments', 'X11', '^\s*$') - if str: - val_sddmconf = SDDMCONF_REGEXP.search(str) + strg = sddmconf.get_shell_variable('ServerArguments', start='^\[X11\]', end='^\s*$') + if strg: + val_sddmconf = SDDMCONF_REGEXP.search(strg) else: val_sddmconf = None self.log.debug("Valeur SDDM {}".format(val_sddmconf)) @@ -233,7 +233,9 @@ class msec: if gdmconf.exists(): gdmconf.set_shell_variable('DisallowTCP', 'false', '\[security\]', '^\s*$') if sddmconf.exists() and not val_sddmconf: - sddmconf.replace_line_matching('^(ServerArguments=.*)$', '@1 -listen tcp', 'ServerArguments=-listen tcp', 0, 'X11', '^\s*$') + sddmconf.replace_line_matching('^(ServerArguments=.*)$', '@1 -listen tcp',\ + at_end_if_not_found="[X11]\nServerArguments=-listen tcp", \ + start='^\[X11\]', end='^\s*$') else: if not val_startx or not val_xservers or val_gdmconf != 'true' or not val_sddmconf: self.log.info(_('Forbidding the X server to listen to tcp connection')) @@ -244,7 +246,7 @@ class msec: if val_gdmconf != 'true': gdmconf.exists() and gdmconf.set_shell_variable('DisallowTCP', 'true', '\[security\]', '^\s*$') if sddmconf.exists(): - sddmconf.replace_line_matching('^(ServerArguments=.*?)-listen tcp(.*)$', '@1@2', 0, 0, 'X11', '^\s*$') + sddmconf.replace_line_matching('^(ServerArguments=.*?)-listen tcp(.*)$', '@1@2', 0, 0, '^\[X11\]', '^\s*$') def set_shell_timeout(self, val): ''' Set the shell timeout. A value of zero means no timeout.''' @@ -377,7 +379,7 @@ class msec: sddmconf = self.configfiles.get_config_file(SDDMCONF) oldval_gdmconf = gdmconf.get_shell_variable('Browser') - oldval_sddmconf = sddmconf.get_shell_variable('RememberLastUser','X11', '^\s*$') + oldval_sddmconf = sddmconf.get_shell_variable('RememberLastUser','^\[Users\]', '^\s*$') if arg == "yes": if gdmconf.exists(): @@ -390,7 +392,7 @@ class msec: if sddmconf.exists(): if oldval_sddmconf != 'true': self.log.info(_("Allowing list of users in {}").format('SDDM')) - sddmconf.set_shell_variable('RememberLastUser', 'true','X11', '^\s*$') + sddmconf.set_shell_variable('RememberLastUser', 'true','^\[Users\]', '^\s*$') else: if gdmconf.exists(): if gdm230.exists(): @@ -402,7 +404,7 @@ class msec: if sddmconf.exists(): if oldval_sddmconf != 'false': self.log.info(_("Forbidding showing last user in {}").format('SDDM')) - sddmconf.set_shell_variable('RememberLastUser', 'false','X11', '^\s*$') + sddmconf.set_shell_variable('RememberLastUser', 'false','^\[Users\]', '^\s*$') def allow_autologin(self, arg): ''' Allow autologin.''' diff --git a/src/msec/version.py b/src/msec/version.py index 43fc33b..2571f37 100755 --- a/src/msec/version.py +++ b/src/msec/version.py @@ -1 +1 @@ -version='1.13' +version='2.5' |