diff options
Diffstat (limited to 'sbin/fsdb')
-rw-r--r-- | sbin/fsdb/fsdb.8 | 39 | ||||
-rw-r--r-- | sbin/fsdb/fsdb.c | 20 | ||||
-rw-r--r-- | sbin/fsdb/fsdbutil.c | 17 |
3 files changed, 33 insertions, 43 deletions
diff --git a/sbin/fsdb/fsdb.8 b/sbin/fsdb/fsdb.8 index c1b9b59..2b4251e 100644 --- a/sbin/fsdb/fsdb.8 +++ b/sbin/fsdb/fsdb.8 @@ -26,7 +26,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: fsdb.8,v 1.6 1997/02/22 14:32:25 peter Exp $ +.\" $Id: fsdb.8,v 1.7 1997/04/15 09:02:43 joerg Exp $ .\" .Dd September 14, 1995 .Dt FSDB 8 @@ -35,13 +35,13 @@ .Nm fsdb .Nd FFS debugging/editing tool .Sh SYNOPSIS -.Nm +.Nm fsdb .Op Fl d .Op Fl f .Op Fl r .Ar fsname .Sh DESCRIPTION -.Nm +.Nm Fsdb opens .Ar fsname (usually a raw disk partition) and runs a command loop @@ -58,20 +58,18 @@ library, so you can use command line editing to reduce typing if desired. When you exit the command loop, the file system superblock is marked dirty and any buffered blocks are written to the file system. .Pp -The -.Fl d -option enables additional debugging output (which comes primarily from +The following options are available: +.Bl -tag -width indent +.It Fl d +Enable additional debugging output (which comes primarily from .Xr fsck 8 -derived code). -.Pp -The -.Fl f -option is left for historical reasons and has no meaning. -.Pp -Option -.Fl r -opens the filesystem read/only, and disables all commands that would +.It Fl f +Left for historical reasons and has no meaning. +.It Fl r +Open the filesystem read/only, and disables all commands that would write to it. +.El .Sh COMMANDS Besides the built-in .Xr libedit 3 @@ -157,7 +155,7 @@ entry if the name will fit into the existing directory slot. .It Cm chtype Ar type Change the type of the current inode to .Ar type . -.Ar type +.Ar Type may be one of: .Em file , .Em dir , @@ -228,14 +226,19 @@ The .Xr libedit 3 reference page is not yet written. .Sh HISTORY -.Nm +.Nm Fsdb uses the source code for .Xr fsck 8 to implement most of the file system manipulation code. The remainder of .Nm -first appeared in NetBSD, written by John T. Kohl. +first appeared in +.Bx Net , +written by +.An John T. Kohl . .br -Peter Wemm ported it to FreeBSD. +.An Peter Wemm +ported it to +.Bx Free . .Sh WARNING Use this tool with extreme caution--you can damage an FFS file system beyond what diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c index 7ab1e05..86a02cf 100644 --- a/sbin/fsdb/fsdb.c +++ b/sbin/fsdb/fsdb.c @@ -26,30 +26,22 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $Id$ */ #ifndef lint -static char rcsid[] = "$Id: fsdb.c,v 1.8 1997/04/15 09:02:45 joerg Exp $"; +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include <sys/types.h> -#include <sys/stat.h> #include <sys/param.h> #include <sys/time.h> -#include <sys/mount.h> #include <ctype.h> -#include <fcntl.h> +#include <err.h> #include <grp.h> #include <histedit.h> -#include <limits.h> #include <pwd.h> -#include <stdio.h> -#include <stdlib.h> #include <string.h> -#include <unistd.h> -#include <err.h> #include <ufs/ufs/dinode.h> #include <ufs/ufs/dir.h> @@ -244,7 +236,7 @@ cmdloop() while ((elline = el_gets(elptr, &scratch)) != NULL && scratch != 0) { if (debug) - printf("command `%s'\n", line); + printf("command `%s'\n", elline); history(hist, H_ENTER, elline); @@ -776,7 +768,7 @@ CMDFUNCSTART(chowner) uid = strtoul(argv[1], &cp, 0); if (cp == argv[1] || *cp != '\0' ) { /* try looking up name */ - if (pwd = getpwnam(argv[1])) { + if ((pwd = getpwnam(argv[1]))) { uid = pwd->pw_uid; } else { warnx("bad uid `%s'", argv[1]); @@ -802,7 +794,7 @@ CMDFUNCSTART(chgroup) gid = strtoul(argv[1], &cp, 0); if (cp == argv[1] || *cp != '\0' ) { - if (grp = getgrnam(argv[1])) { + if ((grp = getgrnam(argv[1]))) { gid = grp->gr_gid; } else { warnx("bad gid `%s'", argv[1]); diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c index 3c23fd6..ee934d1 100644 --- a/sbin/fsdb/fsdbutil.c +++ b/sbin/fsdb/fsdbutil.c @@ -29,25 +29,20 @@ */ #ifndef lint -static char rcsid[] = "$Id: fsdbutil.c,v 1.5 1997/03/13 12:44:53 peter Exp $"; +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include <sys/types.h> -#include <sys/stat.h> #include <sys/param.h> -#include <sys/time.h> -#include <sys/mount.h> #include <ctype.h> -#include <fcntl.h> +#include <err.h> #include <grp.h> #include <pwd.h> -#include <stdio.h> -#include <stdlib.h> #include <string.h> -#include <unistd.h> +#include <time.h> #include <ufs/ufs/dinode.h> -#include <ufs/ffs/fs.h> #include "fsdb.h" #include "fsck.h" @@ -144,11 +139,11 @@ printstat(cp, inum, dp) printf("\n\tATIME=%15.15s %4.4s [%d nsec]\n", &p[4], &p[20], dp->di_atimensec); - if (pw = getpwuid(dp->di_uid)) + if ((pw = getpwuid(dp->di_uid))) printf("OWNER=%s ", pw->pw_name); else printf("OWNUID=%u ", dp->di_uid); - if (grp = getgrgid(dp->di_gid)) + if ((grp = getgrgid(dp->di_gid))) printf("GRP=%s ", grp->gr_name); else printf("GID=%u ", dp->di_gid); |