summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-05-14 04:31:03 +0000
committerAndrew Tridgell <tridge@samba.org>1998-05-14 04:31:03 +0000
commit5a96ee059968da5fd2ba4fbd6321bb3ee76b3c9d (patch)
tree21b9e7770a44a0c67a98a2403fd1068668c191ee
parent0cea42440ffc9edab56710ab0baaff9454a86fea (diff)
downloadrsync-5a96ee059968da5fd2ba4fbd6321bb3ee76b3c9d.tar.gz
rsync-5a96ee059968da5fd2ba4fbd6321bb3ee76b3c9d.tar.bz2
rsync-5a96ee059968da5fd2ba4fbd6321bb3ee76b3c9d.zip
make host access controls case insensitive
-rw-r--r--access.c3
-rw-r--r--util.c12
2 files changed, 15 insertions, 0 deletions
diff --git a/access.c b/access.c
index f1a8bd75..046d5e31 100644
--- a/access.c
+++ b/access.c
@@ -86,6 +86,9 @@ static int access_match(char *list, char *addr, char *host)
if (!list2) out_of_memory("access_match");
+ strlower(list2);
+ if (host) strlower(host);
+
for (tok=strtok(list2," ,\t"); tok; tok=strtok(NULL," ,\t")) {
if (match_hostname(host, tok) || match_address(addr, tok)) {
free(list2);
diff --git a/util.c b/util.c
index ffbdc932..ed8d34e2 100644
--- a/util.c
+++ b/util.c
@@ -531,3 +531,15 @@ void glob_expand(char **argv, int *argc, int maxargs)
(*argc) += i;
#endif
}
+
+
+/*******************************************************************
+ convert a string to lower case
+********************************************************************/
+void strlower(char *s)
+{
+ while (*s) {
+ if (isupper(*s)) *s = tolower(*s);
+ s++;
+ }
+}