Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/utils/sysinst add setting of root's shell, from Juli...



details:   https://anonhg.NetBSD.org/src/rev/58559cc44ca1
branches:  trunk
changeset: 534530:58559cc44ca1
user:      grant <grant%NetBSD.org@localhost>
date:      Mon Jul 29 03:05:16 2002 +0000

description:
add setting of root's shell, from Julio Merino in install/17676 with
minor changes by me.

diffstat:

 distrib/utils/sysinst/defs.h      |   4 +++-
 distrib/utils/sysinst/install.c   |   3 ++-
 distrib/utils/sysinst/menus.mi.en |   6 +++++-
 distrib/utils/sysinst/msg.mi.en   |   6 +++++-
 distrib/utils/sysinst/util.c      |  11 ++++++++++-
 5 files changed, 25 insertions(+), 5 deletions(-)

diffs (104 lines):

diff -r 8e5454a6ba63 -r 58559cc44ca1 distrib/utils/sysinst/defs.h
--- a/distrib/utils/sysinst/defs.h      Mon Jul 29 02:51:07 2002 +0000
+++ b/distrib/utils/sysinst/defs.h      Mon Jul 29 03:05:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.70 2002/06/06 09:53:22 lukem Exp $  */
+/*     $NetBSD: defs.h,v 1.71 2002/07/29 03:05:16 grant Exp $  */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -115,6 +115,7 @@
 EXTERN int sizemult INIT(1);
 EXTERN const char *multname; 
 EXTERN const char *doingwhat;
+EXTERN const char *shellpath;
 
 /* loging variables */
 
@@ -361,6 +362,7 @@
 int    set_timezone (void);
 int    set_crypt_type (void);
 int    set_root_password (void);
+int    set_root_shell (void);
 void   scripting_fprintf(FILE *, const char *, ...);
 void   scripting_vfprintf(FILE *, const char *, va_list);
 void   add_rc_conf(const char *, ...);
diff -r 8e5454a6ba63 -r 58559cc44ca1 distrib/utils/sysinst/install.c
--- a/distrib/utils/sysinst/install.c   Mon Jul 29 02:51:07 2002 +0000
+++ b/distrib/utils/sysinst/install.c   Mon Jul 29 03:05:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: install.c,v 1.28 2002/04/04 14:26:44 ad Exp $  */
+/*     $NetBSD: install.c,v 1.29 2002/07/29 03:05:16 grant Exp $       */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -141,6 +141,7 @@
        set_crypt_type();
 
        set_root_password();
+       set_root_shell();
        
        sanity_check();
 
diff -r 8e5454a6ba63 -r 58559cc44ca1 distrib/utils/sysinst/menus.mi.en
--- a/distrib/utils/sysinst/menus.mi.en Mon Jul 29 02:51:07 2002 +0000
+++ b/distrib/utils/sysinst/menus.mi.en Mon Jul 29 03:05:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menus.mi.en,v 1.55 2002/07/29 02:51:07 grant Exp $     */
+/*     $NetBSD: menus.mi.en,v 1.56 2002/07/29 03:05:16 grant Exp $     */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -457,3 +457,7 @@
        option "Yes", exit, action  {yesno = 1;};
        option "No",  exit, action  {yesno = 0;};
 
+menu rootsh, title "Root shell";
+       option "/bin/csh", exit, action {shellpath = "/bin/csh";};
+       option "/bin/ksh", exit, action {shellpath = "/bin/ksh";};
+       option "/bin/sh",  exit, action {shellpath = "/bin/sh";}; 
diff -r 8e5454a6ba63 -r 58559cc44ca1 distrib/utils/sysinst/msg.mi.en
--- a/distrib/utils/sysinst/msg.mi.en   Mon Jul 29 02:51:07 2002 +0000
+++ b/distrib/utils/sysinst/msg.mi.en   Mon Jul 29 03:05:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.en,v 1.89 2002/07/29 02:51:07 grant Exp $       */
+/*     $NetBSD: msg.mi.en,v 1.90 2002/07/29 03:05:16 grant Exp $       */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -844,6 +844,10 @@
 {The root password of the newly installed system has not yet been initialized,
 and is thus empty.  Do you want to set a root password for the system now?}
 
+message rootsh
+{You can now select which shell to use for the root user. The default is
+/bin/csh, but you may prefer another one.}
+
 message label_size_special
 {
 Special values that can be entered for the size value:
diff -r 8e5454a6ba63 -r 58559cc44ca1 distrib/utils/sysinst/util.c
--- a/distrib/utils/sysinst/util.c      Mon Jul 29 02:51:07 2002 +0000
+++ b/distrib/utils/sysinst/util.c      Mon Jul 29 03:05:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.72 2002/06/29 20:04:56 scottr Exp $ */
+/*     $NetBSD: util.c,v 1.73 2002/07/29 03:05:17 grant Exp $  */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1107,6 +1107,15 @@
        return 0;
 }
 
+int
+set_root_shell()
+{
+       msg_display(MSG_rootsh);
+       process_menu(MENU_rootsh);
+       run_prog(RUN_DISPLAY|RUN_CHROOT, NULL, "chpass -s %s root", shellpath);
+       return 0;
+}
+
 void
 scripting_vfprintf(FILE *f, const char *fmt, va_list ap)
 {



Home | Main Index | Thread Index | Old Index