diff options
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; } |