OSDN Git Service
Jim Meyering [Sat, 3 Dec 2011 14:16:16 +0000 (15:16 +0100)]
build: configure.ac: use -Wno-format-nonliteral
Jim Meyering [Sat, 3 Dec 2011 13:57:26 +0000 (14:57 +0100)]
build: mark functions with "const" or "pure" attribute, per gcc warnings
Use _GL_ATTRIBUTE_PURE or _GL_ATTRIBUTE_CONST. Mark static functions at
point of definition; extern ones at point of declaration.
* include/parted/crc32.h:
* include/parted/device.h: Likewise.
* include/parted/disk.h: Likewise.
* include/parted/exception.h: Likewise.
* include/parted/filesys.h: Likewise.
* include/parted/geom.h: Likewise.
* include/parted/natmath.h: Likewise.
* include/parted/parted.h: Likewise.
* include/parted/unit.h: Likewise.
* libparted/arch/linux.c: Likewise.
* libparted/disk.c: Likewise.
* libparted/exception.c: Likewise.
* libparted/fs/amiga/amiga.h: Likewise.
* libparted/labels/aix.c: Likewise.
* libparted/labels/bsd.c: Likewise.
* libparted/labels/dos.c: Likewise.
* libparted/labels/dvh.c: Likewise.
* libparted/labels/efi_crc32.c: Likewise.
* libparted/labels/gpt.c: Likewise.
* libparted/labels/mac.c: Likewise.
* libparted/labels/pc98.c: Likewise.
* libparted/labels/rdb.c: Likewise.
* libparted/labels/sun.c: Likewise.
* libparted/unit.c: Likewise.
* parted/ui.c: Likewise.
* parted/strlist.c: Likewise.
* parted/strlist.h: Likewise.
* libparted/tests/common.h (_implemented_disk_label): Mark as pure.
* libparted/cs/natmath.c (extended_euclid): Mark as pure.
Jim Meyering [Sat, 3 Dec 2011 13:28:41 +0000 (14:28 +0100)]
build: avoid new float-to-double warnings
* libparted/timer.c (ped_timer_new_nested): Mark literal floating point
constants with "f" suffix, since they are compared against "float"s.
* parted/parted.c (_timer_handler): Likewise.
Jim Meyering [Sat, 3 Dec 2011 14:35:12 +0000 (15:35 +0100)]
build: tweak how bootstrap manages ChangeLog
* bootstrap.conf: Create ChangeLog only by touching it, so that
it doesn't ever remove my in-use symlink (w/vc-dwim).
Jim Meyering [Sat, 3 Dec 2011 14:36:36 +0000 (15:36 +0100)]
tests: two more of these: use "compare exp out", not "compare out exp"
* tests/t7000-scripting.sh: Reverse compare arguments.
* tests/t2310-dos-extended-2-sector-min-offset.sh: Likewise.
Jim Meyering [Tue, 29 Nov 2011 17:05:31 +0000 (18:05 +0100)]
tests: use "compare exp out", not "compare out exp"
Likewise, when an empty file is expected, use "compare /dev/null out",
not "compare out /dev/null". I.e., specify the expected/desired contents
via the first file name. Prompted by a suggestion from Bruno Haible
in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154
Run these commands:
git grep -l -E 'compare [^ ]+ exp' \
|xargs perl -pi -e 's/\b(compare) (\S+) (exp\S*)/$1 $3 $2/'
git grep -l -E 'compare [^ ]+ /dev/null' \
|xargs perl -pi -e 's,\b(compare) (\S+) (/dev/null),$1 $3 $2,'
Petr Uzel [Sat, 26 Nov 2011 14:45:09 +0000 (15:45 +0100)]
tests: test for partitions on mdraid
* tests/t6100-mdraid-partitions.sh: New file.
* tests/Makefile.am: Run this test.
Petr Uzel [Sat, 26 Nov 2011 14:45:08 +0000 (15:45 +0100)]
libparted: use ext_range to find out largest possible partition
Parted uses /sys/block/DEV/range file to find out how many partitions
can the blockdevice hold and uses this number in its algorithm
for informing the kernel about modified partitions. This works
fine for most devices, however, it fails on partitionable MD arrays,
because these have 1 in range file. Using ext_range should be safer
and work for all devices.
* libparted/arch/linux.c (_device_get_partition_range): Use
/sys/block/DEV/ext_range instead of range sysfs file
* NEWS: Mention the change.
Addresses: http://bugzilla.novell.com/567652
Petr Uzel [Sat, 26 Nov 2011 14:47:28 +0000 (15:47 +0100)]
build: gitignore tests/duplicate
.gitignore: Add tests/duplicate.
Jim Meyering [Fri, 11 Nov 2011 08:50:51 +0000 (09:50 +0100)]
maint: a little defensive programming in a test script
* tests/gpt-header-munge: Use "local *F;" to limit scope of
file handles.
Jim Meyering [Thu, 10 Nov 2011 18:15:29 +0000 (19:15 +0100)]
tests: skip a test if Perl's Digest::CRC module is not installed
* tests/init.cfg (require_perl_digest_crc_): New function.
* tests/t0210-gpt-resized-partition-entry-array.sh: Use it.
Reported by Keshav P R in
http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10530/focus=10589
Jim Meyering [Thu, 10 Nov 2011 11:14:08 +0000 (12:14 +0100)]
tests: fix test for udevadm
* tests/init.cfg (sector_size_): Fix syntax error in test invocation.
Jim Meyering [Thu, 10 Nov 2011 11:11:24 +0000 (12:11 +0100)]
maint: "make distcheck" now runs the root-only tests
* Makefile.am (root-check): New overridable variable and rule.
(distcheck-hook): Depend on it.
Jim Meyering [Thu, 10 Nov 2011 10:55:23 +0000 (11:55 +0100)]
build: update gnulib submodule to latest
Jim Meyering [Thu, 10 Nov 2011 10:54:50 +0000 (11:54 +0100)]
maint: adjust the URL that will appear in the generated announcement
* cfg.mk (url_dir_list): Use this http://ftp.gnu.org/gnu/$(PACKAGE)
for the first link listed in the generated announcement.
announce-gen now provides the faster mirror link automatically.
Remove now-unnecessary release-related URLs.
Jim Meyering [Sun, 6 Nov 2011 18:10:49 +0000 (19:10 +0100)]
build: update gnulib submodule to latest
Jim Meyering [Sun, 6 Nov 2011 18:09:56 +0000 (19:09 +0100)]
build: stop distributing gzip'd releases; xz is enough
* configure.ac (AM_INIT_AUTOMAKE): Add no-dist-gzip.
* NEWS (Build-related): Mention that we're dropping .tar.gz.
Jim Meyering [Sat, 5 Nov 2011 19:49:18 +0000 (20:49 +0100)]
tests: exercise and document the HFS-probe bug fix
Simply zeroing out the total_blocks and block_size members of the
on-disk _HfsMasterDirectoryBlock would provoke a failed assertion
any time parted tried to probe that partition.
* tests/t2500-probe-corrupt-hfs.sh: New script.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention this.
Brian C. Lane [Fri, 7 Oct 2011 23:53:48 +0000 (16:53 -0700)]
libparted: HFS/HFS+ probe: don't let a corrupt FS evoke failed assertion
* libparted/fs/hfs/probe.c (hfsplus_probe): Add a check on the
search value and reject it if it is negative.
(hfsx_probe): Likewise.
(hfs_and_wrapper_probe): Likewise.
Reported by Flos Lonicerae in http://bugzilla.redhat.com/714758
Brian C. Lane [Fri, 21 Oct 2011 20:46:53 +0000 (13:46 -0700)]
tests: t9030 wait for partition removal
The removal of the partition may take enough time that the next
mkpart will fail. Wait for it to be removed.
Remove scsi_debug size and set the end of the partition to 800s so that
it will fit inside the default scsi_debug size of 8M, even when sector
size is 4Kb. This prevents failures on machines with limited memory.
* tests/t9030-align-check.sh: Wait for partition removal and use
a smaller disk.
Jim Meyering [Fri, 4 Nov 2011 20:28:51 +0000 (21:28 +0100)]
tests: add a helper function
* tests/t-lib-helpers.sh (wait_for_dev_to_disappear_): New function.
Jim Meyering [Thu, 3 Nov 2011 10:09:47 +0000 (11:09 +0100)]
tests: exercise the "GPT vs other-sized partition entry arrays" fixes
* tests/t0210-gpt-resized-partition-entry-array.sh: New file.
* tests/Makefile.am (TESTS): Add it.
(EXTRA_DIST): Add gpt-header-munge.
Jim Meyering [Fri, 28 Oct 2011 18:05:15 +0000 (20:05 +0200)]
tests: rewrite/complete GPT-munging perl script
Rewrite and complete this script.
It was incomplete and buggy. Now it works.
* tests/gpt-header-munge: Rename from ...
* tests/perl-munge-9-PTE-table: ...this.
Jim Meyering [Thu, 3 Nov 2011 12:51:40 +0000 (13:51 +0100)]
gpt: don't misbehave with e.g., a 9-entry partition array
* libparted/labels/gpt.c (_generate_header): Correct size of
partition array entries to round up to nearest multiple of
sector size, so that we set gpt->PartitionEntryLBA correctly
also when the number of partition entries is not a multiple
of sector_size / 128. Problem diagnosed by Robert Herndon
in http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10173.
Robert Herndon [Sat, 29 Oct 2011 21:03:49 +0000 (23:03 +0200)]
gpt: prepare for tables with n_partition_array_entries != 128
* libparted/labels/gpt.c (gpt_read_PE_array): When computing the size
of the partition array entry, use the value of "number of partition
array entries" read from a GPT header, not the default of 128 that we
use when creating new headers. Details here:
http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10173
Jim Meyering [Thu, 3 Nov 2011 16:57:19 +0000 (17:57 +0100)]
parted: exit nonzero for certain failures already diagnosed as "Error"
* parted/parted.c (do_print): Do not exit successfully when issuing
an error about an "unrecognised disk label" or when both GPT primary
and backup tables are corrupted.
* tests/t0101-print-empty.sh: Adjust expected exit code to match
new behavior.
* NEWS (Bug fixes): Mention this.
Jim Meyering [Thu, 3 Nov 2011 15:59:07 +0000 (16:59 +0100)]
tests: adjust a test to make its failure easier to diagnose
* tests/t0203-gpt-tiny-device-abort.sh: When failing, also
emit parted's diagnostics.
Jim Meyering [Sat, 29 Oct 2011 20:34:14 +0000 (22:34 +0200)]
maint: correct two comments in gpt.c
* libparted/labels/gpt.c (gpt_read_headers): Correct the comment.
(_header_is_valid): Fix a harmless typo.
Brian C. Lane [Mon, 31 Oct 2011 23:35:17 +0000 (16:35 -0700)]
tests: add new test to check ped_disk_duplicate
* tests/duplicate.c: New test.
* tests/t0501-duplicate.sh: New test program.
* tests/Makefile.am (TEST): Add new test.
(check_PROGRAMS): Add new test program.
Brian C. Lane [Mon, 31 Oct 2011 23:35:16 +0000 (16:35 -0700)]
libparted: copy flags when duplicating GPT partitions
* libparted/labels/gpt.c (gpt_partition_duplicate): Copy flags to new
partition.
* NEWS: Mention this fix.
Reported by Chris Murphy in https://bugzilla.redhat.com/747497.
Petr Uzel [Sat, 22 Oct 2011 13:22:09 +0000 (15:22 +0200)]
tests: exercise the new feature
* tests/t0208-mkpart-end-in-IEC.sh: New file.
* tests/Makefile.am: Add it.
Petr Uzel [Sat, 22 Oct 2011 13:22:09 +0000 (15:22 +0200)]
parted: mkpart: DWIM for IEC ending sector numbers like 2MiB and 9GiB
Before, if the user specified start and end in mkpart command using
IEC units, parted created a partition that starts and ends exactly on
these positions. With such behavior, it is impossible to create
partitions as follows: 1MiB-2MiB, 2MiB-3MiB - parted would complain
that it cannot create the second partition, because the first one
occupied sectors 2048-4096 and the second one sectors 4096-3072,
so they would overlap at sector 4096.
With this patch, if the user uses IEC units to specify end of the
partition, parted creates the partition which ends one sector before
the specified position.
See also
https://lists.gnu.org/archive/html/bug-parted/2011-10/msg00009.html
* parted/ui.c (command_line_get_sector): Add parameter to retrieve
raw input from user.
* parted/ui.h (command_line_get_sector): Adjust prototype of function.
* parted/parted.c (_adjust_end_if_iec): New function.
(_strip_trailing_spaces): New function.
(_string_ends_with_iec_unit): New function.
(do_mkpart): Call _adjust_end_if_iec(). Use new parameter of
command_line_get_sector function.
(do_rescue): Adjust call to command_line_get_sector.
* bootstrap.conf (gnulib_modules): Add these: c-ctype, c-strcase.
* tests/t0207-IEC-binary-notation.sh: Adjust to new semantics.
* NEWS: Mention the changed behavior.
Notable adjustments:
- s/isspace/c_isblank/ so that parsing is locale-independent
- avoid an array-bounds error:
* parted/parted.c (_strip_trailing_spaces): Don't deref str[-1]
for an empty string.
Brian C. Lane [Fri, 7 Oct 2011 23:53:50 +0000 (16:53 -0700)]
tests: add tests for new pc98 signatures (#646053)
* tests/t2201-pc98-label-recog.sh: New file
* tests/Makefile.am: Add test
Brian C. Lane [Fri, 7 Oct 2011 23:53:49 +0000 (16:53 -0700)]
libparted: make pc98 detection depend on signatures
pc98 is not a common disk label. Change pc98_probe to only return true
if one of the recognized signatures is present.
Currently these include:
IPL1
Linux 98
GRUB/98
This prevents false-positive detection on msdos labeled disks.
* libparted/labels/pc98.c (pc98_probe): Change to require signature
(pc98_check_ipl_signature): Add more signatures
(check_partition_consistency): Remove unused function
Reported by Zach Carter in http://bugzilla.redhat.com/646053
Stefano Lattarini [Wed, 12 Oct 2011 09:18:47 +0000 (11:18 +0200)]
tests: use more portable fd redirection in TESTS_ENVIRONMENT
* tests/Makefile.am (TESTS_ENVIRONMENT): Redirection with `exec 9>&2'
is not portable to various Korn shells, and to (at least) HP-UX 11
/bin/sh. Use a more portable idiom.
See <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488> for
lots of discussion.
Stefano Lattarini [Mon, 10 Oct 2011 23:11:08 +0000 (01:11 +0200)]
tests: TEST_ENVIRONMENT simplified and made more robust
The test scripts in tests/ are shell scripts, so the current
definition of TESTS_ENVIRONMENT, which adaptively run tests using
either perl or the shell depending on their kind, is overkill.
Moreover, this change is required in order for the testsuite to
continue to work with the new testsuite harness that is planned
to be introduced in Automake 1.12 (which, as of the writing date,
is still under development and in late alpha state).
See also related discussion on bug-coreutils:
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8887>
* tests/help-version: Moved ...
* tests/help-version.sh: ... to this.
* tests/Makefile.am (TESTS): Update.
(TESTS_ENVIRONMENT): Remove definition of the `shell_or_perl_' shell
function, which is not required anymore.
(SH_LOG_COMPILER): New, define to `$(SHELL)'.
Richard W.M. Jones [Wed, 12 Oct 2011 20:54:24 +0000 (21:54 +0100)]
tests: fix the tests for the case where stdout/stderr is different
tests/t0000-basic.sh:
- More than one bogus ^M[[:space:]]*^M had to be removed, hence
use s,,,g sed expression.
tests/t0203-gpt-tiny-device-abort.sh:
- Test was not expecting any output to stderr. No longer true.
tests/t1100-busy-label.sh:
- Another case of s,,,g as above.
tests/t7000-scripting.sh:
- Only testing output to stdout. Fold stdout & stderr together
and test both.
- Another case of s,,,g as above.
Some root tests still fail even with these fixes. The failures appear
to be unrelated to these changes.
Richard W.M. Jones [Wed, 12 Oct 2011 21:16:35 +0000 (22:16 +0100)]
parted: write a few errors and warnings to stderr instead of stdout
Richard W.M. Jones [Wed, 12 Oct 2011 21:16:34 +0000 (22:16 +0100)]
parted: strlist print functions can now send output to any FILE *
This changes the two strlist print functions so that instead of just
sending output to stdout, they can send it to any FILE *. Now the
caller can send errors to stderr instead of stdout.
Petr Uzel [Mon, 10 Oct 2011 13:53:09 +0000 (15:53 +0200)]
parted: make a warning message more informative
The following parted message is not very useful:
Error: You requested a partition from 2.00MiB to 3.00MiB.
The closest location we can manage is 2.00MiB to 3.00MiB.
Improve the message by including exact geometry (in sectors):
...requested a partition from 2.00MiB to 3.00MiB (sectors 2048..3072).
... location we can manage is 2.00MiB to 3.00MiB (sectors 2049..3072).
* parted/parted.c (do_mkpart): Include exact partition geometry in
the warning message.
* tests/t-lib-helpers.sh (normalize_part_diag_): Adapt to
handle the new form of the diagnostic.
* tests/t7000-scripting.sh: Adapt and change the name
of a temporary file.
Petr Uzel [Mon, 3 Oct 2011 15:15:32 +0000 (17:15 +0200)]
doc: update manpage
Remove documentation for removed commands, adjust general description to
match parted's capabilities, add documentation for 'toggle' and
'align-check' commands. Remove 'KNOWN ISSUES' section since it no longer
applies.
Petr Uzel [Mon, 3 Oct 2011 13:00:58 +0000 (15:00 +0200)]
tests: verify that 'udevadm settle' is available
* tests/init.cfg (require_udevadm_settle_): New function.
* tests/t8001-loop-blkpg.sh: Call it.
Petr Uzel [Wed, 28 Sep 2011 08:45:02 +0000 (10:45 +0200)]
libparted: do not omit last sector when creating full-dev geometry
Note that ped_constraint_solve_max() is currently not used anywhere.
* libparted/cs/constraint.c (ped_constraint_solve_max): full_dev now
really represents whole device.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Petr Uzel [Wed, 28 Sep 2011 08:45:07 +0000 (10:45 +0200)]
maint: unmark PedDeviceType as deprecated
PedDeviceType was marked as deprecated before parted started using
git. Since it proved to be useful to differentiate between different
device types, and nobody seems interested in removing it from the API,
let's clear the deprecated flag.
Petr Uzel [Wed, 28 Sep 2011 08:45:08 +0000 (10:45 +0200)]
libparted: do not call _device_get_partition_range() twice
PED_MIN can evaluate its arguments twice.
* libparted/arch/linux.c (_disk_sync_part_table): Call
_device_get_partition_range() outside PED_MIN.
Petr Uzel [Wed, 28 Sep 2011 08:45:09 +0000 (10:45 +0200)]
libparted: optimize _disk_sync_part_table
In _disk_sync_part_table, if the largest partition number (lpn) is 0,
it does not make sense to go through the loops below. Return
immediately instead.
* libparted/arch/linux.c (_disk_sync_part_table): Return immediately
if lpn == 0.
Petr Uzel [Wed, 28 Sep 2011 08:45:03 +0000 (10:45 +0200)]
build: ignore more generated files
Petr Uzel [Wed, 28 Sep 2011 08:45:06 +0000 (10:45 +0200)]
parted: remove obsolete comments
is_start_exact and is_end_exact were removed from the source.
* parted/parted.c (constraint_from_start_end): Remove obsolete
documentation of the function.
Petr Uzel [Wed, 28 Sep 2011 08:45:05 +0000 (10:45 +0200)]
libparted: check return value from ped_geometry_init
If ped_geometry_init() failed in ped_disk_set_partition_geom(),
then new_geom remains uninitialized, but still later used, which
leads to unexpected results.
* libparted/disk.c (ped_disk_set_partition_geom): Check return
value from ped_geometry_init().
Petr Uzel [Thu, 29 Sep 2011 13:14:24 +0000 (15:14 +0200)]
tests: add test for partitionable loop devices
* tests/t8001-loop-blkpg.sh: New file.
* tests/Makefile.am: Add test.
Petr Uzel [Thu, 29 Sep 2011 13:14:23 +0000 (15:14 +0200)]
libparted: improve support for partitions on loopback devices
Since linux-2.6.26, the kernel allows partitions on loopback devices.
Implement support for this feature in parted.
* libparted/arch/linux.c (_sysfs_int_entry_from_dev): New function.
(_loop_get_partition_range): New function.
(_device_get_partition_range): Add special handling for loop devices.
* NEWS: Mention this change.
Petr Uzel [Thu, 29 Sep 2011 13:45:23 +0000 (15:45 +0200)]
libparted: differentiate between plain files and loop devices
Stop using PED_DEVICE_FILE for loopback devices;
loopback are significantly different from plain files.
* include/parted/device.h (PedDeviceType): Add PED_DEVICE_LOOP.
* libparted/arch/linux.c (_device_probe_type): Detect loopback device.
* parted/parted.c (do_print): Add "loopback" to list of transports.
Petr Uzel [Thu, 29 Sep 2011 09:38:30 +0000 (11:38 +0200)]
dvh: factor out read_sector and use ptt_read_sector
* libparted/labels/dvh.c (read_sector): Factor out this function.
(dvh_probe): Use ptt_read_sector instead of read_sector.
(dvh_read): Likewise.
Jim Meyering [Wed, 28 Sep 2011 13:19:52 +0000 (15:19 +0200)]
build: update gnulib to latest; adapt use of _GL_ATTRIBUTE_FORMAT
* libparted/arch/linux.c (_GL_ATTRIBUTE_FORMAT): Define here,
now that it's no longer defined by gnulib.
Jim Meyering [Wed, 28 Sep 2011 19:46:56 +0000 (21:46 +0200)]
build: avoid new syntax-check failure
* cfg.mk: Exempt libparted/arch/beos.c from the PATH_MAX check.
I suspect that this is ok, because parted compiles only on systems
that define PATH_MAX to something reasonable.
Jim Meyering [Sat, 25 Jun 2011 06:52:04 +0000 (08:52 +0200)]
doc: mention the origin of the other two bugs
* NEWS: Mention that the other two bugs were introduced long ago.
Jim Meyering [Wed, 28 Sep 2011 17:43:40 +0000 (19:43 +0200)]
tests: test for the nilfs2 bug
* tests/t4300-nilfs2-tiny.sh: New test.
* tests/Makefile.am (TESTS): Add it.
Jim Meyering [Sat, 25 Jun 2011 06:49:58 +0000 (08:49 +0200)]
libparted: fix a bug in the nilfs2 probe function
* libparted/fs/nilfs2/nilfs2.c (nilfs2_probe): Reject this partition
if we get a negative sb2 offset. Passing a negative offset to
ped_geometry_read_alloc would evoke a failed assertion.
Bug introduced by 2010-07-09 commit
d463e7de.
* NEWS: (Bug fixes): Mention it.
Reported by Daniel Fandrich in
http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10466/focus=10472
Jim Meyering [Fri, 24 Jun 2011 11:32:33 +0000 (13:32 +0200)]
gpt: don't abort for a truncated GPT-formatted device
This fixes the problem two ways. The first fix (via gpt_alloc)
rejects any device that is too small, but it is insufficient.
Choose a slightly larger truncated device with an otherwise intact
primary GPT header and you can still trigger the failed assertion.
To fix it in general, we make _header_is_valid detect the problem.
* libparted/labels/gpt.c (gpt_alloc): Reject a device that is so
small that there is no room for a single partition.
(_header_is_valid): Validate LastUsableLBA here, as well, so that
we now reject as invalid any GPT header that specifies a
LastUsableLBA larger than the device size.
Leave the assertion in _parse_header.
* tests/t0203-gpt-tiny-device-abort.sh: Test for this.
* tests/Makefile.am (TESTS): Add it.
* NEWS: (Bug fixes): Mention it.
Reported by Daniel Fandrich in
http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10466
Jim Meyering [Fri, 24 Jun 2011 13:51:57 +0000 (15:51 +0200)]
libparted: avoid invalid diagnostic in interactive mode
* libparted/arch/linux.c (linux_read): In interactive mode,
a truncated device with a preexisting GPT could evoke this:
Error: end of file while reading Success
it should have been like this:
Error: end of file while reading /full/name/of/device
Use %0.0s to discard the strerror argument.
Brian C. Lane [Tue, 21 Jun 2011 17:44:18 +0000 (10:44 -0700)]
tests: add test for value less than 1
* tests/t9023-value-lt-one.sh: New file.
* tests/Makefile.am (TESTS): Add it.
Brian C. Lane [Tue, 21 Jun 2011 17:44:17 +0000 (10:44 -0700)]
tests: add test for radius divide by 2 fix
* tests/t9022-one-unit-snap.sh: New file.
* tests/Makefile.am (TESTS): Add it.
Brian C. Lane [Tue, 21 Jun 2011 17:44:16 +0000 (10:44 -0700)]
libparted: don't allow values less than 1 (#665496)
When a value < 1 is used there is the possibility that the range can
overlap sector 0. The user should use smaller units instead. 0 is a
special case and is still allowed.
* libparted/unit.c (ped_unit_parse_custom): Throw error if a value
between 0 and 1 is used.
Brian C. Lane [Tue, 21 Jun 2011 17:44:15 +0000 (10:44 -0700)]
libparted: fix snap radius so that it is using half (#665496)
The snap radius didn't match the documentation, it has been using +/-
unit size instead +/- 0.5 * unit (eg. 500KB for a MB unit). This caused
problems when specifying 1MB, 1GB, etc. as a partition start or end
resulting in partitions being created that were nowhere near the
specified size.
* libparted/unit.c (ped_unit_parse_custom): divide radius by 2
This addresses http://bugzilla.redhat.com/665496
Jim Meyering [Fri, 10 Jun 2011 10:13:02 +0000 (12:13 +0200)]
maint: prefer AC_PROG_LIBTOOL over slightly deprecated AM_PROG_LIBTOOL
* configure.ac: Use AC_PROG_LIBTOOL rather than slightly deprecated
AM_PROG_LIBTOOL.
H. Peter Anvin [Tue, 7 Jun 2011 16:03:14 +0000 (18:03 +0200)]
libparted: simplify kernel version-parsing logic
* libparted/arch/linux.c: (_get_linux_version): Simplify and add
an assertion.
Jim Meyering [Sun, 5 Jun 2011 16:15:31 +0000 (18:15 +0200)]
libparted: accommodate two-component linux version number like 3.0
* libparted/arch/linux.c (_get_linux_version): Also accept 2-component
version numbers.
* NEWS: (Bug fixes): Mention it.
Reported by Richard W.M. Jones.
Jim Meyering [Mon, 30 May 2011 11:48:54 +0000 (13:48 +0200)]
post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
Jim Meyering [Mon, 30 May 2011 11:44:35 +0000 (13:44 +0200)]
version 3.0
* NEWS: Record release date.
Jim Meyering [Mon, 30 May 2011 11:09:01 +0000 (13:09 +0200)]
maint: placate coverity: don't ignore some return values
* libparted/cs/constraint.c: Include <assert.h>.
(ped_constraint_exact): Don't ignore ped_alignment_init's return
value or that from ped_geometry_init.
Jim Meyering [Mon, 30 May 2011 10:49:21 +0000 (12:49 +0200)]
loop: avoid NULL dereference upon failure
* libparted/labels/loop.c (loop_partition_duplicate): Don't dereference
NULL upon failure.
Jim Meyering [Mon, 30 May 2011 10:40:59 +0000 (12:40 +0200)]
shared library version: increment major: 1.0.0
* libparted/Makefile.am (CURRENT, REVISION): Update from 0.2.0 to 1.0.0,
due to removed interfaces.
Jim Meyering [Mon, 30 May 2011 07:06:26 +0000 (09:06 +0200)]
build: update gnulib submodule to latest
Jim Meyering [Fri, 27 May 2011 15:54:46 +0000 (17:54 +0200)]
doc: update NEWS
* NEWS (Changes in behavior): Describe the change.
(Bug fixes): Mention the leak fixes.
Jim Meyering [Fri, 27 May 2011 09:48:27 +0000 (11:48 +0200)]
doc: reflect removal of FS-related commands
* README (WARNING): Say that all FS-manipulation code is now gone.
* doc/parted.texi (Command explanations): Remove descriptions of and
any examples or references to the following commands: check, cp,
mkfs, mkpartfs, move, resize.
Jim Meyering [Tue, 17 May 2011 21:08:42 +0000 (23:08 +0200)]
build: remove configure-time options: --disable-fs, --enable-Werror
* configure.ac: Remove support for --enable-fs and --disable-fs.
Remove support for --enable-Werror and --disable-Werror.
* README: Remove paragraph about --disable-fs and
--enable-discovery-only.
* libparted/libparted.c: Now that --disable-fs is gone (i.e.,
ENABLE_FS would be always 1), remove its #ifdefs.
Jim Meyering [Sat, 21 May 2011 13:18:15 +0000 (15:18 +0200)]
tests: make t0220 more useful when it fails
Jim Meyering [Sat, 21 May 2011 13:03:04 +0000 (15:03 +0200)]
maint: update po/POTFILES.in
* po/POTFILES.in: Remove file names, to reflect file deletions.
Jim Meyering [Tue, 17 May 2011 21:10:16 +0000 (23:10 +0200)]
doc: remove FS-related documentation and other stale bits
* doc/parted.texi: Remove FS-related documentation and other
stale bits.
Jim Meyering [Tue, 17 May 2011 12:23:25 +0000 (14:23 +0200)]
linux_swap: remove all-but-probe FS-related code
Jim Meyering [Mon, 16 May 2011 13:47:02 +0000 (15:47 +0200)]
xfs: remove all-but-probe FS-related code
Jim Meyering [Mon, 16 May 2011 12:35:19 +0000 (14:35 +0200)]
jfs: remove all-but-probe FS-related code
Jim Meyering [Mon, 16 May 2011 12:33:58 +0000 (14:33 +0200)]
ufs: remove all-but-probe FS-related code
Jim Meyering [Mon, 16 May 2011 12:33:04 +0000 (14:33 +0200)]
reiserfs: remove all-but-probe FS-related code
Jim Meyering [Mon, 16 May 2011 12:21:44 +0000 (14:21 +0200)]
hfs: remove all-but-probe FS-related code
Jim Meyering [Mon, 16 May 2011 12:12:07 +0000 (14:12 +0200)]
ntfs: remove all-but-probe FS-related code
Jim Meyering [Mon, 16 May 2011 11:58:10 +0000 (13:58 +0200)]
amiga: build with warning and error options
* libparted/fs/amiga/Makefile.am (AM_CFLAGS): Add $(WARN_CFLAGS)
and $(WERROR_CFLAGS).
Jim Meyering [Mon, 16 May 2011 10:11:23 +0000 (12:11 +0200)]
ext2: remove all-but-probe FS-related code
Jim Meyering [Fri, 13 May 2011 19:26:17 +0000 (21:26 +0200)]
fat: remove all-but-probe FS-related code
Jim Meyering [Fri, 13 May 2011 19:02:59 +0000 (21:02 +0200)]
remove all top-level FS-op code and the clearfat program
Jim Meyering [Thu, 17 Sep 2009 14:20:56 +0000 (16:20 +0200)]
UI: remove all file-system-aware sub-commands
Note that we are removing the resize command, even though parted
appears to be the only free tool that provides the ability to
resize FAT16 and FAT32 file systems.
* parted/parted.c (do_mkfs, do_cp, do_mkpartfs): Remove functions.
(do_move, do_check, do_resize): Likewise.
(_init_commands): Remove each command-definition clause.
* parted/parted.c (_partition_warn_loss): Remove now-unused function.
* include/parted/filesys.h: Remove declarations of now-removed
FS-munging functions
Jim Meyering [Fri, 27 May 2011 15:06:31 +0000 (17:06 +0200)]
tests: t1100: show that adding a partition on a busy device succeeds
* tests/t1100-busy-label.sh: Demonstrate that adding a partition
succeeds, even when another on the same device is mounted (active).
Jim Meyering [Fri, 27 May 2011 12:45:19 +0000 (14:45 +0200)]
amiga: avoid NULL-deref-on-OOM and an error-path leak
* libparted/labels/rdb.c (amiga_read): Don't dereference NULL on OOM.
Don't leak a constraint when failing to add a partition.
Jim Meyering [Fri, 27 May 2011 12:38:16 +0000 (14:38 +0200)]
mac: avoid NULL-deref-on-OOM and an error-path leak
* libparted/labels/mac.c (mac_read): Don't dereference NULL on OOM.
Don't leak a constraint when failing to add a partition.
Jim Meyering [Fri, 27 May 2011 12:35:07 +0000 (14:35 +0200)]
sun: avoid NULL-deref-on-OOM and an error-path leak
* libparted/labels/sun.c (sun_read): Don't dereference NULL on OOM.
Don't leak a constraint when failing to add a partition.
Jim Meyering [Fri, 27 May 2011 12:31:45 +0000 (14:31 +0200)]
UI: avoid leak when interactive sector selection matches default
* parted/ui.c (command_line_get_fs_type): Don't leak an input "word".
Jim Meyering [Fri, 27 May 2011 12:27:41 +0000 (14:27 +0200)]
UI: plug a leak
* parted/ui.c (command_line_get_fs_type): Don't leak an FS type name
string.
Jim Meyering [Fri, 27 May 2011 12:24:33 +0000 (14:24 +0200)]
bsd: avoid NULL-deref-on-OOM and an error-path leak
* libparted/labels/bsd.c (bsd_read): Don't dereference NULL on OOM.
Don't leak a constraint when failing to add a partition.
Jim Meyering [Fri, 27 May 2011 11:53:36 +0000 (13:53 +0200)]
linux: don't leak a FILE* upon /proc read failure
* libparted/arch/linux.c (_probe_proc_partitions): Call fclose
upon failure.
Jim Meyering [Fri, 27 May 2011 11:46:40 +0000 (13:46 +0200)]
linux: plug a file descriptor leak
* libparted/arch/linux.c (read_device_sysfs_file): Don't leak a
file descriptor.