diff --git a/services/univention-s4-connector/scripts/remove_s4_rejected.py b/services/univention-s4-connector/scripts/remove_s4_rejected.py index 42721a37fd..0ff6a59ffe 100755 --- a/services/univention-s4-connector/scripts/remove_s4_rejected.py +++ b/services/univention-s4-connector/scripts/remove_s4_rejected.py @@ -43,11 +43,11 @@ class ObjectNotFound(BaseException): def remove_s4_rejected(s4_dn): cache_db = sqlite3.connect('/etc/univention/connector/s4internal.sqlite') c = cache_db.cursor() - c.execute("SELECT key FROM 'S4 rejected' WHERE value='%s'" % s4_dn) + c.execute("SELECT key FROM 'S4 rejected' WHERE value=?", [unicode(s4_dn)]) key = c.fetchone() if not key: raise ObjectNotFound - c.execute("DELETE FROM 'S4 rejected' WHERE value='%s'" % s4_dn) + c.execute("DELETE FROM 'S4 rejected' WHERE value=?", [unicode(s4_dn)]) cache_db.commit() cache_db.close() diff --git a/services/univention-s4-connector/scripts/remove_ucs_rejected.py b/services/univention-s4-connector/scripts/remove_ucs_rejected.py index f9b1de4740..dc26e9ba75 100755 --- a/services/univention-s4-connector/scripts/remove_ucs_rejected.py +++ b/services/univention-s4-connector/scripts/remove_ucs_rejected.py @@ -44,7 +44,7 @@ class ObjectNotFound(BaseException): def remove_ucs_rejected(ucs_dn): cache_db = sqlite3.connect('/etc/univention/connector/s4internal.sqlite') c = cache_db.cursor() - c.execute("SELECT key FROM 'UCS rejected' WHERE value='%s'" % ucs_dn) + c.execute("SELECT key FROM 'UCS rejected' WHERE value=?" % [unicode(ucs_dn)]) filenames = c.fetchall() if not filenames: raise ObjectNotFound @@ -52,7 +52,7 @@ def remove_ucs_rejected(ucs_dn): if filename: if os.path.exists(filename[0]): os.remove(filename[0]) - c.execute("DELETE FROM 'UCS rejected' WHERE value='%s'" % ucs_dn) + c.execute("DELETE FROM 'UCS rejected' WHERE value=?" % [unicode(ucs_dn)]) cache_db.commit() cache_db.close()