samba-cvs.cvs
[Top] [All Lists]

svn commit: samba r21368 - in branches/SAMBA_4_0/services/samba: .

Subject: svn commit: samba r21368 - in branches/SAMBA_4_0/services/samba: .
From:
Date: Thu, 15 Feb 2007 14:50:31 +0000 GMT
Author: idra
Date: 2007-02-15 14:50:30 +0000 (Thu, 15 Feb 2007)
New Revision: 21368

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21368

Log:

Adapy Json to the new ldb functions return object, this
allow us to return meaningful erors back to swat


Modified:
   branches/SAMBA_4_0/services/samba/ldb.esp


Changeset:
Modified: branches/SAMBA_4_0/services/samba/ldb.esp
===================================================================
--- branches/SAMBA_4_0/services/samba/ldb.esp   2007-02-15 14:49:35 UTC (rev 
21367)
+++ branches/SAMBA_4_0/services/samba/ldb.esp   2007-02-15 14:50:30 UTC (rev 
21368)
@@ -334,7 +334,14 @@
         return error;
     }
 
-    return ldb.search(expr, baseDN, scope, attrs);
+    var res = ldb.search(expr, baseDN, scope, attrs);
+
+    if (res.error != 0) {
+        error.setError(res.error, res.errstr);
+        return error;
+    }
+
+    return res.msgs;
 }
 jsonrpc.method.search = _search;
 
@@ -371,7 +378,13 @@
         return ldb;
     }
 
-    return ldb.add(params[1]);
+    var res = ldb.add(params[1]);
+    if (res.error != 0) {
+        error.setError(res.error, res.errstr);
+        return error;
+    }
+
+    return true;
 }
 jsonrpc.method.add = _add;
 
@@ -408,7 +421,13 @@
         return ldb;
     }
 
-    return ldb.modify(params[1]);
+    var res = ldb.modify(params[1]);
+    if (res.error != 0) {
+        error.setError(res.error, res.errstr);
+        return error;
+    }
+
+    return true;
 }
 jsonrpc.method.modify = _modify;
 
@@ -445,7 +464,13 @@
         return ldb;
     }
 
-    return ldb.del(params[1]);
+    var res = ldb.del(params[1]);
+    if (res.error != 0) {
+        error.setError(res.error, res.errstr);
+        return error;
+    }
+
+    return true;
 }
 jsonrpc.method.del = _del;
 
@@ -485,7 +510,13 @@
         return ldb;
     }
 
-    return ldb.rename(params[1], params[2]);
+    var res = ldb.rename(params[1], params[2]);
+    if (res.error != 0) {
+        error.setError(res.error, res.errstr);
+        return error;
+    }
+
+    return true;
 }
 jsonrpc.method.rename = _rename;
 

<Prev in Thread] Current Thread [Next in Thread>
  • svn commit: samba r21368 - in branches/SAMBA_4_0/services/samba: ., idra <=