faubackup faubackup-find.8,1.5,1.6 faubackup-find.pl,1.8,1.9

[email protected]
Newsgroups gmane.comp.sysutils.backup.faubackup.cvs
Message-ID <[email protected]>
Update of /cvsroot/faubackup/faubackup
In directory sc8-pr-cvs1:/tmp/cvs-serv24626

Modified Files:
	faubackup-find.8 faubackup-find.pl 
Log Message:
use command-line option to disable regexps in faubackup-find


Index: faubackup-find.8
===================================================================
RCS file: /cvsroot/faubackup/faubackup/faubackup-find.8,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** faubackup-find.8	26 Aug 2003 05:36:04 -0000	1.5
--- faubackup-find.8	31 Aug 2003 18:10:41 -0000	1.6
***************
*** 21,25 ****
  
  .SH SYNOPSIS
! \fBfaubackup-find\fP [\fIregexp\fP]...
  
  
--- 21,25 ----
  
  .SH SYNOPSIS
! \fBfaubackup-find\fP [\fB--noregexp\fP] [\fIregexp\fP]...
  
  
***************
*** 47,50 ****
--- 47,54 ----
  The second form, Perl regexps can be used by prepending them
  with 'REGEXP:'.
+ As Perl regular expressions may be used for malicous things,
+ it is possible to disable all Perl regexps via the command line
+ option \fB--noregexp\fP.
+ 
  Both types of filters are matched against the relative
  path of files (with an implicit ^ at the beginning and $ at the end).

Index: faubackup-find.pl
===================================================================
RCS file: /cvsroot/faubackup/faubackup/faubackup-find.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** faubackup-find.pl	26 Aug 2003 05:34:41 -0000	1.8
--- faubackup-find.pl	31 Aug 2003 18:10:41 -0000	1.9
***************
*** 20,23 ****
--- 20,24 ----
  
  my $verbose;
+ my $useregexp = 1;
  
  # little bit more shell like matching
***************
*** 33,41 ****
  	print STDERR "match2regexp: '$regexp' -> " if $verbose;
  	if( $regexp =~ /^REGEXP:\s*(.*)$/ ) {
! 		if( $ENV{'FAUBACKUP_FIND'} =~ /noregexp/i ) {
  			# replace with known invalid one, check_ignore will warn
! 			$regexp = "$1/ :-(";
! 		} else {
! 			$regexp = $1;
  		}
  	} else {
--- 34,41 ----
  	print STDERR "match2regexp: '$regexp' -> " if $verbose;
  	if( $regexp =~ /^REGEXP:\s*(.*)$/ ) {
! 		$regexp = $1;
! 		if( !$useregexp ) {
  			# replace with known invalid one, check_ignore will warn
! 			$regexp += "/ :-(";
  		}
  	} else {
***************
*** 156,159 ****
--- 156,164 ----
  my @ignorelist;
  foreach (@ARGV) {
+ 	if( /^--noregexp$/ ) { #check for the only option
+ 		$useregexp = 0;
+ 		next;
+ 	}
+ 	# interpret argument as an ignore-match
  	my $regexp = match2regexp $_;
  	check_ignore($regexp, "command line ignore list") or next;




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.