diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-09-14 18:50:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:18:43 -0500 |
commit | 0e9147029f0ca5b7e7d53235fe4bd81dd4fb1b3d (patch) | |
tree | 1ace060e50b0a0d48f93ccc3b2eff5b77f5fd42a /source4/lib/ldb/common | |
parent | fafa8c3e47497a9f399e9ca52a7e6a904f1fb9f6 (diff) | |
download | samba-0e9147029f0ca5b7e7d53235fe4bd81dd4fb1b3d.tar.gz samba-0e9147029f0ca5b7e7d53235fe4bd81dd4fb1b3d.tar.bz2 samba-0e9147029f0ca5b7e7d53235fe4bd81dd4fb1b3d.zip |
r18536: fixed the loading of external binary files from ldif into ldb
(This used to be commit fbe13ed83e2f3508db6d77f4bd65a913ef12ff02)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r-- | source4/lib/ldb/common/ldb_ldif.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c index 593a895262..c5084aaa6c 100644 --- a/source4/lib/ldb/common/ldb_ldif.c +++ b/source4/lib/ldb/common/ldb_ldif.c @@ -50,8 +50,14 @@ static int ldb_read_data_file(void *mem_ctx, struct ldb_val *value) int count, size, bytes; int ret; int f; + const char *fname = (const char *)value->data; - f = open((const char *)value->data, O_RDONLY); + if (strncmp(fname, "file://", 7) != 0) { + return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX; + } + fname += 7; + + f = open(fname, O_RDONLY); if (f == -1) { return -1; } |