On Sun, Feb 01, 2004 at 11:25:22PM +1100, Travis Freeland wrote: > > innetgr.. much easier..
Much cleaner. But the code could be tightened further. I've provided an example. Note also formatting changes. Also, we use tabs, not spaces for indent. If that is your mailer either fix the config or use text/plain (not x-diff) attachments. > Had a look for the user section but didn't find it in my 15 seconds of > looking.. Do the user, user+host and the autoconf and I'll consider this for CVS. > --- access.c 2003-07-30 16:12:27.000000000 +1000 > +++ ../rsync-2.6.0-Linux/access.c 2004-02-01 23:21:12.000000000 +1100 > @@ -22,10 +22,21 @@ > */ > > #include "rsync.h" > +#include <netdb.h> > > > static int match_hostname(char *host, char *tok) > { > + char *netgroup; > + > + if(strlen(tok)>1){ > + if(tok[0]=='@'){ > + netgroup=tok+1; > + if(innetgr(netgroup, host, NULL, NULL)){ > + return(1); > + } > + } > + } > if (!host || !*host) return 0; > return wildmatch(tok, host); > } --- access.c 2003-07-30 16:12:27.000000000 +1000 +++ ../rsync-2.6.0-Linux/access.c 2004-02-01 23:21:12.000000000 +1100 @@ -22,10 +22,21 @@ */ #include "rsync.h" +#include <netdb.h> static int match_hostname(char *host, char *tok) { + if (tok[0] == '@' && tok[1]) { + if (innetgr(&tok[1], host, NULL, NULL)) + return(1); + } if (!host || !*host) return 0; return wildmatch(tok, host); } -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: [EMAIL PROTECTED] Remember Cernan and Schmitt -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html