mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
dsdb: Return LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS rather than OPERATIONS_ERROR on EACCES and EPERM
This makes provision errors clearer in Samba. Andrew Bartlett Reviewed-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
This commit is contained in:
parent
673d41503c
commit
262c3de3f8
@ -246,11 +246,14 @@ static int partition_metadata_open(struct ldb_module *module, bool create)
|
||||
if (data->metadata->db == NULL) {
|
||||
talloc_free(tmp_ctx);
|
||||
if (create) {
|
||||
ldb_asprintf_errstring(ldb, "partition_metadata: Unable to create %s",
|
||||
filename);
|
||||
ldb_asprintf_errstring(ldb, "partition_metadata: Unable to create %s: %s",
|
||||
filename, strerror(errno));
|
||||
} else {
|
||||
ldb_asprintf_errstring(ldb, "partition_metadata: Unable to open %s",
|
||||
filename);
|
||||
ldb_asprintf_errstring(ldb, "partition_metadata: Unable to open %s: %s",
|
||||
filename, strerror(errno));
|
||||
}
|
||||
if (errno == EACCES || errno == EPERM) {
|
||||
return LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS;
|
||||
}
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user