9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] bug in exportfs
@ 2015-12-16 23:31 arisawa
  2015-12-17 11:40 ` Peter Hull
  0 siblings, 1 reply; 29+ messages in thread
From: arisawa @ 2015-12-16 23:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


Hello,

It seems cpu command is buggy in -P option.
the sources of the problem is in command option -P of exportfs.

I believe /sys/src/cmd/exportfs/pattern.c should be fixed as follows:

int
excludefile(char *path)
{
	Reprog **re;
	char *p;

	if(*(path+1) == 0)
		p = "/";
	else
		p = path+1;

	DEBUG(DFD, "checking %s\n", p);
	for(re = include; *re != nil; re++){
-		if(regexec(*re, p, nil, 0) != 1){
+		if(regexec(*re, p, nil, 0) == 1){
			DEBUG(DFD, "excluded+ %s\n", p);
-			return -1;
+			return 0;
		}
	}
	for(re = exclude; *re != nil; re++){
		if(regexec(*re, p, nil, 0) == 1){
			DEBUG(DFD, "excluded- %s\n", p);
			return -1;
		}
	}
	return 0;
}


patternfile sample
+ /usr/arisawa
+ /usr/glenda
- /adm
- /sys/log
- /mail
- /usr/.*




^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2016-02-19 14:12 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-16 23:31 [9fans] bug in exportfs arisawa
2015-12-17 11:40 ` Peter Hull
2015-12-17 13:05   ` arisawa
2015-12-22  9:25     ` Peter Hull
2015-12-22 10:02       ` arisawa
2016-02-13 14:26         ` Charles Forsyth
2016-02-14  2:00           ` Prof Brucee
2016-02-14 10:27             ` hiro
2016-02-14 12:21               ` Charles Forsyth
2016-02-14 12:33           ` Charles Forsyth
2016-02-14 16:38             ` cinap_lenrek
2016-02-14 22:57               ` Charles Forsyth
2016-02-15  1:05                 ` arisawa
2016-02-15  6:12                   ` Bruce Ellis
2016-02-15 10:34                   ` Charles Forsyth
2016-02-15 10:55                     ` lucio
2016-02-15 12:08                       ` Charles Forsyth
2016-02-15 12:13                         ` Brantley Coile
2016-02-15 15:05                           ` lucio
2016-02-15 15:24                             ` erik quanstrom
2016-02-15 12:44                         ` lucio
2016-02-15 12:48                           ` Charles Forsyth
2016-02-15 14:03                             ` lucio
2016-02-15 15:38                           ` erik quanstrom
2016-02-15 15:56                             ` Skip Tavakkolian
2016-02-15 12:18                       ` Charles Forsyth
2016-02-15 15:30                     ` erik quanstrom
2016-02-15 23:32                       ` Charles Forsyth
2016-02-19 14:12                   ` Charles Forsyth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).