linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: <linux-ext4@vger.kernel.org>
Cc: <tytso@mit.edu>, <dvhart@linux.intel.com>, <darrick.wong@oracle.com>
Subject: [PATCH 1/2] debugfs.c: the max length of debugfs argument is too short
Date: Mon, 29 Jul 2013 17:06:24 +0800	[thread overview]
Message-ID: <1375088785-30653-2-git-send-email-liezhi.yang@windriver.com> (raw)
In-Reply-To: <1375088785-30653-1-git-send-email-liezhi.yang@windriver.com>

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>
---
 debugfs/debugfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 2660218..a6bc932 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;
@@ -2311,7 +2315,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;
-- 
1.8.1.2


  reply	other threads:[~2013-07-29  9:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29  9:06 [PATCH 0/2 V3] e2fsprogs/debugfs: do sparse copy when src is a sparse file Robert Yang
2013-07-29  9:06 ` Robert Yang [this message]
2013-07-29  9:06 ` [PATCH 2/2] debugfs.c: " Robert Yang
2013-08-19 22:43   ` Darren Hart
2013-08-06  1:46 ` [PATCH 0/2 V3] e2fsprogs/debugfs: " Robert Yang
  -- strict thread matches above, loose matches on Subject: below --
2013-07-26 10:30 [PATCH 0/2 V2] " Robert Yang
2013-07-26 10:30 ` [PATCH 1/2] debugfs.c: the max length of debugfs argument is too short Robert Yang
2013-07-29  2:37   ` Theodore Ts'o
2013-07-29  7:16     ` Robert Yang
2013-07-19  2:17 [PATCH 0/2] e2fsprogs/debugfs: do sparse copy when src is a sparse file Robert Yang
2013-07-19  2:17 ` [PATCH 1/2] debugfs.c: the max length of debugfs argument is too short Robert Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375088785-30653-2-git-send-email-liezhi.yang@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=darrick.wong@oracle.com \
    --cc=dvhart@linux.intel.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).