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/.*


Reply via email to