]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
metadump: Obfuscate the filesystem label
authorEric Sandeen <sandeen@sandeen.net>
Wed, 29 Jul 2015 23:17:43 +0000 (09:17 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 29 Jul 2015 23:17:43 +0000 (09:17 +1000)
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 <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/metadump.c

index bea5de7c332d5fd75ecef47b8bb5c8e0453c83b0..5cc1ece983e69bf7a53487eef808424f0f3891fb 100644 (file)
@@ -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;
        }