Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added a "Defaults" structure with both globals and locals in it.
[rsync/rsync.git]
/
access.c
diff --git
a/access.c
b/access.c
index
282a902
..
9a023de
100644
(file)
--- a/
access.c
+++ b/
access.c
@@
-2,11
+2,11
@@
* Routines to authenticate access to a daemon (hosts allow/deny).
*
* Copyright (C) 1998 Andrew Tridgell
* Routines to authenticate access to a daemon (hosts allow/deny).
*
* Copyright (C) 1998 Andrew Tridgell
- * Copyright (C) 2004
, 2005
Wayne Davison
+ * Copyright (C) 2004
-2009
Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version
2
of the License, or
+ * the Free Software Foundation; either version
3
of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@
-15,20
+15,19
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ * with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
*/
#include "rsync.h"
-static int match_hostname(c
har *host,
char *tok)
+static int match_hostname(c
onst char *host, const
char *tok)
{
if (!host || !*host)
return 0;
{
if (!host || !*host)
return 0;
- return wildmatch(tok, host);
+ return
i
wildmatch(tok, host);
}
}
-static int match_binary(c
har *b1, char *b2,
char *mask, int addrlen)
+static int match_binary(c
onst char *b1, const char *b2, const
char *mask, int addrlen)
{
int i;
{
int i;
@@
-57,7
+56,7
@@
static void make_mask(char *mask, int plen, int addrlen)
return;
}
return;
}
-static int match_address(c
har *addr,
char *tok)
+static int match_address(c
onst char *addr, const
char *tok)
{
char *p;
struct addrinfo hints, *resa, *rest;
{
char *p;
struct addrinfo hints, *resa, *rest;
@@
-211,7
+210,7
@@
static int match_address(char *addr, char *tok)
return ret;
}
return ret;
}
-static int access_match(c
har *list, char *addr,
char *host)
+static int access_match(c
onst char *list, const char *addr, const
char *host)
{
char *tok;
char *list2 = strdup(list);
{
char *tok;
char *list2 = strdup(list);
@@
-220,8
+219,6
@@
static int access_match(char *list, char *addr, char *host)
out_of_memory("access_match");
strlower(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)) {
for (tok = strtok(list2, " ,\t"); tok; tok = strtok(NULL, " ,\t")) {
if (match_hostname(host, tok) || match_address(addr, tok)) {
@@
-234,7
+231,8
@@
static int access_match(char *list, char *addr, char *host)
return 0;
}
return 0;
}
-int allow_access(char *addr, char *host, char *allow_list, char *deny_list)
+int allow_access(const char *addr, const char *host,
+ const char *allow_list, const char *deny_list)
{
if (allow_list && !*allow_list)
allow_list = NULL;
{
if (allow_list && !*allow_list)
allow_list = NULL;