summaryrefslogtreecommitdiff
path: root/NEWS
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2013-10-04 07:32:12 -0700
committerJim Meyering <meyering@fb.com>2013-10-09 20:25:34 -0700
commit70aa35b2b4d2e723fe82ac3184e5921a52be73ab (patch)
tree99f7aeccec390116b231c3a990b8e23e722b6d89 /NEWS
parent1c659d5cc6830c6f4f26660e9049582afbad3fd3 (diff)
downloadparted-70aa35b2b4d2e723fe82ac3184e5921a52be73ab.tar.gz
dos: improve MBR signature generation
Using tv_usec in struct timeval from gettimeofday() doesn't provide enough precision to fill an unsigned 32-bit integer and isn't really random. It it always less than one million when using the GNU C library while an unsigned 32-bit integer ranges between 0 and 4294967295. In FAT filesystem creation, parted already uses a better random generator, so move that code into a common function and use it for MS-DOS MBR signature generation. * libparted/fs/r/fat/fat.c (_gen_new_serial_number): Remove. (fat_create): Use generate_random_uint32 instead of _gen_new_serial_number. * libparted/labels/dos.c (generate_random_id): Remove. (msdos_write): Use generate_random_uint32 instead of generate_random_id. * libparted/labels/misc.h (generate_random_uint32): New function. Created from _gen_new_serial_number in libparted/fs/r/fat/fat.c with additional check to avoid returning zero, which may be interpreted as no FAT serial number or no MBR signature.
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS4
1 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 98f7c6e..50faf4d 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,10 @@ GNU parted NEWS -*- outline -*-
partprobe now tells the kernel to forget about any partitions
on a device that has no recognizable partition table.
+ dos: the range of random MBR signature values was artificially limited
+ to 0..999999, which mistakenly included 0. Now, we use the full 32-bit
+ range, but exclude 0.
+
** Changes in behavior
parted -l no longer lists device-mapper devices other than