git.samba.org
/
kai
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
52317b1
)
r19383: pass only the base filename of an ldb file to be opened; allow server to...
author
Derrell Lipman
<derrell@samba.org>
Wed, 18 Oct 2006 00:29:26 +0000
(
00:29
+0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 19:21:22 +0000
(14:21 -0500)
(This used to be commit
5a21c97b73a896dbba0d814c2226e17a67034802
)
services/samba/ldb.esp
patch
|
blob
|
history
diff --git
a/services/samba/ldb.esp
b/services/samba/ldb.esp
index d886d1a5665f7e677c2a146812773f34bc40ebcd..1cd98adc3a9527a8f5a4d8c2c18acfa9a73f384e 100644
(file)
--- a/
services/samba/ldb.esp
+++ b/
services/samba/ldb.esp
@@
-30,7
+30,7
@@
jsonrpc_include("resources.esp");
*
* @return
* Success: The resource id to be used for future access to the database
*
* @return
* Success: The resource id to be used for future access to the database
- * Failure:
-1
+ * Failure:
error event
*
* @note
* Credentials or session_info may be set up first.
*
* @note
* Credentials or session_info may be set up first.
@@
-52,9
+52,23
@@
function _connect(params, error)
return resourceId;
}
return resourceId;
}
+ /* Ensure there are no slashes in the database name */
+ var components = split('/', params[0]);
+ if (components.length > 1)
+ {
+ error.setError(1, "Invalid database name (contains '/')");
+ return error;
+ }
+
+ /* Get access to loadparm functions */
+ var lp = loadparm_init();
+
+ /* Determine the private directory */
+ var private_dir = lp.get("private dir");
+
/* Database was not previously opened. Connect to it. */
ldb = ldb_init();
/* Database was not previously opened. Connect to it. */
ldb = ldb_init();
- var ret = ldb.connect(params[0]);
+ var ret = ldb.connect(p
rivate_dir + "/" + p
arams[0]);
if (ret && ldb.db)
{
return session.resources.set(ldb, "ldb:" + params[0], error);
if (ret && ldb.db)
{
return session.resources.set(ldb, "ldb:" + params[0], error);