Commit Graph

591 Commits (5bf9b4cd511c782e7f4c727520b267263690fb8a)

Author SHA1 Message Date
Theodore Ts'o 5bf9b4cd51 Fix com_err bug in compile_et: # of error messages can be wrong
Fixed bug where error messages using continuations wouldn't increment
the message count.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-07-19 08:24:59 -05:00
Andreas Dilger 9b7d811dda This patch adds a check to use fstat or fstat64 in getsize.c if the
target is a regular file, instead of doing binary searching.  It also
fixes a couple of cases where a file descriptor is leaked in the
ext2fs_getsize() routine on error.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2005-07-09 22:06:59 -05:00
Theodore Ts'o 1f965c8d96 Update for e2fsprogs 1.38 release. 2005-06-30 20:06:45 -04:00
Theodore Ts'o 80af12e180 Change the function prototypes of ext2fs_set_bit, ext2fs_clear_bit, and
ext2fs_test_bit to take an unsigned int for the bit number.  Negative
bit numbers were never allowed (and didn't make any sense), so this should
be a safe change.  This is needed to allow safe use of block numbers
greater than or equal to 2**31.
2005-06-30 19:40:18 -04:00
Theodore Ts'o 55080a7637 Fix blkid's debugging/TEST_PROGRAM code so that it is sufficiently
standalone that "make check" will compile without errors even  
when configure "--enable-blkid-debug" is not specified.
2005-06-27 13:54:08 -04:00
Stephen Tweedie 39c191f5b3 ext2fs_resize_mem() is suffering from C99 strict type aliasing problems.
The trouble is that it is modifying pointers in place, but doing so via
"void *" types which alias the pointers passed in (which are typically
pointers to a struct.)  The inline ext2fs_resize_mem() code may update
the pointer, but the caller is not required to reload the old value it
may have cached in a register, according to the type aliasing rules.

This is causing the caller to dereference the old pointer when compiled
with -O2, resulting in reproducible SEGV, on at least one ia64
configuration.

The compiler *is* required to reload if it sees an update to a dereferenced
char value, though, as chars are defined to alias anything; and memcpy()
is defined to operate on chars.  So using memcpy() to copy the pointer
values is guaranteed to force the caller to reload.  This has been 
verified to fix the problem in practice.

Fixes Red Hat bug #161183.
2005-06-27 11:47:21 -04:00
Theodore Ts'o d51b819e54 error_message.c, init_et.c: Segregate error tables registered
via add_error_table() and the other dynamic methods from
	the ones allocated via initialize_xxx_error_table() so
	that we won't fail even for error tables created using old
	versions of compile_et.  Thanks to Nalin Dahyabhai for
	this suggested patch.
2005-06-20 17:59:06 -04:00
Theodore Ts'o e7d32fcb56 et_c.awk: Use a dynamically allocated structure in
initialize_xxx_error_table(), to prevent segfaults if an
	old library calls initialize_xxx_error_table, and another
	library/application calls add_error_table() on the same
	error table, and then calls remove_error_table().
	(Addresses Sourcefroge Bug #1150146)
2005-06-20 16:24:04 -04:00
Theodore Ts'o e37fbf1c19 getsectsize.c (BLKSSZGET): Clean up test for when to manually
define the BLKSSZGET ioctl.
2005-06-19 23:11:09 -04:00
Theodore Ts'o 7d9adefed8 Makefile.in: Add an include path specifier when building
tst_ostype so that "make check" will build correctly on
	systems without the include files from e2fsprogs installed
	in the system include directory.
2005-06-16 18:41:06 -04:00
Theodore Ts'o 2fa8f37fff On Linux 2.6 systems, mke2fs and badblocks will check to see whether
the filesystem appears to be busy; if so, the programs will print an
error message and abort.   (Addresses Debian Bug #308594).
2005-06-05 16:05:22 -04:00
Theodore Ts'o 3af0a45628 Fix bug in the secure getenv function so that the ss library will corrently
honor the PAGER and SS_READLINE_PATH environtment variables, and the 
test_io io_manager in the ext2fs library honors the TEST_IO_LOGFILE,
TEST_IO_FLAGS, TEST_IO_BLOCK, and TEST_IO_READ_ABORT environment variables.
2005-05-08 02:15:02 -04:00
Theodore Ts'o ed6acfa337 Add a new option to the blkid program, -l, which will more efficiently search
for a single device.

Add a new function to the blkid library, blkid_probe_all_new().

Optimize blkid_find_dev_with_tag() so that extraneous device validation are
skipped.  (Makes a difference for system with a large number of disks).
2005-05-07 17:06:27 -04:00
Theodore Ts'o 12b3c8ec1d Fix gcc -Wall nits in the blkid library. 2005-05-07 14:38:10 -04:00
Theodore Ts'o 78c7d0efae Clean up the debugging code in the blkid library so that we don't use
the inline functions DEB_DUMP_* and instead use the private functions 
blkid_debug_dump_*().
2005-05-07 14:22:38 -04:00
Theodore Ts'o c37543df2f Add new two new functions to the blkid library: blkid_dev_set_search(), and
blkid_dev_has_tag(), and change the blkid program to take advantage of these
functions.
2005-05-07 13:32:47 -04:00
Theodore Ts'o 153b4495c1 If the .c and .h file already exist, and they have not changed, use the
original versions of the files, so as to avoid rebuilding files when not
necessary.  Also fixes a potential SMP/Parallel build problem when one 
make process runs compile_et to generate the .h file, and a partially
generated .c file is compiled by another make process.  (Addresses
Sourceforge Bug: #1157933)
2005-05-06 09:42:34 -04:00
Theodore Ts'o 75e93ab097 Update "make depend" information. Fixes SMP parallel build problem.
(Addresses Sourceforge Bug: #1157933)
2005-05-06 09:37:58 -04:00
Theodore Ts'o 9be5ba91b8 Fix build of tst_ostype when doing a "make check" in lib/e2p; it was missing
CFLAGS in the compile rule.  (Addresses Sourceforge Bug: #1180572)
2005-05-06 00:38:26 -04:00
Theodore Ts'o 4c4e3f7843 Fix libblkid's magic number recognition for the cramfs filesystem,
and add support to pull out the label for cramfs filesystems.  
Thanks to Karel Zak (kzak at redhat.com) for the patch.
2005-05-05 18:06:04 -04:00
Theodore Ts'o 09f3eba28a Fix typo so that we actually ignore environment variables when gid != egid. 2005-04-16 13:56:03 -04:00
Theodore Ts'o b7e4eef304 ls.c: Add stdlib.h header file since list_super2() uses the
free() function.
2005-04-09 01:22:09 -04:00
Theodore Ts'o b1ae119729 Add missing return values in error return cases in the ext2fs library.
(Otherwise we return garbage instead of the error code.)
2005-04-09 01:21:21 -04:00
Theodore Ts'o 762c7c6510 Add paranoia checks into the blkid, ext2fs, and ss libraries to ignore
environment variables if the libraries are called from setuid or setguid 
programs, or if kernel believes that the process is not eligible to create
a core dump.  In addition, if the libc has __secure_getenv(), use it so that
the libc can also do any additional limitations regarding when libraries can
trust environment variables (i.e., to integrate with systems like SELinux 
and Posix capabilities).
2005-04-06 14:44:16 -04:00
Theodore Ts'o 813b901d41 ostype.c (e2p_os2string): Check to make sure malloc() is
successful before attempting to copy into it.  Add
	#include of stdlib.h to fix a core dump bug on the IA64
	architecture.  (Addresses Debian Bug #302200)
2005-03-31 00:01:33 -05:00
Theodore Ts'o fd4b28efd3 Update for the e2fsprogs 1.37 release. 2005-03-21 22:37:03 -05:00
Theodore Ts'o 65ffef3689 Ignore the BLKID_FILE environment variable if blkid_get_cache() is
called from a setuid program.
2005-03-21 22:13:32 -05:00
Theodore Ts'o cebe48a1ec Integrate code from Alex Thomas at Clusterfs to check extended attributes
stored in inodes into e2fsck.

There are a number of bug fixes and enhancements over the original lustre fsck
BK repository.  The biggest one is that this extended attribute values must
be aligned on 4-byte boundaries.
2005-03-21 13:15:45 -05:00
Theodore Ts'o e27b45639a Fix mke2fs so that it writes the root directory
using ext2fs_write_new_inode(), and fix ext2fs_write_new_inode() 
so that it initializes i_extra_isize properly.
2005-03-21 01:02:53 -05:00
Theodore Ts'o 030970ed75 Fix e2fsck, debugfs, and the ext2fs_mkdir function so that when we create
a new inode we make sure that the extra information in the inode (any extra
fields in a large inode and any ea-in-inode information) is cleared.  This 
can happen when e2fsck creates a new root inode or a new lost+found directory,
or when the user uses the debugfs write, mknod, or mkdir commands.  Otherwise,
the newly create inode could inherit garbage (or old EA information) from
a previously deleted inode.
2005-03-20 20:05:22 -05:00
Theodore Ts'o ea822eeba3 Enhance debugfs's stat command so it can dump extended attributes
which are stored in the inode body.
2005-03-20 18:03:58 -05:00
Theodore Ts'o 6325394630 Add new functions which convert between a string and os_type: e2p_os2string()
and e2p_string2os() in the e2p library.
2005-03-19 01:13:22 -05:00
Theodore Ts'o 06ce1f6b28 Fix clean target to remove tst_getsectsize.
Remove useless -DDEBUG when linking tst_getsectsize.
2005-03-18 23:50:32 -05:00
Theodore Ts'o 283df83e7e getsize.c (ext2fs_get_device_size): Check to see if the number
of blocks is greater than 2**32 when we are doing a binary
	search to determine the device size.  Thanks to Stephen
	Tweedie for the patch.
2005-03-18 20:11:59 -05:00
Theodore Ts'o b22ea17742 getsize.c (blkid_get_dev_size): Fix compilation problem on
Darwin systems.
2005-03-16 23:38:14 -05:00
Theodore Ts'o 3eee5e9eed Update for release of e2fsprogs 1.36. 2005-02-05 18:26:03 -05:00
Theodore Ts'o b7aa0d653e Remove *.pc files on a "make distclean"
Remove emacs backup files in tests/Makefile on a "make clean"
2005-02-05 15:48:49 -05:00
Theodore Ts'o dbb2a1014a Makefile.in (clean): Remove tst_getsize when doing a make clean 2005-02-04 10:36:37 -05:00
Theodore Ts'o dbe9c71a17 Use inline instead of __inline__ in the blkid debugging code for
Solaris compatibility.
2005-02-03 22:09:49 -05:00
Theodore Ts'o 7004b4af6e Drop the sparc assembly bitwise operations; it's less efficient
than the GCC 3.4 compile code and triggers compiler warnings on 
sparc64.  Thanks to Matthias Andree for his analysis and suggestions.
(Addresses Debian Bug #232326)

Remove support for the --enable-old-bitops configure option which 
was only for very old sparc systems.
2005-02-03 21:56:44 -05:00
Theodore Ts'o 18d1296333 blkid.c (main, compare_search_type): Make blkid -t work more
consistently when the blkid cache file is explicitly set
	to /dev/null.  (Addresses Debian Bug #292425)

Also expose blkid_verify() as a public function to the blkid library.
2005-01-27 19:51:47 -05:00
Theodore Ts'o d4dc0a9e29 Create the resize inode is created even if the s_reserved_gdt_blocks is
zero; e2fsck will now complain and recreate the resize inode if i_links_count
is zero or if it is not a regular file.
2005-01-27 18:47:51 -05:00
Theodore Ts'o 32923fa402 Add functions which allow an application program to do a run-time query
of the version of the blkid library.
2005-01-26 13:16:06 -05:00
Theodore Ts'o f923bf2a81 Fix "make uninstall" to make sure it removes everything that is installed. 2005-01-26 13:03:55 -05:00
Theodore Ts'o e644186542 Add pkg-config files to e2fsprogs's libraries. 2005-01-26 12:59:25 -05:00
Theodore Ts'o 7331196a16 Add library support for large (EA in inode) inodes. Make sure that garbage
doesn't get written into the reserved portion when writing into filesystems
that have large inodes defined.
2005-01-25 23:42:56 -05:00
Theodore Ts'o 9d0f46169f probe.c: Windows can perform a "quick format" that doesn't clear
enough of the partition that the blkid probes can get
	confused.  Do the NTFS test first to deal with this
	Windows misfeature.  (Addresses Debian Bug #291990)
2005-01-25 03:26:10 -05:00
Theodore Ts'o 2c92375ea4 Add support to the blkid library to recognize Oracle ASM volumes. 2005-01-21 17:57:56 -05:00
Theodore Ts'o c6cdada26f Fix stupid typo in the CreateOS FreeBSD/Solaris changeset. Also included
changelogs which I forgot to include in the changeset.
2005-01-19 19:30:01 -05:00
Theodore Ts'o ea1e8f471e Add interpretation of OS Creator values for FreeBSD and Lites in mke2fs
and dumpe2fs.

Eventually, we should fold this into a single function for converting
numbers to creator os codes, and vice versa (in TODO file)
2005-01-19 18:18:44 -05:00