aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2005-12-31 16:21:00 -0500
committerTheodore Ts'o <tytso@mit.edu>2005-12-31 16:21:00 -0500
commit5dd2a6e08d0e65cde6444744a93ed4eb90b400c4 (patch)
tree228df1eeffc02e7e34f5ffd783ce3512e142a7dc
parentd3c7c4eb9889b2e027b0fdbec924f4df996f1f0a (diff)
downloade2fsprogs-5dd2a6e08d0e65cde6444744a93ed4eb90b400c4.tar.gz
e2fsprogs-5dd2a6e08d0e65cde6444744a93ed4eb90b400c4.tar.xz
e2fsprogs-5dd2a6e08d0e65cde6444744a93ed4eb90b400c4.zip
Add E2FSCK_CONFIG environment variable
Also, use this environtment variable to make sure that a local /etc/e2fsck.conf file will not interfere with the regression test suite. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--e2fsck/unix.c3
-rw-r--r--tests/test_config2
2 files changed, 5 insertions, 0 deletions
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index bb197276..708c2550 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -563,6 +563,7 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
struct sigaction sa;
#endif
char *extended_opts = 0;
+ char *cp;
retval = e2fsck_allocate_context(&ctx);
if (retval)
@@ -734,6 +735,8 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
if (extended_opts)
parse_extended_opts(ctx, extended_opts);
+ if ((cp = getenv("E2FSCK_CONFIG")) != NULL)
+ config_fn[0] = cp;
profile_init(config_fn, &ctx->profile);
if (flush) {
diff --git a/tests/test_config b/tests/test_config
index cb4e2f75..d021fef5 100644
--- a/tests/test_config
+++ b/tests/test_config
@@ -25,3 +25,5 @@ export TZ
LANG=C
export LANG
unset PAGER
+E2FSCK_CONFIG=/dev/null
+export E2FSCK_CONFIG