Whamcloud - gitweb
ChangeLog, pass3.c, problem.c:
authorTheodore Ts'o <tytso@mit.edu>
Thu, 3 Dec 1998 16:40:38 +0000 (16:40 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 3 Dec 1998 16:40:38 +0000 (16:40 +0000)
  pass3.c (get_lost_and_found): If the filesystem is not opened
   read-only, then force /lost+found to be created if it is not present.
  problem.c: Allow PR_3_NO_LF_DIR to be handled during a preen operation.
ChangeLog, Makefile.in:
  Makefile.in: Updated dependencies.
ChangeLog, fsck.c:
  fsck.c (load_fs_info): Parse /etc/fstab ourselves, instead of relying
   on getmntent().  This has the advantage of allowing us to properly
   handle missing pass numbers correctly.
ChangeLog, configure.in:
  configure.in: Add paths.h to header files for which we search.

13 files changed:
ChangeLog
configure.in
e2fsck/ChangeLog
e2fsck/Makefile.in
e2fsck/pass3.c
e2fsck/problem.c
lib/e2p/ChangeLog
lib/e2p/Makefile.in
lib/ext2fs/ChangeLog
lib/ext2fs/Makefile.in
misc/ChangeLog
misc/Makefile.in
misc/fsck.c

index 171bbd2..7df042d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+1998-11-27  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * configure.in: Add paths.h to header files for which we search.
+
 1998-07-09  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * Release of E2fsprogs 1.12
index 1b1a9f4..63609f6 100644 (file)
@@ -316,7 +316,7 @@ AC_CHECK_TOOL(STRIP, strip, :)
 AC_PROG_CC
 AC_PROG_INSTALL
 AC_C_CROSS
-AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h mntent.h dirent.h getopt.h setjmp.h linux/fd.h linux/major.h sys/disklabel.h sys/sockio.h sys/time.h sys/stat.h sys/types.h net/if.h netinet/in.h)
+AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h mntent.h paths.h dirent.h getopt.h setjmp.h linux/fd.h linux/major.h sys/disklabel.h sys/sockio.h sys/time.h sys/stat.h sys/types.h net/if.h netinet/in.h)
 AC_FUNC_VPRINTF
 dnl
 dnl See if struct dirent has a d_namlen field (like bsd systems), implying
index 0e651f5..b569938 100644 (file)
@@ -1,3 +1,16 @@
+1998-12-03  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * Makefile.in: Updated dependencies.
+
+1998-11-27  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * pass3.c (get_lost_and_found): If the filesystem is not opened
+               read-only, then force /lost+found to be created if it is
+               not present.
+
+       * problem.c: Allow PR_3_NO_LF_DIR to be handled during a preen
+               operation. 
+
 1998-10-28  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * unix.c (main): Move ext2fs_close() after e2fsck_free_context()
index d93624c..cec98e7 100644 (file)
@@ -151,25 +151,23 @@ distclean: clean
 # Makefile dependencies follow.  This must be the last section in
 # the Makefile.in file
 #
-e2fsck.o: $(srcdir)/e2fsck.c $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
+e2fsck.o: $(srcdir)/e2fsck.c $(srcdir)/e2fsck.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h
 super.o: $(srcdir)/super.c $(top_srcdir)/lib/uuid/uuid.h $(srcdir)/e2fsck.h \
  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h \
- $(srcdir)/../version.h
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h
 pass1.o: $(srcdir)/pass1.c $(srcdir)/e2fsck.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h
 pass1b.o: $(srcdir)/pass1b.c $(top_srcdir)/lib/et/com_err.h \
  $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h
-pass2.o: $(srcdir)/pass2.c $(srcdir)/e2fsck.h  \
+pass2.o: $(srcdir)/pass2.c $(srcdir)/e2fsck.h \
  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h
@@ -189,24 +187,23 @@ badblocks.o: $(srcdir)/badblocks.c $(top_srcdir)/lib/et/com_err.h \
  $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/bitops.h
-util.o: $(srcdir)/util.c $(srcdir)/e2fsck.h \
+util.o: $(srcdir)/util.c $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h
+unix.o: $(srcdir)/unix.c $(top_srcdir)/lib/et/com_err.h $(srcdir)/e2fsck.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \
+ $(srcdir)/problem.h $(srcdir)/../version.h
+dirinfo.o: $(srcdir)/dirinfo.c $(srcdir)/e2fsck.h \
  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/bitops.h  
-unix.o: $(srcdir)/unix.c $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
- $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h \
- $(srcdir)/../version.h
-dirinfo.o: $(srcdir)/dirinfo.c $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
- $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/bitops.h
 ehandler.o: $(srcdir)/ehandler.c $(srcdir)/e2fsck.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/bitops.h  
+ $(top_srcdir)/lib/ext2fs/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h 
 problem.o: $(srcdir)/problem.c $(srcdir)/e2fsck.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h
+ $(top_srcdir)/lib/ext2fs/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \
+ $(srcdir)/problem.h $(srcdir)/problemP.h
index 0700698..560f291 100644 (file)
@@ -124,6 +124,12 @@ void e2fsck_pass3(e2fsck_t ctx)
                        check_directory(ctx, dir, &pctx);
        }
 
+       /*
+        * Force the creation of /lost+found if not present
+        */
+       if ((ctx->flags & E2F_OPT_READONLY) == 0)
+               get_lost_and_found(ctx);
+
 abort_exit:
        e2fsck_free_dir_info(ctx);
        if (inode_loop_detect)
index e9ef1cf..5113d4a 100644 (file)
@@ -710,7 +710,7 @@ static const struct e2fsck_problem problem_table[] = {
        /* /lost+found not found */
        { PR_3_NO_LF_DIR,
          "/@l not found.  ",
-         PROMPT_CREATE, 0 },
+         PROMPT_CREATE, PR_PREEN_OK },
 
        /* .. entry is incorrect */
        { PR_3_BAD_DOT_DOT,
index f042efe..8e0656b 100644 (file)
@@ -1,3 +1,7 @@
+1998-12-02  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * Makefile.in: Updated dependencies.
+
 1998-07-09  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * Release of E2fsprogs 1.12
index b936684..3bf404c 100644 (file)
@@ -92,17 +92,19 @@ distclean:: clean
 # Makefile dependencies follow.  This must be the last section in
 # the Makefile.in file
 #
-fgetflags.o: $(srcdir)/fgetflags.c $(srcdir)/e2p.h
-fsetflags.o: $(srcdir)/fsetflags.c $(srcdir)/e2p.h 
+fgetflags.o: $(srcdir)/fgetflags.c $(srcdir)/e2p.h 
+fsetflags.o: $(srcdir)/fsetflags.c $(srcdir)/e2p.h
 fgetversion.o: $(srcdir)/fgetversion.c $(srcdir)/e2p.h
 fsetversion.o: $(srcdir)/fsetversion.c $(srcdir)/e2p.h
 getflags.o: $(srcdir)/getflags.c $(srcdir)/e2p.h
 getversion.o: $(srcdir)/getversion.c $(srcdir)/e2p.h
-iod.o: $(srcdir)/iod.c $(srcdir)/e2p.h
+iod.o: $(srcdir)/iod.c $(srcdir)/e2p.h 
 ls.o: $(srcdir)/ls.c $(srcdir)/e2p.h
 pe.o: $(srcdir)/pe.c $(srcdir)/e2p.h
 pf.o: $(srcdir)/pf.c $(srcdir)/e2p.h
 ps.o: $(srcdir)/ps.c $(srcdir)/e2p.h
 setflags.o: $(srcdir)/setflags.c $(srcdir)/e2p.h
 setversion.o: $(srcdir)/setversion.c $(srcdir)/e2p.h
-uuid.o: $(srcdir)/uuid.c
+uuid.o: $(srcdir)/uuid.c $(srcdir)/e2p.h
+
index 5353ef9..8844c17 100644 (file)
@@ -1,3 +1,7 @@
+1998-12-03  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * Makefile.in: Updated dependencies.
+
 1998-09-22  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * initialize.c (ext2fs_initialize): Make sure that we allocate
index 962d843..6171d9b 100644 (file)
@@ -63,9 +63,7 @@ SRCS= ext2_err.c \
        $(srcdir)/bitmaps.c \
        $(srcdir)/bitops.c \
        $(srcdir)/block.c \
-#      $(srcdir)/brel_ma.c \
        $(srcdir)/bmap.c \
-#      $(srcdir)/bmove.c \
        $(srcdir)/check_desc.c \
        $(srcdir)/closefs.c \
        $(srcdir)/cmp_bitmaps.c \
@@ -83,7 +81,6 @@ SRCS= ext2_err.c \
        $(srcdir)/initialize.c \
        $(srcdir)/inline.c \
        $(srcdir)/inode.c \
-#      $(srcdir)/irel_ma.c \
        $(srcdir)/ismounted.c \
        $(srcdir)/link.c \
        $(srcdir)/llseek.c \
@@ -205,197 +202,144 @@ distclean:: clean
 # the Makefile.in file
 #
 ext2_err.o: ext2_err.c
-alloc.o: $(srcdir)/alloc.c \
- $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-alloc_tables.o: $(srcdir)/alloc_tables.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-badblocks.o: $(srcdir)/badblocks.c \
- $(srcdir)/ext2fsP.h \
- $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-bb_compat.o: $(srcdir)/bb_compat.c \
- $(srcdir)/ext2fsP.h \
+alloc.o: $(srcdir)/alloc.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+alloc_tables.o: $(srcdir)/alloc_tables.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+badblocks.o: $(srcdir)/badblocks.c $(srcdir)/ext2fsP.h $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+bb_compat.o: $(srcdir)/bb_compat.c $(srcdir)/ext2fsP.h $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+bb_inode.o: $(srcdir)/bb_inode.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+bitmaps.o: $(srcdir)/bitmaps.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+bitops.o: $(srcdir)/bitops.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+block.o: $(srcdir)/block.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+bmap.o: $(srcdir)/bmap.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+check_desc.o: $(srcdir)/check_desc.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+closefs.o: $(srcdir)/closefs.c $(srcdir)/ext2fsP.h \
  $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(srcdir)/bitops.h
-bb_inode.o: $(srcdir)/bb_inode.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-bitmaps.o: $(srcdir)/bitmaps.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-bitops.o: $(srcdir)/bitops.c \
+cmp_bitmaps.o: $(srcdir)/cmp_bitmaps.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+dblist.o: $(srcdir)/dblist.c $(srcdir)/ext2fsP.h \
  $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(srcdir)/bitops.h
-block.o: $(srcdir)/block.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-brel_ma.o: $(srcdir)/brel_ma.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h $(srcdir)/brel.h
-bmove.o: $(srcdir)/bmove.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-check_desc.o: $(srcdir)/check_desc.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-closefs.o: $(srcdir)/closefs.c \
- $(srcdir)/ext2fsP.h \
+dblist_dir.o: $(srcdir)/dblist_dir.c $(srcdir)/ext2fsP.h \
  $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(srcdir)/bitops.h
-cmp_bitmaps.o: $(srcdir)/cmp_bitmaps.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-dblist.o: $(srcdir)/dblist.c \
- $(srcdir)/ext2fsP.h $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-dblist_dir.o: $(srcdir)/dblist_dir.c \
- $(srcdir)/ext2fsP.h $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-dirblock.o: $(srcdir)/dirblock.c \
+dirblock.o: $(srcdir)/dirblock.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+dir_iterate.o: $(srcdir)/dir_iterate.c $(srcdir)/ext2fsP.h \
+ $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+dupfs.o: $(srcdir)/dupfs.c $(srcdir)/ext2fsP.h \
  $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(srcdir)/bitops.h
-dir_iterate.o: $(srcdir)/dir_iterate.c \
- $(srcdir)/ext2fsP.h $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-dupfs.o: $(srcdir)/dupfs.c \
- $(srcdir)/ext2fsP.h \
+expanddir.o: $(srcdir)/expanddir.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+fileio.o: $(srcdir)/fileio.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+freefs.o: $(srcdir)/freefs.c $(srcdir)/ext2fsP.h \
  $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(srcdir)/bitops.h
-expanddir.o: $(srcdir)/expanddir.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-freefs.o: $(srcdir)/freefs.c \
- $(srcdir)/ext2fsP.h \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-get_pathname.o: $(srcdir)/get_pathname.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-getsize.o: $(srcdir)/getsize.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-icount.o: $(srcdir)/icount.c $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2fs.h \
- $(srcdir)/ext2_io.h \
+get_pathname.o: $(srcdir)/get_pathname.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
  $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
-initialize.o: $(srcdir)/initialize.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-inline.o: $(srcdir)/inline.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-inode.o: $(srcdir)/inode.c \
- $(srcdir)/ext2fsP.h $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-irel_ma.o: $(srcdir)/irel_ma.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h $(srcdir)/irel.h
-ismounted.o: $(srcdir)/ismounted.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-link.o: $(srcdir)/link.c \
- $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-llseek.o: $(srcdir)/llseek.c $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h
+getsize.o: $(srcdir)/getsize.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+icount.o: $(srcdir)/icount.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+initialize.o: $(srcdir)/initialize.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+inline.o: $(srcdir)/inline.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+inode.o: $(srcdir)/inode.c $(srcdir)/ext2fsP.h $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+ismounted.o: $(srcdir)/ismounted.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+link.o: $(srcdir)/link.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+llseek.o: $(srcdir)/llseek.c $(top_srcdir)/lib/et/com_err.h \
+ $(srcdir)/ext2_io.h  
 lookup.o: $(srcdir)/lookup.c $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 mkdir.o: $(srcdir)/mkdir.c $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 namei.o: $(srcdir)/namei.c $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 native.o: $(srcdir)/native.c $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 newdir.o: $(srcdir)/newdir.c $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 openfs.o: $(srcdir)/openfs.c $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 read_bb.o: $(srcdir)/read_bb.c $(srcdir)/ext2fs.h \
  $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
  $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 read_bb_file.o: $(srcdir)/read_bb_file.c $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 rs_bitmap.o: $(srcdir)/rs_bitmap.c $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 rw_bitmaps.o: $(srcdir)/rw_bitmaps.c $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 swapfs.o: $(srcdir)/swapfs.c $(srcdir)/ext2fs.h \
  $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
  $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
-test_io.o: $(srcdir)/test_io.c $(top_srcdir)/lib/et/com_err.h \
- $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/ext2_io.h
-unix_io.o: $(srcdir)/unix_io.c $(top_srcdir)/lib/et/com_err.h \
- $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/ext2_io.h
+test_io.o: $(srcdir)/test_io.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+unix_io.o: $(srcdir)/unix_io.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
 unlink.o: $(srcdir)/unlink.c $(srcdir)/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-valid_blk.o: $(srcdir)/valid_blk.c \
- $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(srcdir)/bitops.h
-version.o: $(srcdir)/version.c $(top_srcdir)/lib/et/com_err.h \
- $(srcdir)/ext2fs.h $(srcdir)/ext2_io.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+valid_blk.o: $(srcdir)/valid_blk.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h
+version.o: $(srcdir)/version.c $(srcdir)/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
  $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h \
  $(srcdir)/../../version.h
 
index d802b12..888932b 100644 (file)
@@ -1,3 +1,13 @@
+1998-12-03  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * Makefile.in: Updated dependencies.
+
+1998-11-27  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * fsck.c (load_fs_info): Parse /etc/fstab ourselves, instead of
+               relying on getmntent().  This has the advantage of
+               allowing us to properly handle missing pass numbers correctly.
+
 1998-11-13  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * tune2fs.8.in: Fix minor display bug in the nroff.
index fb56149..83877cf 100644 (file)
@@ -180,10 +180,11 @@ chattr.o: $(srcdir)/chattr.c $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/e2p/e2p.h $(srcdir)/../version.h
 lsattr.o: $(srcdir)/lsattr.c $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/e2p/e2p.h $(srcdir)/../version.h
-dumpe2fs.o: $(srcdir)/dumpe2fs.c $(top_srcdir)/lib/ext2fs/ext2fs.h \
- $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
- $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \
- $(top_srcdir)/lib/e2p/e2p.h $(srcdir)/../version.h
+dumpe2fs.o: $(srcdir)/dumpe2fs.c \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/e2p/e2p.h \
+ $(srcdir)/../version.h
 badblocks.o: $(srcdir)/badblocks.c $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h
 fsck.o: $(srcdir)/fsck.c $(srcdir)/../version.h $(srcdir)/fsck.h
index c30997e..dac9707 100644 (file)
@@ -39,8 +39,8 @@
 #if HAVE_ERRNO_H
 #include <errno.h>
 #endif
-#if HAVE_MNTENT_H
-#include <mntent.h>
+#if HAVE_PATHS_H
+#include <paths.h>
 #endif
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #include "../version.h"
 #include "fsck.h"
 
+#ifndef _PATH_MNTTAB
+#define        _PATH_MNTTAB    "/etc/fstab"
+#endif
+
 static const char *ignored_types[] = {
        "ignore",
        "iso9660",
@@ -143,6 +147,49 @@ static char *string_copy(const char *s)
        return ret;
 }
 
+static char *skip_over_blank(char *cp)
+{
+       while (*cp && isspace(*cp))
+               cp++;
+       return cp;
+}
+
+static char *skip_over_word(char *cp)
+{
+       while (*cp && !isspace(*cp))
+               cp++;
+       return cp;
+}
+
+static void strip_line(char *line)
+{
+       char    *p;
+
+       while (*line) {
+               p = line + strlen(line) - 1;
+               if ((*p == '\n') || (*p == '\r'))
+                       *p = 0;
+               else
+                       break;
+       }
+}
+
+static char *parse_word(char **buf)
+{
+       char *word, *next;
+
+       word = *buf;
+       if (*word == 0)
+               return 0;
+
+       word = skip_over_blank(word);
+       next = skip_over_word(word);
+       if (*next)
+               *next++ = 0;
+       *buf = next;
+       return word;
+}
+
 static void free_instance(struct fsck_instance *i)
 {
        if (i->prog)
@@ -153,47 +200,77 @@ static void free_instance(struct fsck_instance *i)
        return;
 }
 
+struct fs_info *parse_fstab_line(char *line)
+{
+       char    *device, *mntpnt, *type, *opts, *freq, *passno, *cp;
+       struct fs_info *fs;
+
+       strip_line(line);
+       cp = line;
+
+       device = parse_word(&cp);
+       mntpnt = parse_word(&cp);
+       type = parse_word(&cp);
+       opts = parse_word(&cp);
+       freq = parse_word(&cp);
+       passno = parse_word(&cp);
+
+       if (!device || !mntpnt || !type)
+               return 0;
+       
+       if (!(fs = malloc(sizeof(struct fs_info))))
+               return 0;
+
+       fs->device = string_copy(device);
+       fs->mountpt = string_copy(mntpnt);
+       fs->type = string_copy(type);
+       fs->opts = string_copy(opts ? opts : "");
+       fs->freq = freq ? atoi(freq) : -1;
+       fs->passno = passno ? atoi(passno) : -1;
+       fs->flags = 0;
+       fs->next = NULL;
+
+       return fs;
+}
+
 /*
  * Load the filesystem database from /etc/fstab
  */
-static void load_fs_info(NOARGS)
+static void load_fs_info(char *filename)
 {
-#if HAVE_MNTENT_H
-       FILE *mntfile;
-       struct mntent *mp;
-       struct fs_info *fs;
-       struct fs_info *fs_last = NULL;
+       FILE    *f;
+       char    buf[1024];
+       int     lineno = 0;
        int     old_fstab = 1;
+       struct fs_info *fs, *fs_last = NULL;
 
        filesys_info = NULL;
-       
-       /* Open the mount table. */
-       if ((mntfile = setmntent(MNTTAB, "r")) == NULL) {
-               perror(MNTTAB);
-               exit(EXIT_ERROR);
+       if ((f = fopen(filename, "r")) == NULL) {
+               fprintf(stderr, "WARNING: couldn't open %s: %s\n",
+                       filename, strerror(errno));
+               return;
        }
-
-       while ((mp = getmntent(mntfile)) != NULL) {
-               fs = malloc(sizeof(struct fs_info));
-               memset(fs, 0, sizeof(struct fs_info));
-               fs->device = string_copy(mp->mnt_fsname);
-               fs->mountpt = string_copy(mp->mnt_dir);
-               fs->type = string_copy(mp->mnt_type);
-               fs->opts = string_copy(mp->mnt_opts);
-               fs->freq = mp->mnt_freq;
-               fs->passno = mp->mnt_passno;
-               fs->next = NULL;
+       while (!feof(f)) {
+               lineno++;
+               if (!fgets(buf, sizeof(buf), f))
+                       break;
+               buf[sizeof(buf)-1] = 0;
+               if ((fs = parse_fstab_line(buf)) == NULL) {
+                       fprintf(stderr, "WARNING: bad format "
+                               "on line %d of %s\n", lineno, filename);
+                       continue;
+               }
                if (!filesys_info)
                        filesys_info = fs;
                else
                        fs_last->next = fs;
                fs_last = fs;
-               if (fs->passno)
+               if (fs->passno >=0)
                        old_fstab = 0;
        }
-
-       (void) endmntent(mntfile);
-
+       
+       fclose(f);
+       
        if (old_fstab) {
                fprintf(stderr, "\007\007\007"
        "WARNING: Your /etc/fstab does not contain the fsck passno\n");
@@ -206,9 +283,6 @@ static void load_fs_info(NOARGS)
                        fs->passno = 1;
                }
        }
-#else
-       filesys_info = NULL;
-#endif /* HAVE_MNTENT_H */
 }
        
 /* Lookup filesys in /etc/fstab and return the corresponding entry. */
@@ -642,8 +716,6 @@ static void PRS(int argc, char *argv[])
 
        progname = argv[0];
 
-       load_fs_info();
-
        for (i=1; i < argc; i++) {
                arg = argv[i];
                if (!arg)
@@ -744,6 +816,8 @@ int main(int argc, char *argv[])
                printf("Parallelizing fsck version %s (%s)\n",
                        E2FSPROGS_VERSION, E2FSPROGS_DATE);
 
+       load_fs_info(_PATH_MNTTAB);
+
        /* Update our search path to include uncommon directories. */
        if (oldpath) {
                fsck_path = malloc (strlen (fsck_prefix_path) + 1 +