Compare commits
2 Commits
Author | SHA256 | Date | |
---|---|---|---|
e63d0ab96f | |||
aedd3ca563 |
@@ -0,0 +1,66 @@
|
|||||||
|
From 2803a7fb99eda58e39b2cb891fecd45498d0b508 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Frediano Ziglio <frediano.ziglio@cloud.com>
|
||||||
|
Date: Mon, 18 Dec 2023 10:36:01 +0000
|
||||||
|
Subject: [PATCH] Do not check for writable device if we don't need it
|
||||||
|
|
||||||
|
If justLooking is true we are just going to close and open
|
||||||
|
the device again (even on errors opening) so there won't be
|
||||||
|
visible changes however opening the device for writing will
|
||||||
|
cause Linux to attempt reloading partitions even if we aren't
|
||||||
|
changing anything.
|
||||||
|
|
||||||
|
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
|
||||||
|
---
|
||||||
|
gpt.cc | 32 +++++++++++++++++---------------
|
||||||
|
1 file changed, 17 insertions(+), 15 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/gpt.cc b/gpt.cc
|
||||||
|
index 24d6918..7b42c3c 100644
|
||||||
|
--- a/gpt.cc
|
||||||
|
+++ b/gpt.cc
|
||||||
|
@@ -834,25 +834,27 @@ int GPTData::LoadPartitions(const string & deviceFilename) {
|
||||||
|
int err, allOK = 1;
|
||||||
|
MBRValidity mbrState;
|
||||||
|
|
||||||
|
- if (myDisk.OpenForRead(deviceFilename)) {
|
||||||
|
- err = myDisk.OpenForWrite(deviceFilename);
|
||||||
|
- if ((err == 0) && (!justLooking)) {
|
||||||
|
- cout << "\aNOTE: Write test failed with error number " << errno
|
||||||
|
- << ". It will be impossible to save\nchanges to this disk's partition table!\n";
|
||||||
|
+ if (!justLooking) {
|
||||||
|
+ if (myDisk.OpenForRead(deviceFilename)) {
|
||||||
|
+ err = myDisk.OpenForWrite(deviceFilename);
|
||||||
|
+ if (err == 0) {
|
||||||
|
+ cout << "\aNOTE: Write test failed with error number " << errno
|
||||||
|
+ << ". It will be impossible to save\nchanges to this disk's partition table!\n";
|
||||||
|
#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
|
||||||
|
- cout << "You may be able to enable writes by exiting this program, typing\n"
|
||||||
|
- << "'sysctl kern.geom.debugflags=16' at a shell prompt, and re-running this\n"
|
||||||
|
- << "program.\n";
|
||||||
|
+ cout << "You may be able to enable writes by exiting this program, typing\n"
|
||||||
|
+ << "'sysctl kern.geom.debugflags=16' at a shell prompt, and re-running this\n"
|
||||||
|
+ << "program.\n";
|
||||||
|
#endif
|
||||||
|
#if defined (__APPLE__)
|
||||||
|
- cout << "You may need to deactivate System Integrity Protection to use this program. See\n"
|
||||||
|
- << "https://www.quora.com/How-do-I-turn-off-the-rootless-in-OS-X-El-Capitan-10-11\n"
|
||||||
|
- << "for more information.\n";
|
||||||
|
+ cout << "You may need to deactivate System Integrity Protection to use this program. See\n"
|
||||||
|
+ << "https://www.quora.com/How-do-I-turn-off-the-rootless-in-OS-X-El-Capitan-10-11\n"
|
||||||
|
+ << "for more information.\n";
|
||||||
|
#endif
|
||||||
|
- cout << "\n";
|
||||||
|
- } // if
|
||||||
|
- myDisk.Close(); // Close and re-open read-only in case of bugs
|
||||||
|
- } else allOK = 0; // if
|
||||||
|
+ cout << "\n";
|
||||||
|
+ } // if
|
||||||
|
+ myDisk.Close(); // Close and re-open read-only in case of bugs
|
||||||
|
+ } else allOK = 0; // if
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (allOK && myDisk.OpenForRead(deviceFilename)) {
|
||||||
|
// store disk information....
|
||||||
|
--
|
||||||
|
2.49.0
|
||||||
|
|
@@ -0,0 +1,57 @@
|
|||||||
|
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] 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.36.1
|
||||||
|
|
BIN
gptfdisk-1.0.10.tar.gz
(Stored with Git LFS)
BIN
gptfdisk-1.0.10.tar.gz
(Stored with Git LFS)
Binary file not shown.
36
gptfdisk-1.0.9-libuuid.patch
Normal file
36
gptfdisk-1.0.9-libuuid.patch
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
From e67faca2c0ca955f56cbd22e90941cdcbdc12597 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Rod Smith <rodsmith@rodsbooks.com>
|
||||||
|
Date: Sat, 16 Apr 2022 09:32:04 -0400
|
||||||
|
Subject: [PATCH] Updated guid.cc to deal with minor change in libuuid
|
||||||
|
|
||||||
|
---
|
||||||
|
NEWS | 3 +++
|
||||||
|
guid.cc | 2 +-
|
||||||
|
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
Index: gptfdisk-1.0.9/NEWS
|
||||||
|
===================================================================
|
||||||
|
--- gptfdisk-1.0.9.orig/NEWS
|
||||||
|
+++ gptfdisk-1.0.9/NEWS
|
||||||
|
@@ -1,6 +1,8 @@
|
||||||
|
1.0.10 (?/??/2022):
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
+- Updated guid.cc to deal with minor change in libuuid.
|
||||||
|
+
|
||||||
|
- 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
|
||||||
|
Index: gptfdisk-1.0.9/guid.cc
|
||||||
|
===================================================================
|
||||||
|
--- gptfdisk-1.0.9.orig/guid.cc
|
||||||
|
+++ gptfdisk-1.0.9/guid.cc
|
||||||
|
@@ -141,7 +141,7 @@ void GUIDData::Zero(void) {
|
||||||
|
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);
|
BIN
gptfdisk-1.0.9.tar.gz
(Stored with Git LFS)
Normal file
BIN
gptfdisk-1.0.9.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
37
gptfdisk-fix-null-pointer-dereference.patch
Normal file
37
gptfdisk-fix-null-pointer-dereference.patch
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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] 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;
|
@@ -1,17 +1,8 @@
|
|||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Feb 20 09:38:12 UTC 2025 - Thomas Blume <thomas.blume@suse.com>
|
Mon Jun 30 08:08:54 UTC 2025 - Thomas Blume <thomas.blume@suse.com>
|
||||||
|
|
||||||
- Update to release 1.0.10
|
- fix boot failure with qcow and vmdk images (bsc#1242987)
|
||||||
* Fix failure & crash of sgdisk when compiled with latest popt
|
* 0001-Do-not-check-for-writable-device-if-we-don-t-need-it.patch
|
||||||
* Fix NULL dereference when duplicating string argument
|
|
||||||
* Allow partition dynamically allocated by --largest-new to be
|
|
||||||
referenced by other options
|
|
||||||
* Truncate decimal inputs (e.g. "9.5G" becomes "9G")
|
|
||||||
* New partition type codes from the Discoverable Partitions
|
|
||||||
Specification
|
|
||||||
- Delete 0001-Fix-failure-crash-of-sgdisk-when-compiled-with-lates.patch
|
|
||||||
gptfdisk-1.0.9-libuuid.patch,
|
|
||||||
gptfdisk-fix-null-pointer-dereference.patch (merged)
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Sep 7 08:44:04 UTC 2023 - Fabian Vogt <fvogt@suse.com>
|
Thu Sep 7 08:44:04 UTC 2023 - Fabian Vogt <fvogt@suse.com>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package gptfdisk
|
# spec file for package gptfdisk
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2023 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: gptfdisk
|
Name: gptfdisk
|
||||||
Version: 1.0.10
|
Version: 1.0.9
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: GPT partitioning and MBR repair software
|
Summary: GPT partitioning and MBR repair software
|
||||||
License: GPL-2.0-only
|
License: GPL-2.0-only
|
||||||
@@ -26,6 +26,12 @@ URL: http://rodsbooks.com/gdisk
|
|||||||
#Git-Clone: https://git.code.sf.net/p/gptfdisk/code gptfdisk-code
|
#Git-Clone: https://git.code.sf.net/p/gptfdisk/code gptfdisk-code
|
||||||
#Git-Web: https://sourceforge.net/p/gptfdisk/code/ci/master/tree/
|
#Git-Web: https://sourceforge.net/p/gptfdisk/code/ci/master/tree/
|
||||||
Source: https://downloads.sf.net/%name/%name-%version.tar.gz
|
Source: https://downloads.sf.net/%name/%name-%version.tar.gz
|
||||||
|
Patch1: 0001-Fix-failure-crash-of-sgdisk-when-compiled-with-lates.patch
|
||||||
|
# PATCH-FIX-UPSTREAM gptfdisk-fix-null-pointer-dereference.patch bsc#1208877 alynx.zhou@suse.com -- Fix NULL pointer dereference in previous patch
|
||||||
|
Patch2: gptfdisk-fix-null-pointer-dereference.patch
|
||||||
|
# PATCH-FIX-UPSTREAM https://bugs.gentoo.org/844073 https://sourceforge.net/p/gptfdisk/code/ci/6a8416cbd12d55f882bb751993b94f72d338d96f/
|
||||||
|
Patch3: gptfdisk-1.0.9-libuuid.patch
|
||||||
|
Patch4: 0001-Do-not-check-for-writable-device-if-we-don-t-need-it.patch
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
BuildRequires: ncurses-devel
|
BuildRequires: ncurses-devel
|
||||||
BuildRequires: pkgconfig(popt)
|
BuildRequires: pkgconfig(popt)
|
||||||
|
Reference in New Issue
Block a user