mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
r4608: - use better error codes
- use new NT_STATUS_* macros for error checking return - don't use talloc_p anymore metze (This used to be commit 372a8eeeefc2ebff50211985372888b5b6d4eb65)
This commit is contained in:
parent
e0b0d934ec
commit
c13ada4e35
@ -126,37 +126,32 @@ NTSTATUS ntvfs_init_connection(struct smbsrv_request *req, enum ntvfs_type type)
|
||||
struct ntvfs_context *ctx;
|
||||
|
||||
if (!handlers) {
|
||||
return NT_STATUS_FOOBAR;
|
||||
return NT_STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
ctx = talloc_p(req->tcon, struct ntvfs_context);
|
||||
if (!ctx) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
ctx = talloc(req->tcon, struct ntvfs_context);
|
||||
NT_STATUS_HAVE_NO_MEMORY(ctx);
|
||||
ctx->type = type;
|
||||
ctx->modules = NULL;
|
||||
|
||||
for (i=0; handlers[i]; i++) {
|
||||
struct ntvfs_module_context *ntvfs;
|
||||
|
||||
ntvfs = talloc_p(ctx, struct ntvfs_module_context);
|
||||
if (!ntvfs) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
ntvfs = talloc(ctx, struct ntvfs_module_context);
|
||||
NT_STATUS_HAVE_NO_MEMORY(ntvfs);
|
||||
|
||||
ntvfs->ops = ntvfs_backend_byname(handlers[i], ctx->type);
|
||||
if (!ntvfs->ops) {
|
||||
DEBUG(1,("ntvfs_init_connection: failed to find backend=%s, type=%d\n",
|
||||
handlers[i], ctx->type));
|
||||
return NT_STATUS_UNSUCCESSFUL;
|
||||
return NT_STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
ntvfs->depth = i;
|
||||
DLIST_ADD_END(ctx->modules, ntvfs, struct ntvfs_module_context *);
|
||||
}
|
||||
|
||||
if (!ctx->modules) {
|
||||
talloc_free(ctx);
|
||||
return NT_STATUS_FOOBAR;
|
||||
return NT_STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
req->tcon->ntvfs_ctx = ctx;
|
||||
|
Loading…
x
Reference in New Issue
Block a user