diff options
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' |