From: Eric Sandeen Date: Wed, 29 Jul 2015 23:17:43 +0000 (+1000) Subject: metadump: Obfuscate the filesystem label X-Git-Tag: v3.2.4~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8927d44b632cfdf49338a12b0b7a7a58a474de98;p=thirdparty%2Fxfsprogs-dev.git metadump: Obfuscate the filesystem label Not a lot of room for sensitive data, but while we're at it... There is no need to do the normal hashed name, we just replace it with "L's" - and for kicks, we preserve the length of the label. Signed-off-by: Eric Sandeen Signed-off-by: Eric Sandeen Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- diff --git a/db/metadump.c b/db/metadump.c index bea5de7c3..5cc1ece98 100644 --- a/db/metadump.c +++ b/db/metadump.c @@ -2049,6 +2049,13 @@ scan_ag( if (stop_on_read_error) goto pop_out; } else { + /* Replace any filesystem label with "L's" */ + if (obfuscate) { + struct xfs_sb *sb = iocur_top->data; + memset(sb->sb_fname, 'L', + min(strlen(sb->sb_fname), sizeof(sb->sb_fname))); + iocur_top->need_crc = 1; + } if (write_buf(iocur_top)) goto pop_out; }