]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
add a new utility, grub-md5-crypt.
authorokuji <okuji@localhost>
Sat, 21 Oct 2000 21:58:46 +0000 (21:58 +0000)
committerokuji <okuji@localhost>
Sat, 21 Oct 2000 21:58:46 +0000 (21:58 +0000)
16 files changed:
ChangeLog
NEWS
configure
configure.in
docs/Makefile.am
docs/Makefile.in
docs/grub-install.8
docs/grub-md5-crypt.8 [new file with mode: 0644]
docs/grub.texi
docs/stamp-vti
docs/user-ref.texi
docs/version.texi
util/Makefile.am
util/Makefile.in
util/grub-install.in
util/grub-md5-crypt.in [new file with mode: 0644]

index ecabf9cd7f9e5599149c0784f2fa43cd73470cd1..82d4390dc37f932e2370efcde0b5ad9df1887f9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2000-10-22  OKUJI Yoshinori  <okuji@gnu.org>
+
+       * util/grub-install.in (usage): Removed unnecessary commas.
+       
+       * util/grub-md5-crypt.in: New file.
+       * util/Makefile.am (sbin_SCRIPTS): Added grub-md5-crypt.
+       * configure.in (AC_OUTPUT): Added util/grub-md5-crypt.
+       * docs/Makefile.am (man_MANS): Added grub-md5-crypt.8.
+       [MAINTAINER_MODE] ($(srcdir)/grub-md5-crypt.8): New target.
+       * docs/grub-md5-crypt.8: New file. Generated by help2man.
+
+       * docs/grub.texi (grub-md5-crypt): New direntry.
+       (Invoking grub-md5-crypt): New entry.
+       * docs/user-ref.texi (Invoking grub-md5-crypt): New chapter.
+       
 2000-10-22  OKUJI Yoshinori  <okuji@gnu.org>
 
        From Matthias Granberry <matthias@slurpee.org>:
diff --git a/NEWS b/NEWS
index 1a005ff0057319001232048c6d31e3293cbd805d..b745e6e63956052e45835bc51b1684c82ae3fc60 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ New in 1.0 - XXXX-XX-XX:
   items with their own passwords.
 * New command, "displayapm".
 * New command, "md5crypt".
+* The new utility ``grub-md5-crypt'' is a fontend of the grub shell. It
+  encrypts a password in MD5 format.
 
 New in 0.5.96 - 2000-10-04:
 * New commands, "reboot" and "halt".
index afb17d96c5253c00aa62a8a2d788517d2a9744fc..9f493de8703fe613e50027b65733ef843d015cfb 100644 (file)
--- a/configure
+++ b/configure
@@ -2998,7 +2998,8 @@ ac_given_INSTALL="$INSTALL"
 
 trap 'rm -fr `echo "Makefile stage1/Makefile stage2/Makefile docs/Makefile \
        debian/Makefile lib/Makefile util/Makefile grub/Makefile \
-       netboot/Makefile util/grub-image util/grub-install config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+       netboot/Makefile util/grub-image util/grub-install \
+       util/grub-md5-crypt config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -3125,7 +3126,8 @@ cat >> $CONFIG_STATUS <<EOF
 
 CONFIG_FILES=\${CONFIG_FILES-"Makefile stage1/Makefile stage2/Makefile docs/Makefile \
        debian/Makefile lib/Makefile util/Makefile grub/Makefile \
-       netboot/Makefile util/grub-image util/grub-install"}
+       netboot/Makefile util/grub-image util/grub-install \
+       util/grub-md5-crypt"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
index 19746bb5977ae359f1f866fb2b3f2a9efc05146b..89a7a1d6c9190994dc16c0c886efcc4b8f018e27 100644 (file)
@@ -527,4 +527,5 @@ AC_SUBST(NETBOOT_DRIVERS)
 dnl Output.
 AC_OUTPUT([Makefile stage1/Makefile stage2/Makefile docs/Makefile \
        debian/Makefile lib/Makefile util/Makefile grub/Makefile \
-       netboot/Makefile util/grub-image util/grub-install])
+       netboot/Makefile util/grub-image util/grub-install \
+       util/grub-md5-crypt])
index e3fbe4ca078388b37ca395a358167821d8c76fef..55bef2a4b9fbd322c1fe31cd889d32d492e7784b 100644 (file)
@@ -3,7 +3,7 @@ grub_TEXINFOS = tutorial.texi user-ref.texi prog-ref.texi \
        appendices.texi
 EXAMPLES = boot.S kernel.c multiboot.h
 multiboot_TEXINFOS = boot.S.texi kernel.c.texi multiboot.h.texi
-man_MANS = grub.8 mbchk.1 grub-install.8
+man_MANS = grub.8 mbchk.1 grub-install.8 grub-md5-crypt.8
 HELP2MAN = help2man
 SRC2TEXI = src2texi
 noinst_SCRIPTS = $(HELP2MAN) $(SRC2TEXI)
@@ -38,4 +38,10 @@ $(srcdir)/mbchk.1: ../util/mbchk $(srcdir)/$(HELP2MAN)
        $(PERL) $(srcdir)/$(HELP2MAN) \
                --name="check the format of a Multiboot kernel" \
                --section=1 --output=$@ $<
+
+$(srcdir)/grub-md5-crypt.8: ../util/grub-md5-crypt $(srcdir)/$(HELP2MAN)
+       chmod 755 $<
+       $(PERL) $(srcdir)/$(HELP2MAN) \
+               --name="Encrypt a password in MD5 format" \
+               --section=8 --output=$@ $<
 endif
index 11c6aa62b339ba72a028436126691e59d2fe2827..11fb16a23588e5bb17b24804ccf9212ad71114d1 100644 (file)
@@ -93,7 +93,7 @@ grub_TEXINFOS = tutorial.texi user-ref.texi prog-ref.texi \
 
 EXAMPLES = boot.S kernel.c multiboot.h
 multiboot_TEXINFOS = boot.S.texi kernel.c.texi multiboot.h.texi
-man_MANS = grub.8 mbchk.1 grub-install.8
+man_MANS = grub.8 mbchk.1 grub-install.8 grub-md5-crypt.8
 HELP2MAN = help2man
 SRC2TEXI = src2texi
 noinst_SCRIPTS = $(HELP2MAN) $(SRC2TEXI)
@@ -469,6 +469,12 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 @MAINTAINER_MODE_TRUE@         --name="check the format of a Multiboot kernel" \
 @MAINTAINER_MODE_TRUE@         --section=1 --output=$@ $<
 
+@MAINTAINER_MODE_TRUE@$(srcdir)/grub-md5-crypt.8: ../util/grub-md5-crypt $(srcdir)/$(HELP2MAN)
+@MAINTAINER_MODE_TRUE@ chmod 755 $<
+@MAINTAINER_MODE_TRUE@ $(PERL) $(srcdir)/$(HELP2MAN) \
+@MAINTAINER_MODE_TRUE@         --name="Encrypt a password in MD5 format" \
+@MAINTAINER_MODE_TRUE@         --section=8 --output=$@ $<
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 1e42564277c6182bb4d5079ec0dd4c03b230956a..8c30a6d92b575969e68cfc9d4ce3bdacd248959f 100644 (file)
@@ -16,21 +16,21 @@ print the version information and exit
 .TP
 \fB\-\-root\-directory\fR=\fIDIR\fR
 install GRUB images under the directory DIR
-instead of the root directory.
+instead of the root directory
 .TP
 \fB\-\-grub\-shell\fR=\fIFILE\fR
-use FILE as the grub shell.
+use FILE as the grub shell
 .TP
 \fB\-\-force\-lba\fR
 force GRUB to use LBA mode even for a buggy
-BIOS.
+BIOS
 .TP
 \fB\-\-recheck\fR
-probe a device map even if it already exists.
+probe a device map even if it already exists
 .PP
 INSTALL_DEVICE can be a GRUB device name or a system device filename.
-.PP
-Reports bugs to <bug-grub@gnu.org>.
+.SH "REPORTING BUGS"
+Report bugs to <bug-grub@gnu.org>.
 .SH "SEE ALSO"
 The full documentation for
 .B grub-install
diff --git a/docs/grub-md5-crypt.8 b/docs/grub-md5-crypt.8
new file mode 100644 (file)
index 0000000..23805fe
--- /dev/null
@@ -0,0 +1,32 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.020.
+.TH GRUB-MD5-CRYPT "8" "October 2000" "grub-md5-crypt (GNU GRUB )" FSF
+.SH NAME
+grub-md5-crypt \- Encrypt a password in MD5 format
+.SH SYNOPSIS
+.B grub-md5-crypt
+[\fIOPTION\fR]
+.SH DESCRIPTION
+Encrypt a password in MD5 format.
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+print this message and exit
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+print the version information and exit
+.TP
+\fB\-\-grub\-shell\fR=\fIFILE\fR
+use FILE as the grub shell
+.SH "REPORTING BUGS"
+Report bugs to <bug-grub@gnu.org>.
+.SH "SEE ALSO"
+The full documentation for
+.B grub-md5-crypt
+is maintained as a Texinfo manual.  If the
+.B info
+and
+.B grub-md5-crypt
+programs are properly installed at your site, the command
+.IP
+.B info grub-md5-crypt
+.PP
+should give you access to the complete manual.
index cf077a289ed72970426d82ebeee4b9be265f55ee..64ec979e3f6ed87ff0bf293f3bb87f85f7d87d1e 100644 (file)
@@ -22,6 +22,8 @@
 @direntry
 * GRUB: (grub).                 The GRand Unified Bootloader
 * grub-install: (grub)Invoking grub-install.    Install GRUB on your drive
+* grub-md5-crypt: (grub)Invoking grub-md5-crypt.        Encrypt a password
+                                                        in MD5 format
 * mbchk: (grub)Invoking mbchk.  Check for the format of a Multiboot kernel
 @end direntry
 
@@ -113,6 +115,7 @@ Part II: The User Reference Manual
 * Troubleshooting::             Error messages produced by GRUB
 * Invoking the grub shell::     How to use the grub shell
 * Invoking grub-install::       How to use the GRUB installer
+* Invoking grub-md5-crypt::     How to generate a cryptic password
 * Invoking mbchk::              How to use the Multiboot checker
 
 Part III: The Programmer Reference Manual
index f31a10271aac6a17035400bbee6ee7df18df7faa..b8bcdfaffb9fdb547710f7b6406830ba51ea194f 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 14 October 2000
+@set UPDATED 22 October 2000
 @set EDITION 0.5.97
 @set VERSION 0.5.97
index 2b8a53ff15366aeb7dafd07bd96c5a309692a96a..90938f840eaa4da50b16d55a37da0dd819733383 100644 (file)
@@ -1654,6 +1654,28 @@ grub-install --grub-shell="grub --read-only" /dev/fd0
 @end table
 
 
+@node Invoking grub-md5-crypt
+@chapter Invoking grub-md5-crypt
+
+The program @command{grub-md5-crypt} encrypts a password in MD5 format.
+This is just a frontend of the grub shell (@pxref{Invoking the grub
+shell}). Passwords encrypted by this program can be used with the
+command @command{password} (@pxref{Command-line and menu commands}).
+
+@command{grub-md5-crypt} accepts the following options:
+
+@table @option
+@item --help
+Print a summary of the command line options and exit.
+
+@item --version
+Print the version information and exit.
+
+@item --grub-shell=@var{file}
+Use @var{file} as the grub shell.
+@end table
+
+
 @node Invoking mbchk
 @chapter Invoking mbchk
 
index f31a10271aac6a17035400bbee6ee7df18df7faa..b8bcdfaffb9fdb547710f7b6406830ba51ea194f 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 14 October 2000
+@set UPDATED 22 October 2000
 @set EDITION 0.5.97
 @set VERSION 0.5.97
index 732e09428656400753fc0581580a88ff85e079b5..f84193c6a31cb4611324215c75aa20b5b8deeeb7 100644 (file)
@@ -1,5 +1,5 @@
 bin_PROGRAMS = mbchk
-sbin_SCRIPTS = grub-install
+sbin_SCRIPTS = grub-install grub-md5-crypt
 noinst_SCRIPTS = grub-image
 
 # XXX: Need to search for a header file in docs, because of multiboot.h.
index 62a95a4fb49b245a455a914bb084d19810074d2f..ed3f583fc8a803efef18582ab04a954900d0e87d 100644 (file)
@@ -88,7 +88,7 @@ install_sh = @install_sh@
 
 
 bin_PROGRAMS = mbchk
-sbin_SCRIPTS = grub-install
+sbin_SCRIPTS = grub-install grub-md5-crypt
 noinst_SCRIPTS = grub-image
 
 # XXX: Need to search for a header file in docs, because of multiboot.h.
@@ -99,7 +99,7 @@ mbchk_LDADD = ../lib/libcommon.a
 subdir = util
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =  grub-image grub-install
+CONFIG_CLEAN_FILES =  grub-image grub-install grub-md5-crypt
 PROGRAMS =  $(bin_PROGRAMS)
 
 
@@ -120,7 +120,8 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 DIST_SOURCES =  $(mbchk_SOURCES)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 DEP_FILES =  @AMDEP@ $(DEPDIR)/mbchk.Po
-DIST_COMMON =  Makefile.am Makefile.in grub-image.in grub-install.in
+DIST_COMMON =  Makefile.am Makefile.in grub-image.in grub-install.in \
+grub-md5-crypt.in
 
 
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -143,6 +144,8 @@ grub-image: $(top_builddir)/config.status grub-image.in
        cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 grub-install: $(top_builddir)/config.status grub-install.in
        cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+grub-md5-crypt: $(top_builddir)/config.status grub-md5-crypt.in
+       cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 mostlyclean-binPROGRAMS:
 
index 99a40b006e13155cc5763dc68ca10120592e0aed..f5e5c9e6ef978a2bd1847117c82bf6ef1128a308 100644 (file)
@@ -49,15 +49,15 @@ Install GRUB on your drive.
   -h, --help              print this message and exit
   -v, --version           print the version information and exit
   --root-directory=DIR    install GRUB images under the directory DIR
-                          instead of the root directory.
-  --grub-shell=FILE       use FILE as the grub shell.
+                          instead of the root directory
+  --grub-shell=FILE       use FILE as the grub shell
   --force-lba             force GRUB to use LBA mode even for a buggy
-                          BIOS.
-  --recheck               probe a device map even if it already exists.
+                          BIOS
+  --recheck               probe a device map even if it already exists
 
 INSTALL_DEVICE can be a GRUB device name or a system device filename.
 
-Reports bugs to <bug-grub@gnu.org>.
+Report bugs to <bug-grub@gnu.org>.
 EOF
 }
 
diff --git a/util/grub-md5-crypt.in b/util/grub-md5-crypt.in
new file mode 100644 (file)
index 0000000..8794f52
--- /dev/null
@@ -0,0 +1,93 @@
+#! /bin/sh
+
+# Encrypt a password in MD5 format
+#   Copyright (C) 2000 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Initialize some variables.
+grub_shell=${sbindir}/grub
+progname="grub-md5-crypt"
+
+# Check the arguments.
+for option in "$@"; do
+    case "$option" in
+    -h | --help)
+       cat <<EOF
+Usage: $progname [OPTION]
+Encrypt a password in MD5 format.
+
+  -h, --help              print this message and exit
+  -v, --version           print the version information and exit
+  --grub-shell=FILE       use FILE as the grub shell
+
+Report bugs to <bug-grub@gnu.org>.
+EOF
+       exit 0
+       ;;
+
+    -v | --version)
+       echo "$progname (GNU GRUB ${VERSION})"
+       exit 0
+       ;;
+
+    --grub-shell=*)
+       grub_shell=`echo "$option" | sed 's/--grub-shell=//'`
+       ;;
+
+    *)
+       echo "$progname: unrecognized option `$option'"
+       echo "Usage: $progname [OPTION]"
+       echo "Try `$progname --help' for more information."
+       exit 1
+       ;;
+    esac
+done
+
+# Suppress echo backs. I don't know if this is really portable. -okuji
+stty -echo
+
+# Prompt to enter a password.
+echo -n "Password: "
+
+# read only one line... I don't know any really portable command for this.
+# Does anyone know? -okuji
+if test "x$BASH" = x; then
+    # FIXME: Use Perl instead at the moment.
+    password=`perl -e '$line = <>; print $line;'`
+else
+    # In BASH, use the builtin command ``read''.
+    read -r password
+fi
+
+# Resume echo backs.
+echo
+stty echo
+
+if test "x$password" = x; then
+    echo "Empty password is not permitted."
+    exit 1
+fi
+
+# Run the grub shell.
+$grub_shell --batch --device-map=/dev/null <<EOF \
+    | grep "^Encrypted: " | sed 's/^Encrypted: //'
+md5crypt
+$password
+quit
+EOF
+
+# Bye.
+exit 0