I can reproduce the issue by running the command shown below in P.S.,
where:
* bash shell variables username, current_password, new_password and ipaddress have been set to their correct values
* the current password of user "$username" ends with a '(' character.
Does this help ?
P.S.: step to reproduce the issue:
$ samba-tool user password --username="$username" --password="$current_password" --newpassword="$new_password" --ipaddress="$ipaddress"
ERROR(<class 're.error'>): uncaught exception - missing ), unterminated subpattern at position 8
File "/bin/samba-tool", line 44, in <module>
retval = cmd._run("samba-tool", subcommand, *args)
File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 235, in _run
return self.subcommands[subcommand]._run(
File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 235, in _run
return self.subcommands[subcommand]._run(
File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 153, in _run
opts, args = parser.parse_args(list(argv))
File "/usr/lib/python3.10/optparse.py", line 1387, in parse_args
stop = self._process_args(largs, rargs, values)
File "/usr/lib/python3.10/optparse.py", line 1427, in _process_args
self._process_long_opt(rargs, values)
File "/usr/lib/python3.10/optparse.py", line 1501, in _process_long_opt
option.process(opt, value, values, self)
File "/usr/lib/python3.10/optparse.py", line 784, in process
return self.take_action(
File "/usr/lib/python3.10/optparse.py", line 805, in take_action
self.callback(self, opt, value, parser, *args, **kwargs)
File "/usr/lib/python3/dist-packages/samba/getopt.py", line 251, in _set_password
self._ensure_secure_proctitle(opt_str, arg, "password")
File "/usr/lib/python3/dist-packages/samba/getopt.py", line 203, in _ensure_secure_proctitle
pass_opt_re = re.compile(pass_opt_re_str)
File "/usr/lib/python3.10/re.py", line 251, in compile
return _compile(pattern, flags)
File "/usr/lib/python3.10/re.py", line 303, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python3.10/sre_compile.py", line 788, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib/python3.10/sre_parse.py", line 955, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/lib/python3.10/sre_parse.py", line 444, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "/usr/lib/python3.10/sre_parse.py", line 843, in _parse
raise source.error("missing ), unterminated subpattern",
Hi Michal,
I can reproduce the issue by running the command shown below in P.S.,
where:
* bash shell variables username, current_password, new_password and ipaddress have been set to their correct values
* the current password of user "$username" ends with a '(' character.
Does this help ?
P.S.: step to reproduce the issue:
$ samba-tool user password --username= "$username" --password= "$current_ password" --newpassword= "$new_password" --ipaddress= "$ipaddress" "samba- tool", subcommand, *args) python3/ dist-packages/ samba/netcmd/ __init_ _.py", line 235, in _run s[subcommand] ._run( python3/ dist-packages/ samba/netcmd/ __init_ _.py", line 235, in _run s[subcommand] ._run( python3/ dist-packages/ samba/netcmd/ __init_ _.py", line 153, in _run parse_args( list(argv) ) python3. 10/optparse. py", line 1387, in parse_args args(largs, rargs, values) python3. 10/optparse. py", line 1427, in _process_args _process_ long_opt( rargs, values) python3. 10/optparse. py", line 1501, in _process_long_opt process( opt, value, values, self) python3. 10/optparse. py", line 784, in process python3. 10/optparse. py", line 805, in take_action callback( self, opt, value, parser, *args, **kwargs) python3/ dist-packages/ samba/getopt. py", line 251, in _set_password _ensure_ secure_ proctitle( opt_str, arg, "password") python3/ dist-packages/ samba/getopt. py", line 203, in _ensure_ secure_ proctitle pass_opt_ re_str) python3. 10/re.py" , line 251, in compile python3. 10/re.py" , line 303, in _compile compile( pattern, flags) python3. 10/sre_ compile. py", line 788, in compile python3. 10/sre_ parse.py" , line 955, in parse python3. 10/sre_ parse.py" , line 444, in _parse_sub (_parse( source, state, verbose, nested + 1, python3. 10/sre_ parse.py" , line 843, in _parse error(" missing ), unterminated subpattern",
ERROR(<class 're.error'>): uncaught exception - missing ), unterminated subpattern at position 8
File "/bin/samba-tool", line 44, in <module>
retval = cmd._run(
File "/usr/lib/
return self.subcommand
File "/usr/lib/
return self.subcommand
File "/usr/lib/
opts, args = parser.
File "/usr/lib/
stop = self._process_
File "/usr/lib/
self.
File "/usr/lib/
option.
File "/usr/lib/
return self.take_action(
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
pass_opt_re = re.compile(
File "/usr/lib/
return _compile(pattern, flags)
File "/usr/lib/
p = sre_compile.
File "/usr/lib/
p = sre_parse.parse(p, flags)
File "/usr/lib/
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/lib/
itemsappend
File "/usr/lib/
raise source.