File: netgroup-auth.diff

package info (click to toggle)
rsync 2.6.9-2etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 3,720 kB
  • ctags: 2,572
  • sloc: ansic: 26,590; sh: 4,331; perl: 1,320; makefile: 203; python: 83; awk: 59
file content (28 lines) | stat: -rw-r--r-- 632 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
This allows you to use the samba style @netgroup names in hosts allow
and hosts deny.

This patch still needs autoconf support for portability.

To use this patch, run these commands for a successful build:

    patch -p1 <patches/netgroup-auth.diff
    ./configure                           (optional if already run)
    make

--- old/access.c
+++ new/access.c
@@ -20,11 +20,14 @@
  */
 
 #include "rsync.h"
+#include <netdb.h>
 
 static int match_hostname(char *host, char *tok)
 {
 	if (!host || !*host)
 		return 0;
+ 	if (*tok == '@' && tok[1])
+		return innetgr(tok + 1, host, NULL, NULL);
 	return wildmatch(tok, host);
 }