The patches for 3.3.0.
[rsync-patches.git] / netgroup-auth.diff
1 This allows you to use the samba style @netgroup names in hosts allow
2 and hosts deny.
3
4 This patch still needs autoconf support for portability.
5
6 To use this patch, run these commands for a successful build:
7
8     patch -p1 <patches/netgroup-auth.diff
9     ./configure                           (optional if already run)
10     make
11
12 based-on: d1a1fec1340254926e17f5d83f848f7574286a33
13 diff --git a/access.c b/access.c
14 --- a/access.c
15 +++ b/access.c
16 @@ -19,6 +19,7 @@
17   */
18  
19  #include "rsync.h"
20 +#include <netdb.h>
21  
22  static int allow_forward_dns;
23  
24 @@ -33,6 +34,9 @@ static int match_hostname(const char **host_ptr, const char *addr, const char *t
25         if (!host || !*host)
26                 return 0;
27  
28 +       if (*tok == '@' && tok[1])
29 +               return innetgr(tok + 1, host, NULL, NULL);
30 +
31         /* First check if the reverse-DNS-determined hostname matches. */
32         if (iwildmatch(tok, host))
33                 return 1;