diff options
author | jkh <jkh@FreeBSD.org> | 1997-01-12 11:13:43 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-01-12 11:13:43 +0000 |
commit | 6b8a0537c1f26a64228c4b746236991ed877b7cc (patch) | |
tree | f5e276759cf4229097ffd2bdf8f09bcb354ab640 /usr.sbin | |
parent | 25e0b77a17964346d2195f7fa258923832ce54b5 (diff) | |
download | FreeBSD-src-6b8a0537c1f26a64228c4b746236991ed877b7cc.zip FreeBSD-src-6b8a0537c1f26a64228c4b746236991ed877b7cc.tar.gz |
Add more protection when running as init and don't do stupid things.
Fix looping in fixit cdrom selection by adding a missing break.
Move unmount of cdrom down to proper place.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sade/install.c | 10 | ||||
-rw-r--r-- | usr.sbin/sysinstall/cdrom.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/install.c | 10 |
3 files changed, 19 insertions, 5 deletions
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index cf5abaa..5a95165 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.147 1996/12/29 05:51:35 jkh Exp $ + * $Id: install.c,v 1.148 1997/01/06 11:10:25 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -254,6 +254,9 @@ installFixitCDROM(dialogMenuItem *self) { struct stat sb; + if (!RunningAsInit) + return DITEM_SUCCESS; + variable_set2(SYSTEM_STATE, "fixit"); (void)unlink("/mnt2"); (void)rmdir("/mnt2"); @@ -269,6 +272,8 @@ installFixitCDROM(dialogMenuItem *self) if (msgYesNo("Unable to mount the CDROM - do you want to try again?") != 0) return DITEM_FAILURE; } + else + break; } /* Since the fixit code expects everything to be in /mnt2, and the CDROM mounting stuff /cdrom, do @@ -323,6 +328,9 @@ installFixitFloppy(dialogMenuItem *self) { struct ufs_args args; + if (!RunningAsInit) + return DITEM_SUCCESS; + variable_set2(SYSTEM_STATE, "fixit"); memset(&args, 0, sizeof(args)); args.fspec = "/dev/fd0"; diff --git a/usr.sbin/sysinstall/cdrom.c b/usr.sbin/sysinstall/cdrom.c index 438c2e6..b5cc153 100644 --- a/usr.sbin/sysinstall/cdrom.c +++ b/usr.sbin/sysinstall/cdrom.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: cdrom.c,v 1.31 1997/01/01 12:36:05 jkh Exp $ + * $Id: cdrom.c,v 1.32 1997/01/06 11:10:21 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -108,8 +108,6 @@ mediaInitCDROM(Device *dev) cdromMounted = CD_ALREADY_MOUNTED; if (readInfo && (DITEM_STATUS(attr_parse_file(cd_attr, "/cdrom/cdrom.inf")) == DITEM_FAILURE || !(cp = attr_match(cd_attr, "CD_VERSION")) || strcmp(cp, variable_get(VAR_RELNAME)))) { - if (cdromMounted != CD_ALREADY_MOUNTED) - unmount("/cdrom", MNT_FORCE); if (!cp) msgConfirm("Unable to find a /cdrom/cdrom.inf file.\n" "Either this is not a FreeBSD CDROM, there is a problem with\n" diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index cf5abaa..5a95165 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.147 1996/12/29 05:51:35 jkh Exp $ + * $Id: install.c,v 1.148 1997/01/06 11:10:25 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -254,6 +254,9 @@ installFixitCDROM(dialogMenuItem *self) { struct stat sb; + if (!RunningAsInit) + return DITEM_SUCCESS; + variable_set2(SYSTEM_STATE, "fixit"); (void)unlink("/mnt2"); (void)rmdir("/mnt2"); @@ -269,6 +272,8 @@ installFixitCDROM(dialogMenuItem *self) if (msgYesNo("Unable to mount the CDROM - do you want to try again?") != 0) return DITEM_FAILURE; } + else + break; } /* Since the fixit code expects everything to be in /mnt2, and the CDROM mounting stuff /cdrom, do @@ -323,6 +328,9 @@ installFixitFloppy(dialogMenuItem *self) { struct ufs_args args; + if (!RunningAsInit) + return DITEM_SUCCESS; + variable_set2(SYSTEM_STATE, "fixit"); memset(&args, 0, sizeof(args)); args.fspec = "/dev/fd0"; |