summaryrefslogtreecommitdiff
path: root/debugfs
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2013-10-13 22:07:57 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-10-13 22:07:57 -0400
commit355ffb2ff566229b8bc3f5f7557e91edff5a767a (patch)
treecab8ba42e68f5341db056d7952c628bcdeafe956 /debugfs
parent128c943ef2a0a82b8a4a8a9ca66f459e107bc877 (diff)
downloade2fsprogs-355ffb2ff566229b8bc3f5f7557e91edff5a767a.tar.gz
debugfs.c: the max length of debugfs argument is too short
The max length of debugfs argument is 256 which is too short, the arguments are two paths, the PATH_MAX is 4096 according to /usr/include/linux/limits.h, so use BUFSIZ (which is 8192 on Linux systems), that's also what the ss library uses. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'debugfs')
-rw-r--r--debugfs/debugfs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index cf559df1..4f190259 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -37,6 +37,10 @@ extern char *optarg;
#include "../version.h"
#include "jfs_user.h"
+#ifndef BUFSIZ
+#define BUFSIZ 8192
+#endif
+
ss_request_table *extra_cmds;
const char *debug_prog_name;
int sci_idx;
@@ -2293,7 +2297,7 @@ void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[])
static int source_file(const char *cmd_file, int ss_idx)
{
FILE *f;
- char buf[256];
+ char buf[BUFSIZ];
char *cp;
int exit_status = 0;
int retval;