These changes have been made to the sup fileserver that runs on freefall.cdrom.com. They are being incorporated into the SUP port per phk@freebsd.org's request. *** scm.c Sun Jun 19 23:04:04 1994 --- scm.c Thu Oct 6 23:14:59 1994 *************** *** 522,527 **** --- 522,529 ---- struct hostent *h; struct in_addr addr; char **ap; + if(!strcmp(name,"*")) + return (1); if ((addr.s_addr = inet_addr(name)) != (u_long) INADDR_NONE) return (addr.s_addr == remoteaddr.s_addr); if ((h = gethostbyname (name)) == 0) *** supfilesrv.c Thu Aug 11 06:24:46 1994 --- supfilesrv.c Thu Oct 6 22:56:36 1994 *************** *** 280,285 **** --- 280,286 ---- uid_t getuid (); int maxchildren; + int maxfriends = -1; /* * These are used to save the stat information from the crosspatch crypt *************** *** 329,334 **** --- 330,336 ---- extern int netfile; char *clienthost; /* host name of client */ + int friend; /* The client is a friend of us */ int nchildren; /* number of children that exist */ char *prefix; /* collection pathname prefix */ char *release; /* collection release name */ *************** *** 500,505 **** --- 502,513 ---- argv++; maxchildren = atoi(argv[0]); break; + case 'F': + if (--argc < 1) + quit (1,"Missing arg to -F\n"); + argv++; + maxfriends = atoi(argv[0]); + break; case 'H': if (--argc < 3) quit (1,"Missing args to -H\n"); *************** *** 517,522 **** --- 525,535 ---- --argc; argv++; } + if (maxfriends == -1) + maxfriends = 2*maxchildren; + else + maxfriends += maxchildren; /* due to the way we check */ + if (clienthost == NULL) { if (argc != 0) usage (); *************** *** 824,830 **** if (prefix) (void) chdir (basedir); if (x < 0) goaway ("Can't stat base/prefix directory"); ! if (nchildren >= maxchildren) { setupack = FSETUPBUSY; (void) msgsetupack (); if (protver >= 6) longjmp (sjbuf,TRUE); --- 837,843 ---- if (prefix) (void) chdir (basedir); if (x < 0) goaway ("Can't stat base/prefix directory"); ! if (nchildren >= maxfriends) { setupack = FSETUPBUSY; (void) msgsetupack (); if (protver >= 6) longjmp (sjbuf,TRUE); *************** *** 861,867 **** q = nxtarg (&p," \t"); if ((not = (*q == '!')) && *++q == '\0') q = nxtarg (&p," \t"); ! hostok = (not == (matchhost(q) == 0)); if (hostok) { while ((*p == ' ') || (*p == '\t')) p++; if (*p) cryptkey = salloc (p); --- 874,889 ---- q = nxtarg (&p," \t"); if ((not = (*q == '!')) && *++q == '\0') q = nxtarg (&p," \t"); ! if ((friend = (*q == '+')) && *++q == '\0') ! q = nxtarg (&p," \t"); ! hostok = matchhost(q); ! if (hostok && not) { ! setupack = FSETUPHOST; ! (void) msgsetupack (); ! if (protver >= 6) longjmp (sjbuf,TRUE); ! goaway ("Host blacklisted for %s", ! collname); ! } if (hostok) { while ((*p == ' ') || (*p == '\t')) p++; if (*p) cryptkey = salloc (p); *************** *** 877,882 **** --- 899,910 ---- collname); } } + } + if (!friend && nchildren >= maxchildren) { + setupack = FSETUPBUSY; + (void) msgsetupack (); + if (protver >= 6) longjmp (sjbuf,TRUE); + goaway ("Sup client told to try again later"); } /* try to lock collection */ (void) sprintf (buf,FILELOCK,collname);