From 0886638844b6ea5253cae217682c680cc7b6cec8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 14 Jun 2002 02:06:58 +0000 Subject: Patch (from ctrlsoft ) to poptify testparm, and the modifications required to suppress the const warnings. Andrew Bartlett (This used to be commit ec4f1e9e2f6c162a475b424d63b9802387ad905e) --- source3/lib/access.c | 18 +++++++++++++++++- source3/lib/debug.c | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/access.c b/source3/lib/access.c index 62d47b82cf..4e524735e4 100644 --- a/source3/lib/access.c +++ b/source3/lib/access.c @@ -188,7 +188,7 @@ static int list_match(char **list,char *item, int (*match_fn)(char *, char *)) /* return true if access should be allowed */ -BOOL allow_access(char **deny_list,char **allow_list, +static BOOL allow_access_internal(char **deny_list,char **allow_list, char *cname,char *caddr) { char *client[2]; @@ -240,6 +240,22 @@ BOOL allow_access(char **deny_list,char **allow_list, return (True); } +/* return true if access should be allowed */ +BOOL allow_access(char **deny_list,char **allow_list, + const char *cname, const char *caddr) +{ + BOOL ret; + + char *nc_cname = smb_xstrdup(cname); + char *nc_caddr = smb_xstrdup(caddr); + + ret = allow_access_internal(deny_list, allow_list, nc_cname, nc_caddr); + + SAFE_FREE(nc_cname); + SAFE_FREE(nc_caddr); + return ret; +} + /* return true if the char* contains ip addrs only. Used to avoid gethostbyaddr() calls */ static BOOL only_ipaddrs_in_list(char** list) diff --git a/source3/lib/debug.c b/source3/lib/debug.c index 834c1b38f7..255b0568f1 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -516,7 +516,7 @@ void debug_init(void) * get ready for syslog stuff * ************************************************************************** ** */ -void setup_logging(char *pname, BOOL interactive) +void setup_logging(const char *pname, BOOL interactive) { debug_init(); @@ -531,7 +531,7 @@ void setup_logging(char *pname, BOOL interactive) } #ifdef WITH_SYSLOG else { - char *p = strrchr_m( pname,'/' ); + const char *p = strrchr_m( pname,'/' ); if (p) pname = p + 1; #ifdef LOG_DAEMON -- cgit