[Da-tools-commits] ./debian/userdir-ldap r440: ud-mailgate: Do not commit any changes if one of the requests is invalid or could not be parsed or caused an error or anything.

Peter Palfrader peter at palfrader.org
Sat Sep 13 14:35:17 UTC 2008


------------------------------------------------------------
revno: 440
committer: Peter Palfrader <peter at palfrader.org>
branch nick: userdir-ldap
timestamp: Sat 2008-09-13 16:35:17 +0200
message:
  ud-mailgate: Do not commit any changes if one of the requests is invalid or could not be parsed or caused an error or anything.
modified:
  debian/changelog
  ud-mailgate
-------------- next part --------------
=== modified file 'debian/changelog'
--- a/debian/changelog	2008-07-19 19:36:54 +0000
+++ b/debian/changelog	2008-09-13 14:35:17 +0000
@@ -1,3 +1,10 @@
+userdir-ldap (0.3.3xxx) unstable; urgency=low
+
+  * ud-mailgate: Do not commit any changes if one of the requests is invalid
+    or could not be parsed or caused an error or anything.
+
+ -- Peter Palfrader <weasel at debian.org>  Sat, 13 Sep 2008 16:29:37 +0200
+
 userdir-ldap (0.3.36) unstable; urgency=low
 
   * Aha.  Error is not some magic variable or exception, it's a

=== modified file 'ud-mailgate'
--- a/ud-mailgate	2008-06-09 20:59:39 +0000
+++ b/ud-mailgate	2008-09-13 14:35:17 +0000
@@ -454,6 +454,7 @@
    Result = "";
    Attrs = [];
    Show = 0;
+   CommitChanges = 1
    for Line in Lines: 
       Line = Line.strip()
       if Line == "":
@@ -477,7 +478,8 @@
       # Fail, if someone tries to send someone elses signed email to the
       # daemon then we want to abort ASAP.
       if Res == None:
-         Result = Result + "Command is not understood. Halted\n";
+         CommitChanges = 0
+         Result = Result + "Command is not understood. Halted - no changes committed\n";
          break;
       Result = Result + Res + "\n";
 
@@ -494,7 +496,8 @@
        or GetAttr(oldAttrs[0],"userPassword").startswith("!")):
       raise Error, "This account is locked";
    Dn = "uid=" + GetAttr(DnRecord,"uid") + "," + BaseDn;
-   l.modify_s(Dn,Attrs);
+   if CommitChanges == 1:
+      l.modify_s(Dn,Attrs);
 
    Attribs = "";
    if Show == 1:



More information about the Da-tools-commits mailing list