bring manpage and debug code of exportfs -P closer to reality

This commit is contained in:
cinap_lenrek 2012-02-07 03:29:58 +01:00
parent 5acde1e791
commit d970ed6a5a
2 changed files with 5 additions and 5 deletions

View file

@ -126,7 +126,7 @@ contains one regular expression per line,
to be matched against path names to be matched against path names
relative to the current working directory relative to the current working directory
and starting with and starting with
.BR ./ . .BR / .
For a file to be exported, all lines with a prefix For a file to be exported, all lines with a prefix
.B + .B +
must match and all those with prefix must match and all those with prefix
@ -204,7 +204,7 @@ To export the archive of one user for one month, except for secrets,
.IP .IP
.EX .EX
cd /n/dump cd /n/dump
echo '+ ^\e.(/2003(/10..(/usr(/glenda/?)?)?)?)?' > /tmp/pattern echo '+ ^/(2003(/10..(/usr(/glenda/?)?)?)?)?' > /tmp/pattern
echo '- \e.(aes|pgp)$' >> /tmp/pattern echo '- \e.(aes|pgp)$' >> /tmp/pattern
exportfs -P /tmp/pattern exportfs -P /tmp/pattern
.EE .EE

View file

@ -80,16 +80,16 @@ excludefile(char *path)
else else
p = path+1; p = path+1;
DEBUG(DFD, "checking %s\n", path); DEBUG(DFD, "checking %s\n", p);
for(re = include; *re != nil; re++){ 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", path); DEBUG(DFD, "excluded+ %s\n", p);
return -1; return -1;
} }
} }
for(re = exclude; *re != nil; re++){ for(re = exclude; *re != nil; re++){
if(regexec(*re, p, nil, 0) == 1){ if(regexec(*re, p, nil, 0) == 1){
DEBUG(DFD, "excluded- %s\n", path); DEBUG(DFD, "excluded- %s\n", p);
return -1; return -1;
} }
} }