From mboxrd@z Thu Jan 1 00:00:00 1970 From: arisawa Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <73CCEA09-C492-439D-9E8A-AA2BA9CB93DB@ar.aichi-u.ac.jp> Date: Thu, 17 Dec 2015 08:31:15 +0900 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: [9fans] bug in exportfs Topicbox-Message-UUID: 7a8fcbd4-ead9-11e9-9d60-3106f5b1d025 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/.*