From 1c798aba40fb0e389c7a54ad3d8f7d45876f2809 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 3 Feb 2004 11:10:56 +0000 Subject: - port AUTH and PASSDB subsystems to new SMB_SUBSYSTEM() scheme - some const fixes in ntvfs metze (This used to be commit af89a78123068767b1d134969c5651a0fd978b0d) --- source4/ntvfs/ntvfs_base.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c index 3e1f77edce..7ed8c738b6 100644 --- a/source4/ntvfs/ntvfs_base.c +++ b/source4/ntvfs/ntvfs_base.c @@ -30,7 +30,7 @@ * can be more than one backend with the same name, as long as they * have different typesx */ static struct { - struct ntvfs_ops *ops; + const struct ntvfs_ops *ops; } *backends = NULL; static int num_backends; @@ -44,7 +44,8 @@ static int num_backends; */ static NTSTATUS ntvfs_register(void *_ops) { - struct ntvfs_ops *ops = _ops; + const struct ntvfs_ops *ops = _ops; + struct ntvfs_ops *new_ops; if (ntvfs_backend_byname(ops->name, ops->type) != NULL) { /* its already registered! */ @@ -58,8 +59,10 @@ static NTSTATUS ntvfs_register(void *_ops) smb_panic("out of memory in ntvfs_register"); } - backends[num_backends].ops = smb_xmemdup(ops, sizeof(*ops)); - backends[num_backends].ops->name = smb_xstrdup(ops->name); + new_ops = smb_xmemdup(ops, sizeof(*ops)); + new_ops->name = smb_xstrdup(ops->name); + + backends[num_backends].ops = new_ops; num_backends++; @@ -73,7 +76,7 @@ static NTSTATUS ntvfs_register(void *_ops) /* return the operations structure for a named backend of the specified type */ -struct ntvfs_ops *ntvfs_backend_byname(const char *name, enum ntvfs_type type) +const struct ntvfs_ops *ntvfs_backend_byname(const char *name, enum ntvfs_type type) { int i; -- cgit