+1999-03-11 Andreas Dilger <adilger@enel.ucalgary.ca>
+
+ * uuidgen.c, uuidgen.1.in: Created command-line utility to
+ generate UUIDs.
+
+1999-03-14 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * fsck.c (fsck_device, execute): Don't dereference a null pointer
+ when checking a filesystem not in /etc/fstab.
+
1999-02-09 Theodore Ts'o <tytso@rsts-11.mit.edu>
* fsck.c (fsck_device): Print an error message if the user passes
SMANPAGES= tune2fs.8 mklost+found.8 mke2fs.8 dumpe2fs.8 badblocks.8 \
e2label.8 @FSCK_MAN@
-UPROGS= chattr lsattr
-UMANPAGES= chattr.1 lsattr.1
+UPROGS= chattr lsattr uuidgen
+UMANPAGES= chattr.1 lsattr.1 uuidgen.1
TUNE2FS_OBJS= tune2fs.o
MKLPF_OBJS= mklost+found.o
MKE2FS_OBJS= mke2fs.o
CHATTR_OBJS= chattr.o
LSATTR_OBJS= lsattr.o
+UUIDGEN_OBJS= uuidgen.o
DUMPE2FS_OBJS= dumpe2fs.o
BADBLOCKS_OBJS= badblocks.o
E2LABEL_OBJS= e2label.o
SRCS= $(srcdir)/tune2fs.c $(srcdir)/mklost+found.c $(srcdir)/mke2fs.c \
$(srcdir)/chattr.c $(srcdir)/lsattr.c $(srcdir)/dumpe2fs.c \
- $(srcdir)/badblocks.c $(srcdir)/fsck.c
+ $(srcdir)/badblocks.c $(srcdir)/fsck.c $(srcdir)/uuidgen.c
LIBS= $(LIBEXT2FS) $(LIBCOM_ERR)
DEPLIBS= $(LIBEXT2FS) $(LIBCOM_ERR)
lsattr: $(LSATTR_OBJS) $(DEPLIBS_E2P)
$(CC) $(ALL_LDFLAGS) -o lsattr $(LSATTR_OBJS) $(LIBS_E2P)
+uuidgen: $(UUIDGEN_OBJS) $(LIBUUID)
+ $(CC) $(ALL_LDFLAGS) -o uuidgen $(UUIDGEN_OBJS) $(LIBUUID)
+
dumpe2fs: $(DUMPE2FS_OBJS) $(DEPLIBS_E2P)
$(CC) $(ALL_LDFLAGS) -o dumpe2fs $(DUMPE2FS_OBJS) $(LIBS_E2P)
lsattr.1: $(DEP_SUBSTITUTE) $(srcdir)/lsattr.1.in
$(SUBSTITUTE) $(srcdir)/lsattr.1.in lsattr.1
+uuidgen.1: $(DEP_SUBSTITUTE) $(srcdir)/uuidgen.1.in
+ $(SUBSTITUTE) $(srcdir)/uuidgen.1.in uuidgen.1
+
installdirs:
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) \
$(DESTDIR)$(root_sbindir) $(DESTDIR)$(bindir) \
$(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
+uuidgen.o: $(srcdir)/uuidgen.c $(top_srcdir)/lib/uuid/uuid.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 \
}
if (verbose || noexecute) {
- printf("[%s -- %s] ", s, mntpt);
+ printf("[%s -- %s] ", s, mntpt ? mntpt : device);
for (i=0; i < argc; i++)
printf("%s ", argv[i]);
printf("\n");
type = DEFAULT_FSTYPE;
sprintf(prog, "fsck.%s", type);
- retval = execute(prog, device, fsent->mountpt);
+ retval = execute(prog, device, fsent ? fsent->mountpt : 0);
if (retval) {
fprintf(stderr, "%s: Error %d while executing %s for %s\n",
progname, retval, prog, device);
if (!quiet)
printf("Writing superblocks and "
"filesystem accounting information: ");
- ext2fs_close(fs);
+ retval = ext2fs_flush(fs);
+ if (retval) {
+ printf("\nWarning, had trouble writing out superblocks.");
+ }
if (!quiet)
printf("done\n");
+ ext2fs_close(fs);
return 0;
}
--- /dev/null
+.\" Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca)
+.\"
+.\" This man page was created for libuuid.so.1.1 from e2fsprogs-1.14.
+.\"
+.\" This file may be copied under the terms of the GNU Public License.
+.\"
+.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger
+.TH UUIDGEN "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
+.SH NAME
+uuidgen \- command\-line utility to create a new unique UUID value
+.SH SYNOPSIS
+.nf
+.B uuidgen
+.fi
+.SH DESCRIPTION
+The
+.B uuidgen
+program creates a new universally unique identifier using the
+.BR libuuid "(3) functions " uuid_generate "(3) and " uuid_unparse "(3)."
+The new UUID can reasonably be considered unique among all UUIDs created
+on the local system, and among UUIDs created on other systems in the past
+and in the future.
+.SH RETURN VALUE
+The UUID of the form 1b4e28ba\-2fa1\-11d2\-883f\-b9a761bde3fb (in
+.BR printf (3)
+format "%08x\-%04x\-%04x\-%04x\-%012x") is output to the standard output.
+.SH "CONFORMING TO"
+OSF DCE 1.1
+.SH AUTHOR
+.B uuidgen
+was written by Andreas Dilger for libuuid.
+.SH AVAILABILITY
+.B uuidgen
+is part of libuuid from the e2fsprogs package and is available for anonymous
+ftp from tsx\-11.mit.edu (and its mirrors) in /pub/linux/packages/ext2fs.
+.SH "SEE ALSO"
+.BR libuuid (3)
--- /dev/null
+/*
+ * gen_uuid.c --- generate a DCE-compatible uuid
+ *
+ * Copyright (C) 1999, Andreas Dilger
+ *
+ * %Begin-Header%
+ * This file may be redistributed under the terms of the GNU Public
+ * License.
+ * %End-Header%
+ */
+
+#include <stdio.h>
+#include "uuid/uuid.h"
+
+int
+main (int argc, char *argv[])
+{
+ char str[37];
+ uuid_t uu;
+
+ uuid_generate(uu);
+ uuid_unparse(uu, str);
+
+ printf("%s\n", str);
+
+ return 0;
+}