git.samba.org
/
bbaumbach
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c1d70a
)
expand-includes: Add simple protection against infinite recursion.
author
Jelmer Vernooij
<jelmer@samba.org>
Wed, 21 Jan 2009 16:32:08 +0000
(17:32 +0100)
committer
Jelmer Vernooij
<jelmer@samba.org>
Wed, 21 Jan 2009 16:32:08 +0000
(17:32 +0100)
source3/script/expand-includes.pl
patch
|
blob
|
history
diff --git
a/source3/script/expand-includes.pl
b/source3/script/expand-includes.pl
index da643630810a2143fa42f106929b856e4904b822..33fc44b267f986caea64e520cceacf69600dd2b4 100755
(executable)
--- a/
source3/script/expand-includes.pl
+++ b/
source3/script/expand-includes.pl
@@
-3,9
+3,13
@@
# Copyright (C) 2009 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU GPLv3 or later
+my $depth = 0;
+
sub process($)
{
my ($f) = @_;
+ $depth++;
+ die("Recursion in $f?") if ($depth > 100);
open(IN, $f) or die("Unable to open $f: $!");
foreach (<IN>) {
my $l = $_;
@@
-15,6
+19,7
@@
sub process($)
print $l;
}
}
+ $depth--;
}
my $path = shift;