gptfdisk: update to 1.0.10.

This commit is contained in:
Andrew J. Hesford 2024-02-24 12:59:26 -05:00
parent f59d5d006e
commit 1447edb198
3 changed files with 3 additions and 114 deletions

View File

@ -1,14 +0,0 @@
https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1853985.html
https://sourceforge.net/p/gptfdisk/code/ci/6a8416cbd12d55f882bb751993b94f72d338d96f/
--- a/guid.cc
+++ b/guid.cc
@@ -141,7 +141,7 @@
void GUIDData::Randomize(void) {
int i, uuidGenerated = 0;
-#ifdef _UUID_UUID_H
+#if defined (_UUID_UUID_H) || defined (_UL_LIBUUID_UUID_H)
uuid_generate(uuidData);
ReverseBytes(&uuidData[0], 4);
ReverseBytes(&uuidData[4], 2);

View File

@ -1,97 +0,0 @@
From 5d5e76d369a412bfb3d2cebb5fc0a7509cef878d Mon Sep 17 00:00:00 2001
From: Rod Smith <rodsmith@rodsbooks.com>
Date: Fri, 15 Apr 2022 18:10:14 -0400
Subject: [PATCH 1/2] Fix failure & crash of sgdisk when compiled with latest
popt (commit 740; presumably eventually release 1.19)
---
NEWS | 8 ++++++++
gptcl.cc | 2 +-
support.h | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/NEWS b/NEWS
index c7add56..9e153fd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+1.0.10 (?/??/2022):
+-------------------
+
+- Fixed problem that caused sgdisk to crash with errors about being unable
+ to read the disk's partition table when compiled with the latest popt
+ (commit 740, which is pre-release as I type; presumably version 1.19 and
+ later once released).
+
1.0.9 (4/14/2022):
------------------
diff --git a/gptcl.cc b/gptcl.cc
index 34c9421..0d578eb 100644
--- a/gptcl.cc
+++ b/gptcl.cc
@@ -155,7 +155,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
} // while
// Assume first non-option argument is the device filename....
- device = (char*) poptGetArg(poptCon);
+ device = strdup((char*) poptGetArg(poptCon));
poptResetContext(poptCon);
if (device != NULL) {
diff --git a/support.h b/support.h
index 8ba9ad1..f91f1bc 100644
--- a/support.h
+++ b/support.h
@@ -8,7 +8,7 @@
#include <stdlib.h>
#include <string>
-#define GPTFDISK_VERSION "1.0.9"
+#define GPTFDISK_VERSION "1.0.9.1"
#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__)
// Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64
--
2.40.1
From f5de3401b974ce103ffd93af8f9d43505a04aaf9 Mon Sep 17 00:00:00 2001
From: Damian Kurek <starfire24680@gmail.com>
Date: Thu, 7 Jul 2022 03:39:16 +0000
Subject: [PATCH 2/2] Fix NULL dereference when duplicating string argument
poptGetArg can return NULL if there are no additional arguments, which
makes strdup dereference NULL on strlen
---
gptcl.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gptcl.cc b/gptcl.cc
index 0d578eb..ab95239 100644
--- a/gptcl.cc
+++ b/gptcl.cc
@@ -155,10 +155,11 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
} // while
// Assume first non-option argument is the device filename....
- device = strdup((char*) poptGetArg(poptCon));
- poptResetContext(poptCon);
+ device = (char*) poptGetArg(poptCon);
if (device != NULL) {
+ device = strdup(device);
+ poptResetContext(poptCon);
JustLooking(); // reset as necessary
BeQuiet(); // Tell called functions to be less verbose & interactive
if (LoadPartitions((string) device)) {
@@ -498,6 +499,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
cerr << "Error encountered; not saving changes.\n";
retval = 4;
} // if
+ free(device);
} // if (device != NULL)
poptFreeContext(poptCon);
return retval;
--
2.40.1

View File

@ -1,7 +1,7 @@
# Template file for 'gptfdisk'
pkgname=gptfdisk
version=1.0.9
revision=3
version=1.0.10
revision=1
build_style=gnu-makefile
make_check_target=test
makedepends="ncurses-devel popt-devel libuuid-devel"
@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://www.rodsbooks.com/gdisk/"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=dafead2693faeb8e8b97832b23407f6ed5b3219bc1784f482dd855774e2d50c2
checksum=2abed61bc6d2b9ec498973c0440b8b804b7a72d7144069b5a9209b2ad693a282
pre_build() {
vsed -i 's#<ncursesw/ncurses.h>#<ncurses.h>#' gptcurses.cc