OSDN Git Service
Jim Meyering [Tue, 5 Jun 2007 14:01:46 +0000 (16:01 +0200)]
Make "mklabel amiga" work also when DEBUG is not enabled.
I turned off DEBUG and discovered test failures that its
bogus always-initialize-malloc'd-memory policy had been hiding:
(amiga_write): Initialize all of "->disk_specific" buffer.
Avoid buffer overrun when initializing "TABLE".
Jim Meyering [Tue, 5 Jun 2007 10:23:00 +0000 (12:23 +0200)]
"mklabel bsd": don't read/write initialized memory, with DEBUG turned off
I spent the first part of yesterday debugging the ext2-resize failure.
As part of that, I turned off DEBUG and was surprised to see new failures
in the label checks. At least for label types "amiga" and "bsd", the
implementation required that freshly-allocated memory be filled with all
"1" bits, as was guaranteed by the default setting of
#define DEBUG 1
When I turned that off, bsd.c would read/write uninitialized memory, and
rdb.c(amiga) would do more of the same and produce partition tables that
it would then fail to recognize.
Here's the fix for the bsd problems.
I'll send the rdb/amiga ones separately, and once all tests pass
without malloc-initialization-to-all-1's, I'll remove that, too.
The bsd read-uninit bug was at bsd.c:341 (bsd_write), with this test:
if (!bsd_specific->boot_code [0])
_probe_and_add_boot_code (disk);
that first byte was never initialized.
So, I figured, that'll be easy. Just initialize it.
Wrong. That wasn't enough, since then a part of that same 512-byte
buffer (starting at offset 340) would be used uninitialized by
a write syscall.
FYI, the first failure was demonstrated like this:
dev=f
N=1M
dd if=/dev/zero of=$dev bs=$N count=1 && valgrind ./parted -s $dev mklabel bsd
Here's the first one:
==20087== Conditional jump or move depends on uninitialised value(s)
==20087== at 0x4429EE: bsd_write (bsd.c:341)
==20087== by 0x411AD3: ped_disk_commit_to_dev (disk.c:485)
==20087== by 0x411B19: ped_disk_commit (disk.c:508)
==20087== by 0x403A12: do_mklabel (parted.c:622)
==20087== by 0x402AF7: command_run (command.c:139)
==20087== by 0x40B00A: non_interactive_mode (ui.c:1530)
==20087== by 0x407A8B: main (parted.c:2479)
and even after initializing only that first byte, here's what I got:
==25692== Syscall param write(buf) points to uninitialised byte(s)
==25692== at 0x54874D0: __write_nocancel (in /usr/lib/debug/libc-2.5.so)
==25692== by 0x41A15C: linux_write (linux.c:1599)
==25692== by 0x40D9CA: ped_device_write (device.c:369)
==25692== by 0x442B1E: bsd_write (bsd.c:368)
==25692== by 0x411AD3: ped_disk_commit_to_dev (disk.c:485)
==25692== by 0x411B19: ped_disk_commit (disk.c:508)
==25692== by 0x403A12: do_mklabel (parted.c:622)
==25692== by 0x402AF7: command_run (command.c:139)
==25692== by 0x40B00A: non_interactive_mode (ui.c:1530)
==25692== by 0x407A8B: main (parted.c:2479)
==25692== Address 0x59E9C01 is 340 bytes inside a block of size 512 alloc'd
==25692== at 0x4A1EC7C: memalign (vg_replace_malloc.c:332)
==25692== by 0x4A1ECD5: posix_memalign (vg_replace_malloc.c:425)
==25692== by 0x41A11A: linux_write (linux.c:1594)
==25692== by 0x40D9CA: ped_device_write (device.c:369)
==25692== by 0x442B1E: bsd_write (bsd.c:368)
==25692== by 0x411AD3: ped_disk_commit_to_dev (disk.c:485)
==25692== by 0x411B19: ped_disk_commit (disk.c:508)
==25692== by 0x403A12: do_mklabel (parted.c:622)
==25692== by 0x402AF7: command_run (command.c:139)
==25692== by 0x40B00A: non_interactive_mode (ui.c:1530)
==25692== by 0x407A8B: main (parted.c:2479)
Jim Meyering [Thu, 31 May 2007 18:35:04 +0000 (20:35 +0200)]
Don't leak a partition table buffer.
* libparted/labels/rdb.c (amiga_read): Free the buffer upon success
as well as on failure.
Jim Meyering [Thu, 31 May 2007 08:31:11 +0000 (10:31 +0200)]
Correct a misleading diagnostic.
* libparted/disk.c (ped_disk_new): Remove always-false "Unable to open"
part of diagnostic. Leave the "unrecognized disk label" part.
Jim Meyering [Thu, 31 May 2007 07:04:01 +0000 (09:04 +0200)]
Fix build failure (conflicting decl of strnlen) and clean up
* parted/strlist.h: Include <config.h> first.
[!ENABLE_NLS]: Define wchar_t to char here, too, since we no
longer include "strlist.h" after the definition in table.c.
* parted/table.c: Include <wchar.h> and <string.h> unconditionally,
and before wchar_t redefinition.
Hoist inclusions of xalloc.h and strlist.h, too.
Remove wcwidth and strnlen declarations, since they're guaranteed
to be in the gnulib-supplied-if-needed headers.
Jim Meyering [Wed, 30 May 2007 13:55:30 +0000 (15:55 +0200)]
Read an msdos partition table from a device with 2K sectors.
* libparted/labels/dos.c: Include <stdbool.h>.
(msdos_probe): Don't hard-code 512.
Use read_sector, not ped_device_read.
Adapt to changed type of "part_table".
Now that "label" is malloc'd, be sure to free it before returning.
(read_table): Likewise.
Jim Meyering [Wed, 30 May 2007 21:19:04 +0000 (23:19 +0200)]
Fix "make distcheck" failure due to not finding usable partition
* m4/o-direct.m4: Require that read as well as write succeed.
Require that both work with blocks of size 512 as well as 4096.
Reiserfs3 doesn't support 512-byte reads.
Allow the user running the test to specify the first directory
to test via the PARTED_TMPDIR envvar, in case none of the dirs
checked by default is usable.
Jim Meyering [Wed, 30 May 2007 13:40:50 +0000 (15:40 +0200)]
Fix configure-with-nls vs. wchar.h/wcsdup problem differently.
* parted/table.c: Include <config.h> *before* all other #include
directives. Remove explicit declaration of wcsdup. Now, we'll
get the one from <wchar.h>.
Otavio Salvador [Wed, 30 May 2007 03:17:43 +0000 (00:17 -0300)]
parted/table.c: Fix a warning when compiling with translation support
,----[ Output when compiling with translation support ]
|...
| table.c: In function 'table_add_row_from_strlist':
| table.c:168: warning: implicit declaration of function 'wcsdup'
| table.c:168: warning: assignment makes pointer from integer without a cast
`----
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Benno Schulenberg [Tue, 29 May 2007 18:02:25 +0000 (20:02 +0200)]
fdasd label: Move formatting out of translatable strings.
Also gettextize several missed messages, and simplify some of them.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Benno Schulenberg [Tue, 29 May 2007 17:55:52 +0000 (19:55 +0200)]
vtoc label: Move formatting out of translatable strings.
Also gettextize a few missed messages, and remove some whitespace.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Jim Meyering [Tue, 29 May 2007 19:30:40 +0000 (21:30 +0200)]
Avoid a leak.
* parted/parted.c (do_print): Use separate variables for the header
and for individual rows. Free each when done.
* parted/table.c (table_add_row_from_strlist): Insert a newly
allocated copy of each string, so that the caller can free
the argument corresponding to the "list" parameter.
* tests/t0100-print.sh: New test for this.
* tests/Makefile.am (TESTS): Add t0100-print.sh.
Jim Meyering [Tue, 29 May 2007 18:29:47 +0000 (20:29 +0200)]
Move a test/utility function into test-lib.sh.
* tests/t3000-constraints.sh (emit_superuser_warning): Move this
function to...
* tests/test-lib.sh (emit_superuser_warning): ...here.
* tests/t0000-basic.sh: Use the function instead of open-coding it.
Signed-off-by: Jim Meyering <jim@meyering.net>
Jim Meyering [Tue, 29 May 2007 15:36:41 +0000 (17:36 +0200)]
On IRC, xeos reported test failures in t0000 and t2000
with diffs like this:
-/home/xeos/projects/parted/parted/.libs/lt-parted: invalid token: msdos
+parted: invalid token: msdos
Here's the patch I expect to apply.
It also removes an inter-part dependency by moving the creation
of the "o2" temporary file into the test where it's used.
Some of this duplication should be factored out, eventually...
Jim Meyering [Sat, 26 May 2007 04:59:34 +0000 (06:59 +0200)]
Diagnose invalid command arguments.
This started because I objected to parted failing with no diagnostic
when given an invalid file system type:
$ /sbin/parted -s $dev mklabel loop mkpartfs hfsplus 0 1.4
WARNING: You are not superuser. Watch out for permissions.
[Exit 1]
With the changes below, it does this:
$ ./parted -s $dev mklabel loop mkpartfs hfsplus 0 1.4
./parted: invalid token: hfsplus
[Exit 1]
The following may look like a simple change, but looks are deceptive...
For example, if you try to diagnose via ped_exception_throw instead
of "error", you'll find that the mere fact of diagnosing the problem
introduces new ones because of how the exception handler manipulates the
global command line buffer containing the token we're complaining about.
But this isn't library code, so using error() is fine.
Diagnose invalid command arguments.
When a command argument doesn't match the expected candidate values,
parted would silently exit (in script mode) or simply act as if that
value and any following ones had not been specified (in interactive
mode). With this change, it complains about the "invalid token",
and in script mode (where there hasn't been a prompt to give context)
sometimes tells what type of token it was expecting.
* parted/ui.c: Include "error.h".
(command_line_get_word): If the user's "token" wasn't a good enough
match, give a diagnostic. In script mode, return NULL so that the
callers can give additional information.
* tests/t2000-mkfs.sh: New test for the above.
* tests/t0000-basic.sh: Expect the new diagnostic when "msdos" is
treated as an unrecognized first token after "mklabel". This happens
when trying to label a disk that already has a label.
* tests/t1100-busy-label.sh: Likewise.
Jim Meyering [Fri, 25 May 2007 17:40:56 +0000 (19:40 +0200)]
Use xmalloc and xrealloc, rather than unchecked malloc and realloc.
* parted/table.c: Use gnulib's xmalloc and realloc.
Remove anachronistic casts of malloc/realloc return value.
Change "sizeof(type)" to safer "sizeof(*var)" (one of the former
was wrong, but in a harmless way).
Jim Meyering [Fri, 25 May 2007 17:13:28 +0000 (19:13 +0200)]
Fix off-by-one error in previous change.
* parted/strlist.c (str_list_print_wrap): Don't output a space unconditionally.
Jim Meyering [Fri, 25 May 2007 16:45:39 +0000 (18:45 +0200)]
Remove a silly (and dangerous) function.
This change has no effect, except in a low-memory condition,
where the old code would dereference NULL, the new code no
longer performs that malloc.
* parted/strlist.c (get_spaces): Remove this function.
Not only is it useless, but it also has an unchecked malloc.
(str_list_print_wrap): Don't allocate and initialize a string
just to print a sequence of N spaces.
Jim Meyering [Fri, 25 May 2007 11:58:15 +0000 (13:58 +0200)]
doc/parted.texi (Static binaries): Correct an invalid example.
One cannot specify "primary" for a partition on a loop device.
Jim Meyering [Thu, 24 May 2007 18:00:22 +0000 (20:00 +0200)]
Diagnose "ext2 FS too small" rather than triggering an assertion.
* libparted/fs/ext2/ext2_mkfs.c (ext2_mkfs): An overlapping ext2
partition request could still lead to a bug: constraint-resolution
code would produce a single-sector candidate "range", and that
would cause the ext2 fs-creation code to misbehave. Now, it
properly detects and reports the FS as being too small.
* tests/t3000-constraints.sh: New test for the above.
* tests/Makefile.am (TESTS): Add t3000-constraints.sh.
Jim Meyering [Thu, 24 May 2007 16:21:43 +0000 (18:21 +0200)]
Fix typo in privs-required test setup.
* tests/test-lib.sh: Fix typo: s/\$parted/$parted_/.
Jim Meyering [Wed, 23 May 2007 20:28:53 +0000 (22:28 +0200)]
Don't fail all tests when "." lacks O_DIRECT support.
I often build tools on a tmpfs file system (it's faster), and
found that parted tests always failed there. That's because it tries
to open the "device" (a file) with O_DIRECT, and at least the linux tmpfs
driver always fails with EINVAL in that case.
So here's a patch that makes it work.
Since the test may require writing in a directory like /tmp,
to which others typically have write access, it is particularly
careful about security (see the mkdtemp script below), in case
"make check" is run by e.g., root.
Don't fail all tests when "." lacks O_DIRECT support.
Before, running "make check" on a file system that doesn't support
O_DIRECT (e.g. tmpfs), would always fail. Now, it works, as long as
the test machinery can find a writable directory in which open with
O_DIRECT *does* work.
* m4/o-direct.m4: New file. Find a directory/FS with O_DIRECT support.
* configure.ac: Use the new macro.
* libparted/tests/t1000-label.sh: New file. Wrap the binary, so
it can take advantage of the code that finds O_DIRECT supporting FS.
* tests/mkdtemp: New file. Required, since when running tests as
root, we may have to create a temporary directory in a directory
like /tmp that's writable by others.
* tests/Makefile.am (EXTRA_DIST): Add mkdtemp.
* tests/test-lib.sh: When creating test subdir, and setting up "trap",
use the directory specified in $PARTED_USABLE_TEST_DIR.
Don't set PATH here. Now, that's done via the generated, and always-
sourced, init.sh. As a result, invoke parted via its full file name.
Jim Meyering [Sat, 19 May 2007 09:10:20 +0000 (11:10 +0200)]
Make all tests get their initialization from the same place.
* tests/t2000-mkfs.sh: Get initialization via ". ./init.sh",
not via ". ./test-lib.sh".
* Makefile.maint (sc_test_init): New test, to ensure we stay consistent.
Jim Meyering [Sat, 19 May 2007 06:49:40 +0000 (08:49 +0200)]
* tests/Makefile.am (init.sh): Make this generated file read-only.
Jim Meyering [Fri, 18 May 2007 13:52:00 +0000 (15:52 +0200)]
mkpartfs ext2 2 10 would erroneously report "file system too small"
for some small (single-group) partitions. It would also fail to
report "file system too small" in some cases, and instead continue
on to into inode-allocation code where it'd report "File system full!"
* libparted/fs/ext2/ext2_mkfs.c (compute_block_counts): New function,
factored out of...
(ext2_mkfs): ...here. Call compute_block_counts rather than
open-coded it. When decrementing numblocks, call compute_block_counts
again, to recompute all of the derived values.
Require at least 14 free blocks in a 16-inode-per-group partition.
* tests/t1500-small-ext2.sh: New file. Test for the above.
* tests/Makefile.am (TESTS): Add t1500-small-ext2.sh.
Jim Meyering [Thu, 17 May 2007 11:21:00 +0000 (13:21 +0200)]
Avoid spurious test failures due to buggy ncurses-5.6.
* tests/test-lib.sh: Also unset TERM.
Benno Schulenberg [Wed, 16 May 2007 20:28:35 +0000 (22:28 +0200)]
partprobe: new option: --dry-run, synonym for now-deprecated --no-update; improve its description
Anant Narayanan [Wed, 16 May 2007 02:56:37 +0000 (08:26 +0530)]
Test commit
David Cantrell [Wed, 9 May 2007 20:45:38 +0000 (16:45 -0400)]
Removed clean.sh script. Using git now, we don't need it anymore (git clean -d -x).
David Cantrell [Wed, 9 May 2007 19:15:47 +0000 (15:15 -0400)]
Use gnulib xmalloc() and xrealloc().
Flavio Leitner [Mon, 14 May 2007 10:04:18 +0000 (12:04 +0200)]
Fix exception handling in mkpart and mkpartfs
Parted mkpart and mkpartfs commands does:
...
ped_exception_fetch_all();
if (!ped_disk_add_partition (disk, part, final_constraint)) {
ped_exception_leave_all();
...
}
...
In mkpart if the ped_disk_add_partition() returns true it skips
ped_exception_leave_all() leaving ex_fetch_count = 1.
In mkpartfs if the ped_disk_add_partition() returns false it will
call ped_exception_leave_all() leaving ex_fetch_count negative.
The wrong count in ex_fetch_count will prevent next commands to
correctly handle exceptions, failing to prompt users for example.
Note: test script t2000-mkfs.sh improved to verify against this issue.
Signed-off-by: Flavio Leitner <flavio.leitner@gmail.com>
Signed-off-by: Jim Meyering <jim@meyering.net>
Jim Meyering [Fri, 11 May 2007 17:15:05 +0000 (19:15 +0200)]
* tests/t1100-busy-label.sh: Quote uses of $dev, in case
the user's device name contains a shell meta-character.
SCALAR(0x7f6040)
Jim Meyering [Fri, 11 May 2007 15:27:47 +0000 (17:27 +0200)]
When labeling a disk in --script mode, fail if it is in use.
* parted/parted.c (_disk_warn_busy): In script mode,
throw a "PED_EXCEPTION_ERROR", not a warning.
(do_mklabel): Guard only the _disk_warn_loss call with
"if (!opt_script_mode...", not the _disk_warn_loss call.
* tests/t1100-busy-label.sh: New file. Test the above,
in interactive mode as well as in script mode. Requires
root privilege (to mount a fs), and an actual block device.
* tests/Makefile.am (TESTS): Add t1100-busy-label.sh.
* tests/test-lib.sh: Add infrastructure to support new
privileges_required_=1 and erasable_device_required_=1
settings used by t1100.
Jim Meyering [Fri, 11 May 2007 15:20:09 +0000 (17:20 +0200)]
No longer require "srcdir=." when running a test manually.
* tests/Makefile.am (init.sh): New rule, so one doesn't have to
set "srcdir=." when running a test manually.
* .gitignore: Ignore new generated file: tests/init.sh.
* tests/t0000-basic.sh: Source new init.sh, rather than test-lib.sh.
* tests/t1000-mkpartfs.sh: Likewise.
* tests/t2000-mkfs.sh: Likewise.
* tests/test-lib.sh: Remove useless srcdir-setting code.
Otavio Salvador [Wed, 9 May 2007 19:03:39 +0000 (16:03 -0300)]
[parted] Fix script mode support on mkfs commandline command
Parted was lacking support to script mode on do_mkfs method hence
always failing.
Note: tests/t2000-mkfs.sh was created to avoid it to happen again
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Debarshi Ray [Tue, 8 May 2007 17:35:23 +0000 (23:05 +0530)]
Preventing compilation of DASD code on GNU Hurd systems through the use of AC_COMPILE_IFELSE and AM_CONDITIONAL, instead of #ifdef.
Jim Meyering [Mon, 7 May 2007 16:42:38 +0000 (18:42 +0200)]
Rewrite integration tests to use a new framework (git's).
* tests/t1000-mkpartfs.sh: New file.
* tests/t0000-basic.sh: New file.
* tests/test-lib.sh: New file. Derived from git's t/test-lib.sh.
* tests/lang-default, tests/priv-check: Remove files.
* tests/Makefile.am (EXTRA_DIST): Add test-lib.sh.
Remove lang-default and priv-check; no longer used.
* tests/part-01, tests/label-01: Remove files.
* tests/part-02, tests/label-02: Likewise.
Jim Meyering [Mon, 7 May 2007 15:09:37 +0000 (17:09 +0200)]
Merge branch 'inhibit-word-wrap'
Jim Meyering [Mon, 7 May 2007 15:05:31 +0000 (17:05 +0200)]
Merge branch 'include-limits-h-for-CHAR_MAX'
Jim Meyering [Mon, 7 May 2007 14:51:29 +0000 (16:51 +0200)]
Make ---pretend-input-tty inhibit output word-wrap.
* parted/ui.c (screen_width): Use effectively-unlimited screen width
with ---pretend-input-tty, just as for '--script' mode.
Jim Meyering [Mon, 7 May 2007 14:45:27 +0000 (16:45 +0200)]
Suppress "you are not superuser..." warning in script mode.
* parted/parted.c (_init): Do not emit this warning in script mode:
"You are not superuser. Watch out for permissions."
Jim Meyering [Mon, 7 May 2007 14:38:00 +0000 (16:38 +0200)]
Avoid "make distcheck" failure, with newer system headers.
* parted/parted.c: Include <limits.h>, for use of CHAR_MAX.
Anant Narayanan [Thu, 3 May 2007 23:39:52 +0000 (05:09 +0530)]
Updated Doxyfile
David Cantrell [Wed, 2 May 2007 18:22:28 +0000 (14:22 -0400)]
On the edge branch, labeled the version as 1.9.0 so we can mark it more correctly as the development tree.
David Cantrell [Mon, 30 Apr 2007 13:44:24 +0000 (09:44 -0400)]
Whitespace cleanups.
David Cantrell [Mon, 30 Apr 2007 13:42:33 +0000 (09:42 -0400)]
Whitespace cleanups.
David Cantrell [Mon, 30 Apr 2007 13:22:44 +0000 (09:22 -0400)]
Whitespace cleanups.
David Cantrell [Mon, 30 Apr 2007 13:21:48 +0000 (09:21 -0400)]
Whitespace cleanups.
David Cantrell [Mon, 23 Apr 2007 20:41:02 +0000 (16:41 -0400)]
Revert "Remove unused label."
This reverts commit
bfd9a6d8b6322d870650b0e92bd936035ab28e76.
David Cantrell [Mon, 23 Apr 2007 20:25:11 +0000 (16:25 -0400)]
Patch from Jim Meyering <jim@meyering.net> to linux_write() to support logical
sector sizes other than 512 (PED_SECTOR_SIZE_DEFAULT).
David Cantrell [Mon, 23 Apr 2007 20:02:13 +0000 (16:02 -0400)]
Fix primary partition cylinder alignment error for DOS disk labels.
David Cantrell [Mon, 23 Apr 2007 20:00:54 +0000 (16:00 -0400)]
Fix off-by-one bug in parted when displaying information about the disk label (the disk size, specifically).
David Cantrell [Mon, 23 Apr 2007 19:58:03 +0000 (15:58 -0400)]
Do not translate partition names in 'parted print' command. This causes problems for non-Latin-based character sets. Also, we don't want to translate the partition name here as we are just showing what is in the disklabel, translating it distorts what the value is.
Also added some malloc checks in table.c.
David Cantrell [Mon, 23 Apr 2007 19:53:48 +0000 (15:53 -0400)]
Remove unused label.
David Cantrell [Thu, 15 Mar 2007 16:53:35 +0000 (12:53 -0400)]
Reverted my patch to configure.ac to remove -Wl,--as-needed from LDFLAGS when checking for libreadline.
David Cantrell [Wed, 14 Mar 2007 18:55:49 +0000 (14:55 -0400)]
libreadline is a problematic library. Autoconf adds a block to the generated configure script that checks to see if we should be passing the --as-needed flag to ld(1). There are portability reasons this code exists (best I can figure), but it presents a problem when we scan for libreadline.
libreadline specifically has unresolved symbols on at least Fedora and RHEL. Why? Well, the developer can choose to provide libtermcap, libncurses, or libncursesw (wide-char support) at compile time which all satisfy the curses API dependency that libreadline has. When the parted configure script runs, it fails on readline because the --as-needed flag causes the linker to not include libncurses even though we already have that on the link line.
My solution is to remove the --as-needed flag when we scan for libreadline and then later check for rl_completion_matches() in libreadline.
David Cantrell [Tue, 13 Mar 2007 19:05:53 +0000 (15:05 -0400)]
More changes to set the version number to 1.8.3.
David Cantrell [Tue, 13 Mar 2007 17:03:02 +0000 (13:03 -0400)]
Set version to 1.8.3 for upcoming release.
Debarshi Ray [Tue, 1 May 2007 04:31:50 +0000 (10:01 +0530)]
[tests] Separate and improved test for reading of disk labels.
Matthew Harris [Tue, 24 Apr 2007 15:13:41 +0000 (08:13 -0700)]
Fix endianness bugs
Jim Meyering [Thu, 26 Apr 2007 21:17:32 +0000 (23:17 +0200)]
Add integration tests, then adjust code so that they pass.
These changes affect how --script (-s) works, and when diagnostics
are displayed.
* Makefile.am (SUBDIRS): Add tests.
* configure.ac (AC_OUTPUT): Add tests/Makefile.
* tests/Makefile.am: New file.
* tests/part-01, tests/label-01: New files.
* tests/part-02, tests/label-02: New files.
* parted/parted.c (enum) [PRETEND_INPUT_TTY]: Define.
Support a new, undocumented option: ---pretend-input-tty.
It is intended solely for testing. The leading '---' ensures
that it will never conflict with a "regular" long option.
(do_mkpartfs): Prompt only when not in script mode.
Call ped_exception_leave_all() to decrement global counter.
Without this, the use of parted in tests/part-01 would still fail,
but would not issue the diagnostic explaining why.
* parted/ui.h (pretend_input_tty): Declare new global.
* parted/ui.c (exception_handler): Let the new "pretend_input_tty"
option override "!isatty (0)".
(init_ui): Don't set opt_script_mode.
* tests/lang-default, tests/priv-check: New files.
Jim Meyering [Thu, 26 Apr 2007 19:54:51 +0000 (21:54 +0200)]
Temporarily disable the clone-dvh-label test.
* libparted/tests/label.c (test_clone_label):
Jim Meyering [Sat, 21 Apr 2007 16:59:43 +0000 (18:59 +0200)]
[PATCH] Avoid warning from -Wformat-security; tweak error diagnostic.
* parted/parted.c (_parse_options): Upon failure, output diagnostic
to stderr, not stdout. Use "program_name" value, not literal "parted".
Signed-off-by: Jim Meyering <jim@meyering.net>
Debarshi Ray [Fri, 20 Apr 2007 19:29:15 +0000 (00:59 +0530)]
[tests] New test for probing of disk labels.
Otavio Salvador [Fri, 20 Apr 2007 15:03:45 +0000 (12:03 -0300)]
Revert "[libparted] dvh label fixes"
This reverts commit
dcf8e966abf997b9df69b1664c470ed2aa5c166b.
Otavio Salvador [Fri, 20 Apr 2007 15:01:37 +0000 (12:01 -0300)]
[libparted] dvh label fixes
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Otavio Salvador [Fri, 20 Apr 2007 06:53:18 +0000 (03:53 -0300)]
[tests] Simplify test_clone_label removing the label reading test
Since the test_create_label already tests the label reading we
shouldn't redo it. It's always better to have simple tests so is much
easier to find the bugs.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Otavio Salvador [Fri, 20 Apr 2007 03:37:07 +0000 (00:37 -0300)]
[tests] Trivial coding style fixes around the tests code
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Otavio Salvador [Fri, 20 Apr 2007 00:30:53 +0000 (21:30 -0300)]
[tests] Add _test_exception_handler to fail every time an exception is raised
Sometimes parts of code raises exceptions and this shouldn't happen on
tests. To ensure we catch them a specific exception handler has been
implemented.
The handler usage is very easy. You just need to put the following
code at testsuite main method:
...
/* Fail when an exception is raised */
ped_exception_set_handler (_test_exception_handler);
...
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Debarshi Ray [Fri, 20 Apr 2007 00:19:44 +0000 (05:49 +0530)]
[tests] New test for cloning of disk labels.
Debarshi Ray [Thu, 19 Apr 2007 19:30:50 +0000 (01:00 +0530)]
[tests] Fix spacing around brackets and asterisks.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Benno Schulenberg [Mon, 9 Apr 2007 21:34:15 +0000 (23:34 +0200)]
Handle options independent of their order.
Abort on any invalid option, and handle -v and -h first.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Otavio Salvador [Wed, 18 Apr 2007 22:37:11 +0000 (19:37 -0300)]
[tests] Small refactoring on test_create_label
- Destroy the temporary device once the test has been finished,
- Use the _implemented_disk_label and _create_disk_label methods
to avoid code duplication.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Otavio Salvador [Wed, 18 Apr 2007 22:35:57 +0000 (19:35 -0300)]
[tests] Implements _implemented_disk_label and _create_disk_label on common.[hc]
- _implemented_disk_label: returns 0 when we haven't yet implemented
this specific label and 1 otherwise;
- _create_disk_label: creates a disk label of a specific type on a
specific device;
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Otavio Salvador [Wed, 18 Apr 2007 20:05:05 +0000 (17:05 -0300)]
[tests] Ensure that we're able to read the just created disk label
To ensure we're able to read the just created disk label we introduced a call
ped_disk_new using the same loopback. This could detect bad label creating or
probing detectiong mistakes.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Debarshi Ray [Tue, 17 Apr 2007 15:38:14 +0000 (21:08 +0530)]
Indentation fixes in libparted/tests/.
Debarshi Ray [Mon, 16 Apr 2007 18:34:54 +0000 (00:04 +0530)]
Show the update /etc/fstab message only when there has been a change to the disk. The message is now shorter and more direct.
solsTiCe d'Hiver [Thu, 5 Apr 2007 22:01:46 +0000 (00:01 +0200)]
change the variable named start to offset to be consistent with the doc
solsTiCe d'Hiver [Thu, 5 Apr 2007 12:39:45 +0000 (14:39 +0200)]
remove any trace of PED_PARTITION_PRIMARY which was deprecated a long time ago to use PED_PARTITION_NORMAL
Benno Schulenberg [Thu, 29 Mar 2007 17:28:25 +0000 (19:28 +0200)]
Added 'rescue', 'unit', and 'version' to the man page, plus some small edits.
Otavio Salvador [Wed, 4 Apr 2007 12:04:30 +0000 (09:04 -0300)]
Avoid segfault due a double free on reiserfs support (patch sent by Jakub Bogusz <qboosh@pld-linux.org>)
Benno Schulenberg [Wed, 4 Apr 2007 10:03:29 +0000 (12:03 +0200)]
Make the wording of warning somewhat clearer.
Benno Schulenberg [Mon, 26 Mar 2007 22:23:18 +0000 (00:23 +0200)]
Tweak some help messages: change third person to imperative for consistency, add single quotes and remove letters for clarity
David Cantrell [Mon, 19 Mar 2007 18:01:46 +0000 (14:01 -0400)]
Conditionalize the System Z stuff correctly. We get headers installed on non-System Z platforms, but the code only compiles on that platform.
David Cantrell [Mon, 19 Mar 2007 15:20:55 +0000 (11:20 -0400)]
Remove the COMPILE_FOR_S390 flag-setting stuff. It wasn't correct anyway. Take a kernel-style approach and check uname -m to see if we are on s390. If so, we build for zSeries. Otherwise we do not.
David Cantrell [Mon, 19 Mar 2007 14:43:56 +0000 (10:43 -0400)]
Sleep for one second after uploading a file to ftp-upload.gnu.org. Seems transactions need to be spaced out a bit otherwise the server will reject files.
David Cantrell [Mon, 19 Mar 2007 15:09:25 +0000 (11:09 -0400)]
Fix for compile problems with gcc-4.1.2 as indicated here:
http://lists.gnu.org/archive/html/bug-parted/2007-03/msg00008.html
David Cantrell [Mon, 19 Mar 2007 15:10:38 +0000 (11:10 -0400)]
Check for tgetent() in libtinfo as well as ncurses, curses, termcap, and termlib.
David Cantrell [Mon, 19 Mar 2007 15:12:11 +0000 (11:12 -0400)]
Remove some unused variables, check the return values from fgets() and asprintf(), and remove the unused _dm_remove_map() function.
David Cantrell [Mon, 19 Mar 2007 15:19:27 +0000 (11:19 -0400)]
Include vtoc.h for the format1_label_t typedef.
David Cantrell [Mon, 19 Mar 2007 18:20:52 +0000 (14:20 -0400)]
Remove GNU make-specific things from po4a.mk.
David Cantrell [Fri, 16 Mar 2007 19:18:08 +0000 (15:18 -0400)]
Install the libparted.pc file, not the libparted.pc.in file.
David Cantrell [Fri, 16 Mar 2007 19:19:57 +0000 (15:19 -0400)]
More spec file template cleanups.
David Cantrell [Fri, 16 Mar 2007 20:09:08 +0000 (16:09 -0400)]
Updated the release script to work with the new source layout.
Debarshi Ray [Fri, 16 Mar 2007 14:20:32 +0000 (19:50 +0530)]
Fixed faulty information in README-hacking (Bison is not a maintainer tool for Parted), and Makefile.maint (every project has certain variations of it).
Jim Meyering [Fri, 16 Mar 2007 09:59:19 +0000 (10:59 +0100)]
po/POTFILES.in: Add lib/getopt.c
Debarshi Ray [Fri, 16 Mar 2007 06:42:34 +0000 (12:12 +0530)]
Prevented DASD specific headers and sources from being compiled/installed on non-s390 systems; and conditionally included fdasd.h in linux.h for s390 systems.
David Cantrell [Thu, 15 Mar 2007 17:03:24 +0000 (13:03 -0400)]
Move static variable flagging little endian or not to journal.c. We don't want static variables in general, but if they must exist, put them in a C file, not a header.
Parameterize the little_endian flag for the macros in journal.h.
David Cantrell [Tue, 13 Mar 2007 21:34:05 +0000 (17:34 -0400)]
Modernize the spec file template.
David Cantrell [Tue, 13 Mar 2007 21:33:44 +0000 (17:33 -0400)]
Ignore more files.