diff options
| author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2022-08-19 16:53:40 +1200 |
|---|---|---|
| committer | Douglas Bagnall <dbagnall@samba.org> | 2022-09-06 21:12:36 +0000 |
| commit | 1137647460cc143509eae598708bb9f1529463f6 (patch) | |
| tree | 1cad7b4774cfff2e995e7ad503dceca1386f720f /python | |
| parent | c2178d87c2fe524913d2ae059be2b3622ad7bd08 (diff) | |
| download | samba-1137647460cc143509eae598708bb9f1529463f6.tar.gz samba-1137647460cc143509eae598708bb9f1529463f6.tar.bz2 samba-1137647460cc143509eae598708bb9f1529463f6.zip | |
py/getopt: allow --option arguments to contain '='
smb.conf lines can have = on the right hand side. For example, in
st/ad_dc/etc/smb.conf we have 3 examples, including:
gpo update command = python3 source4/scripting/bin/samba-gpupdate [...] --target=Computer
If we tried to provide the same line via --option, it would split on
both '=', and the set value would end at '--target'.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
| -rw-r--r-- | python/samba/getopt.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/samba/getopt.py b/python/samba/getopt.py index 76c48de87b6..9e35273381f 100644 --- a/python/samba/getopt.py +++ b/python/samba/getopt.py @@ -84,7 +84,7 @@ class SambaOptions(optparse.OptionGroup): if arg.find('=') == -1: raise optparse.OptionValueError( "--option option takes a 'a=b' argument") - a = arg.split('=') + a = arg.split('=', 1) try: self._lp.set(a[0], a[1]) except Exception as e: |
