From: Joe Guo Date: Tue, 6 Nov 2018 04:41:12 +0000 (+1300) Subject: netcmd/ldapcmp: fix wrong way for string copy X-Git-Tag: tdb-1.3.17~693 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10855509852f8e6bc42d5410e59e76fbf2f14657;p=thirdparty%2Fsamba.git netcmd/ldapcmp: fix wrong way for string copy Two mistakes here: - res[:-1] will copy but lost the last char - string is immutable in python, there is no need to copy it explicitly Signed-off-by: Joe Guo Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py index eca1ecd91e6..646eedc0e80 100644 --- a/python/samba/netcmd/ldapcmp.py +++ b/python/samba/netcmd/ldapcmp.py @@ -565,8 +565,8 @@ class LDAPObject(object): else: raise Exception("Unknown --view option value.") # - self.screen_output = res[1][:-1] - other.screen_output = res[1][:-1] + self.screen_output = res[1] + other.screen_output = res[1] # return res[0] @@ -681,8 +681,8 @@ class LDAPObject(object): other.summary["unique_attrs"] += other.unique_attrs other.summary["df_value_attrs"] += self.df_value_attrs # they are the same # - self.screen_output = res[:-1] - other.screen_output = res[:-1] + self.screen_output = res + other.screen_output = res # return res == ""