diff options
author | Theodore Ts'o <tytso@mit.edu> | 2012-02-14 17:01:48 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-02-15 16:18:29 -0500 |
commit | 8a1da3c5ae5d042c272fbcf5ea222ca561f566a5 (patch) | |
tree | 842092d0a711e16891a48946f161f752c4b74d57 /debugfs | |
parent | 454ac9d56acb643c48222c71f2b0e63926783b17 (diff) | |
download | android_external_e2fsprogs-8a1da3c5ae5d042c272fbcf5ea222ca561f566a5.tar.gz android_external_e2fsprogs-8a1da3c5ae5d042c272fbcf5ea222ca561f566a5.tar.bz2 android_external_e2fsprogs-8a1da3c5ae5d042c272fbcf5ea222ca561f566a5.zip |
debugfs: use ss_safe_getenv() instead of getenv()
In the case where debugfs (or rdebugfs) is installed setgid disk, or
some such, we need to disable the use of environment variables for the
obvious reasons.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'debugfs')
-rw-r--r-- | debugfs/util.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/debugfs/util.c b/debugfs/util.c index 7cbf34df..f43b4704 100644 --- a/debugfs/util.c +++ b/debugfs/util.c @@ -26,6 +26,7 @@ extern char *optarg; extern int optreset; /* defined by BSD, but not others */ #endif +#include "ss/ss.h" #include "debugfs.h" /* @@ -79,14 +80,14 @@ static const char *find_pager(char *buf) FILE *open_pager(void) { FILE *outfile = 0; - const char *pager = getenv("DEBUGFS_PAGER"); + const char *pager = ss_safe_getenv("DEBUGFS_PAGER"); char buf[80]; signal(SIGPIPE, SIG_IGN); if (!isatty(1)) return stdout; if (!pager) - pager = getenv("PAGER"); + pager = ss_safe_getenv("PAGER"); if (!pager) pager = find_pager(buf); if (!pager || @@ -197,7 +198,7 @@ char *time_to_string(__u32 cl) if (do_gmt == -1) { /* The diet libc doesn't respect the TZ environemnt variable */ - tz = getenv("TZ"); + tz = ss_safe_getenv("TZ"); if (!tz) tz = ""; do_gmt = !strcmp(tz, "GMT"); |