summaryrefslogtreecommitdiff
path: root/lib/ext2fs/ismounted.c
AgeCommit message (Collapse)AuthorFilesLines
2003-07-06Fixx gcc -Wall nitpicks.Theodore Ts'o1-6/+8
2003-04-13Add portability enhancements for Cygwin32 environment.Theodore Ts'o1-0/+2
2003-03-06Fix up lots of portability problems that caused e2fsprogs not to build ↵Theodore Ts'o1-0/+2
successfully under Solaris.
2002-10-31ismounted.c (check_mntent, check_mntent_file): Add betterTheodore Ts'o1-13/+24
support for loopback-mounted filesystems. Check /etc/mtab if /proc/mounts doesn't turn up any mount flags, since /etc/mtab has the loopback image filename, instead of /dev/loop0. Also, check based on st_dev and st_ino, so that if a relative pathname or a pathnames using symbolic links are used, we can detect the the filesystem correctly in those cases. (Addresses Sourceforge bug #619119)
2002-06-27ismounted.c (check_mntent): In AIX 4.3, MOUNTED isn't defined.Theodore Ts'o1-0/+8
Add appropriate fallbacks in this case.
2002-04-27ismounted.c (check_mntent_file, is_swap_device): Verify that theTheodore Ts'o1-55/+60
file we are checking is a block device file before looking at st_rdev, since it's not valid for normal files. (is_swap_device): Move so that it is outside the HAVE_MNTENT_H, so that it is always built.
2002-02-21ismounted.c (is_swap_device): Fix file descriptor/memory leak;Theodore Ts'o1-7/+12
we were missing an fclose().
2002-01-03Fix gcc -Wall nits.Theodore Ts'o1-1/+1
2001-12-24ismounted.c (is_swap_device): New function used byTheodore Ts'o1-1/+48
ext2fs_check_if_mounted and ext2fs_check_mount_point which determines whether or not the specified device is a swap device by using /proc/swaps. More bulletproofing for idiotic/careless system administrators!
2001-12-24ismounted.c (check_mntent_file): Stat all of the entries inTheodore Ts'o1-12/+27
/etc/mtab and/or /proc/mounts in order to catch dim-witted system administrators who might have created alias devices.
2001-09-14ismounted.c (check_mntent_file): We now validate the entry inTheodore Ts'o1-10/+46
/etc/mtab to make sure the filesystem is really mounted, since some broken distributions (read: Slackware) have buggy boot scripts that don't initialize /etc/mtab before checking non-root filesystems. (Slackware also doesn't check the root filesystem separately, and reboot if the root filesystem had changes applied to it, which is dangerous and broken.)
2001-06-15ChangeLog, ismounted.c:Theodore Ts'o1-1/+3
ismounted.c (check_mntent_file): Use a test file in / to check to see if the root filesystem is mounted read-only. This protects against the case where /etc might not be on /, as well as the case where /etc/mtab doesn't exist. (Both are should-never happen scenarios, but you never know...)
2001-06-14ChangeLog, ismounted.c:Theodore Ts'o1-4/+1
ismounted.c (ext2fs_check_if_mounted): Fix grammer in comment. Remove unneeded #pragma argsused, since the arguments are always used.
2001-06-13ChangeLog, ismounted.c:Theodore Ts'o1-0/+2
ismounted.c (check_mntent_file): Work around GNU hurd brain damage.
2001-05-25ChangeLog, ismounted.c:Theodore Ts'o1-15/+5
ismounted.c: More cleanups for ismounted.c, some from Andreas, some to clean up Andreas's patches. Use strncpy instead of strcpy to save the root's mountpoint. Clean up #ifdef structure. Remove uneeded variable in testing/debug driver.
2001-05-25ChangeLog, ismounted.c:Theodore Ts'o1-10/+31
ismounted.c: Add check for root device which doesn't depend on /etc/fstab or /proc/mounts to be correct. Don't call endmntent() before we are done with mnt struct.
2001-05-14Many files:Theodore Ts'o1-5/+0
alloc.c, alloc_tables.c, badblocks.c, bb_compat.c, bb_inode.c, bitmaps.c, bitops.c, block.c, bmap.c, bmove.c, brel_ma.c, check_desc.c, closefs.c, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c, dirblock.c, dupfs.c, expanddir.c, ext2_fs.h, fileio.c, finddev.c, flushb.c, freefs.c, get_pathname.c, getsize.c, icount.c, imager.c, initialize.c, inline.c, inode.c, irel_ma.c, ismounted.c, link.c, lookup.c, mkdir.c, mkjournal.c, namei.c, native.c, newdir.c, nt_io.c, openfs.c, read_bb.c, read_bb_file.c, rs_bitmap.c, rw_bitmaps.c, swapfs.c, test_io.c, tst_badblocks.c, tst_byteswap.c, tst_getsize.c, tst_iscan.c, unix_io.c, unlink.c, valid_blk.c, version.c, write_bb_file.c, ext2_fs.h: Moved file from include/linux. Adjust all files in this directroy to include this file.
2001-04-17ChangeLog, Makefile.in, ismounted.c:Theodore Ts'o1-6/+63
ismounted.c (check_mntent): Check /proc/mounts on Linux systems before checking /etc/mtab. The EXT2_MF_READONLY flag is now set from the /etc/mtab options field for all filesystems, not just the root filesystem. Add debugging code to make it easier to test ext2fs_check_if_mounted().
2001-01-11Many files:Theodore Ts'o1-2/+3
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c, brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c, expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c, icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c, mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c, tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t, to protect applications that attempt to compile -D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-03ChangeLog, ext2fs.h, ismounted.c:Theodore Ts'o1-7/+40
ismounted.c: add ext2fs_check_mount_point() function, which will optionally return the mount point of a device if mounted ChangeLog, closefs.c, ext2fs.h: ext2fs.h, closefs.c (ext2fs_flush): Add new flag, EXT2_FLAG_SUPER_ONLY, which the close routines to only update the superblock, and not the group descriptors.
2000-02-02ChangeLog, debugfs.c:Theodore Ts'o1-3/+0
debugfs.c (dump_inode): Remove #ifdef for i_version vs. i_generation since we know it will always be i_generation now. ChangeLog, e2fsck.h, flushb.c, scantest.c: e2fsck.h, flushb.c, scantest.c: Remove uneeded include of linux/fs.h bmap.c: Fix silly spelling typo. ChangeLog, getsize.c, ismounted.c, swapfs.c: getsize.c, ismounted.c: Remove unneeded include of linux/fs.h swapfs.c: Remove #ifdef HAVE_EXT2_INODE_VERSION since it's not needed any more; we know it will always be i_generation. Add support for swapping the high bits of the uid and gid.
1998-02-20ChangeLog, getsize.c, ismounted.c, unix_io.c:Theodore Ts'o1-0/+3
getsize.c, ismounted.c, unix_io.c: #include errno.h since it's needed.
1998-01-19Many files:Theodore Ts'o1-0/+5
inode.c (ext2fs_open_inode_scan): Initialize the group variables so that we don't need to call get_next_blockgroup() the first time around. Saves a bit of time, and prevents us from needing to assign -1 to current_group (which is an unsigned value). icount.c (insert_icount_el): Cast the estimated number of inodes from a float to an ino_t. alloc.c, alloc_tables.c, badlbocks.c, bb_compat.c, bb_inode.c, bitmaps.c, bitops.c, block.c, bmap.c, bmove.c, brel_ma.c, check_desc.c, closefs.c, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c, dirblock.c, dupfs.c, expanddir.c, ext2fs.h, fileio.c, freefs.c, get_pathname.c, getsize.c, icount.c, initialize.c, inline.c, inode.c, irel_ma.c, ismounted.c, link.c, lookup.c, mkdir.c, namei.c, native.c, newdir.c, openfs.c, read_bb.c, read_bb_file.c, rs_bitmap.c, rw_bitmaps.c, swapfs.c, test_io.c, tst_badblocks.c, tst_getsize.c, tst_iscan.c, unix_io.c, unlink.c, valid_blk.c, version.c: If EXT2_FLAT_INCLUDES is defined, then assume all of the ext2-specific header files are in a flat directory. block.c, bmove.c, dirblock.c, fileio.c: Explicitly cast all assignments from void * to be compatible with C++. closefs.c (ext2fs_flush): Add a call to io_channel_flush() to make sure the contents of the disk are flushed to disk. dblist.c (ext2fs_add_dir_block): Change new to be new_entry to avoid C++ namespace clash. bitmaps.c (ext2fs_copy_bitmap): Change new to be new_map to avoid C++ namespace clash. ext2fs.h, bb_inode.c, block.c, bmove.c, brel.h, brel_ma.c, irel.h, irel_ma.c, dblist.c, dblist_dir.c, dir_iterate.c, ext2fsP.h, expanddir.c, get_pathname.c, inode.c, link.c, unlink.c: Change private to be priv_data (to avoid C++ namespace clash)
1997-12-01Many files:Theodore Ts'o1-3/+0
dblist.c (ext2fs_get_num_dirs): Make ext2fs_get_num_dirs more paranoid about validating the directory counts from the block group information. all files: Don't include stdlib.h anymore; include it in ext2_fs.h, since that file requires stdlib.h ChangeLog, Makefile.in, dirinfo.c: dirinfo.c (e2fsck_add_dir_info): Use ext2fs_get_num_dirs instead of e2fsck_get_num_dirs, which has been removed. Makefile.in (PROGS): Remove @EXTRA_PROGS@, since we don't want to compile and install flushb. ChangeLog, configure.in: Remove @EXTRA_PROGS@, since we aren't using it in 2fsck/Makefile.in anymore ChangeLog, Makefile.in: Install debugfs in /sbin, instead of /usr/sbin. libext2fs.texinfo: Update version string to be 1.12 Makefile.in: Fix bug in find script which made the exclusion list, where a '-' was missing from an -name option.
1997-10-25Many files:Theodore Ts'o1-3/+0
alloc.c (ext2fs_alloc_block): New function which allocates a block and updates the filesystem accounting records appropriately. ext2_err.et.in: Added new error codes: EXT2_NO_MEMORY, EXT2_INVALID_ARGUMENT, EXT2_BLOCK_ALLOC_FAIL, EXT2_INODE_ALLOC_FAIL, EXT2_NOT_DIRECTORY Change various library files to use these functions instead of EINVAL, ENOENT, etc. ChangeLog, pass1.c, pass3.c: pass3.c (get_lost_and_found): Check error return of EXT2_FILE_NOT_FOUND instead of ENOTDIR pass1.c (pass1_check_directory): Return EXT2_NO_DIRECTORY instead of ENOTDIR expect.icount: Change expected error string to be "Invalid argument passed to ext2 library" instead of just "Invalid argument"
1997-08-11Many files:Theodore Ts'o1-0/+3
dosio.c: New file to do DOS/BIOS disk accesses. namei.c (open_namei): Make pathlen be of type size_t. llseek.c: Always #include stdlib.h since it's need to define size_t. io.h: Use errcode_t for magic numbers. icount.c (get_icount_el), dupfs.c (ext2fs_dup_handle), dblist.c (dir_block_cmp): Use size_t where appropriate. read_bb.c (ext2fs_read_bb_inode), cmp_bitmaps.c (ext2fs_compare_inode_bitmap): Use blk_t, ino_t and size_t where appropriate. closefs.c (ext2fs_flush): Use dgrp_t instead of int where appropriate. openfs.c (ext2fs_open), check_desc.c (ext2fs_check_desc): Use blk_t instead of int where appropriate. rw_bitmaps.c (read_bitmaps), irel_ma.c, inode.c (ext2fs_write_inode), initialize.c (ext2fs_initialize): brel_ma.c: Fix to make be 16-bit safe. link.c (ext2fs_link), unlink.c (ext2fs_unlink), lookup.c (lookup_proc), ismounted.c (ext2fs_check_if_mounted), block.c (xlate_func): Add #pragma argsused for Turbo C.
1997-04-29Many files:Theodore Ts'o1-3/+7
Checked in e2fsprogs-1.07
1997-04-26Many files:Theodore Ts'o1-1/+1
Checked in e2fsprogs 1.01.
1997-04-26Many files:Theodore Ts'o1-0/+121
Checked in e2fsprogs 0.5c