[Top] [All Lists]

[PATCH, v2] xfsdump: fix format string in restore_spec()

To: xfs@xxxxxxxxxxx
Subject: [PATCH, v2] xfsdump: fix format string in restore_spec()
From: Alex Elder <elder@xxxxxxxxxxx>
Date: Thu, 27 Dec 2012 08:10:14 -0600
In-reply-to: <50DB794F.7010906@xxxxxxxxxxx>
References: <50D7A1C2.9000609@xxxxxxxxxxxxxxx> <50DB794F.7010906@xxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0
Nigel Tamplin reported getting a seg fault in xfsrestore when a path
name was too long.  He correctly diagnosed that the problem was due
to an extra "%s" format specifier in the format value passed to a
call to mlog().  This patch corrects that.

Signed-off-by: Alex Elder <elder@xxxxxxxxxxx>
Reported-by: Nigel Tamplin <ntamplin@xxxxxxxxxxxxxxx>
Tested-by: Nigel Tamplin <ntamplin@xxxxxxxxxxxxxxx>
v2: drop the %s rather than adding a strerror() call for it

 restore/content.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/restore/content.c
--- a/restore/content.c
+++ b/restore/content.c
@@ -7796,7 +7796,7 @@ restore_spec( filehdr_t *fhdrp, rv_t *rv
                        if ( strlen( path ) >= sizeof( addr.sun_path )) {
                                mlog( MLOG_VERBOSE | MLOG_WARNING, _(
                                      "pathname too long for bind of "
-                                     "%s ino %llu %s: %s: discarding\n"),
+                                     "%s ino %llu %s: discarding\n"),
                                      path );

<Prev in Thread] Current Thread [Next in Thread>