Re: [PATCH] libfdisk: Fix randomly generated GPT UUID's

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 05, 2023 at 03:57:55PM -0800, Toomas Losin wrote:
>  libfdisk/src/gpt.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks!

> 
> diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
> index d7b3e1c70..c3c0347cb 100644
> --- a/libfdisk/src/gpt.c
> +++ b/libfdisk/src/gpt.c
> @@ -878,9 +878,9 @@ static int gpt_mknew_header(struct fdisk_context *cxt,
>  	if (!has_id) {
>  		struct gpt_guid guid;
>  
> -		uuid_generate_random((unsigned char *) &header->disk_guid);
> -		guid = header->disk_guid;
> +		uuid_generate_random((unsigned char *) &guid);
>  		swap_efi_guid(&guid);
> +		header->disk_guid = guid;
>  	}

Good catch, stupid bug.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux