Revised version was applied to 3.1.0dev source.
[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: d64bda1c1e79dc385f194d74f7957ce7cd118654
13 diff --git a/access.c b/access.c
14 --- a/access.c
15 +++ b/access.c
16 @@ -19,11 +19,14 @@
17   */
18  
19  #include "rsync.h"
20 +#include <netdb.h>
21  
22  static int match_hostname(const char *host, const char *tok)
23  {
24         if (!host || !*host)
25                 return 0;
26 +       if (*tok == '@' && tok[1])
27 +               return innetgr(tok + 1, host, NULL, NULL);
28         return iwildmatch(tok, host);
29  }
30