summaryrefslogtreecommitdiff
path: root/source3/lib/access.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-06-14 02:06:58 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-06-14 02:06:58 +0000
commit0886638844b6ea5253cae217682c680cc7b6cec8 (patch)
treee4bae78ffbf3770fff68ee8a85fe9ac563b6dbc4 /source3/lib/access.c
parentbaef1358d2b5a98a592f0247911a31d79148dcba (diff)
downloadsamba-0886638844b6ea5253cae217682c680cc7b6cec8.tar.gz
samba-0886638844b6ea5253cae217682c680cc7b6cec8.tar.bz2
samba-0886638844b6ea5253cae217682c680cc7b6cec8.zip
Patch (from ctrlsoft <jelmer@nl.linux.org>) to poptify testparm, and the
modifications required to suppress the const warnings. Andrew Bartlett (This used to be commit ec4f1e9e2f6c162a475b424d63b9802387ad905e)
Diffstat (limited to 'source3/lib/access.c')
-rw-r--r--source3/lib/access.c18
1 files changed, 17 insertions, 1 deletions
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)