diff options
author | Theodore Ts'o <tytso@mit.edu> | 2006-11-12 17:43:50 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2006-11-12 17:43:50 -0500 |
commit | 98224fbc1db8387da1fe0fd1bb3be25c18be2e98 (patch) | |
tree | ca50d7228f948c3886d2e3ecf0e83674c714f762 | |
parent | 05155f9bff3935bd45a506a0fe0a277070d23094 (diff) | |
download | e2fsprogs-98224fbc1db8387da1fe0fd1bb3be25c18be2e98.tar.gz |
Avoid infinite substitution loop in subst caused by autoconf pre-v2.60
Autoconf versions before 2.60 don't have datarootdir defined, and so this
resulted in a @datarootdir@ --> @datarootdir@ infinite expansion.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | util/ChangeLog | 7 | ||||
-rw-r--r-- | util/subst.c | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index b9ca5c5f..5f8f89a4 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,10 @@ +2006-11-12 Theodore Tso <tytso@mit.edu> + + * subst.c (substitute_line): Avoid infinite loop caused by a + substition such as @datarootdir@ --> @datarootdir@. (This + was caused by autoconf versions before 2.60, which didn't + define the @datarootdir@ expansion. + 2006-10-22 Theodore Tso <tytso@mit.edu> * subst.conf.in: Add datarootdir definition for compatibility with diff --git a/util/subst.c b/util/subst.c index 9244e620..445d3186 100644 --- a/util/subst.c +++ b/util/subst.c @@ -165,6 +165,12 @@ static void substitute_line(char *line) #endif ptr = name_ptr-1; replace_string(ptr, end_ptr, ent->value); + if ((ent->value[0] == '@') && + (strlen(replace_name) == strlen(ent->value)-2) && + !strncmp(replace_name, ent->value+1, + strlen(ent->value)-2)) + /* avoid an infinite loop */ + ptr += strlen(ent->value); } /* * Now do a second pass to expand ${FOO} |