Block all CDROMs in /dev/

This commit is contained in:
atmaxinger 2018-02-21 16:24:20 +01:00
parent 787661f80f
commit 85bcff03d4

View File

@ -51,8 +51,6 @@ void prefs_exit()
}
#endif
#define DEFAULT_CDROM_PATH "/dev/poll/cdrom"
@implementation VMSettingsController
+ (id) sharedInstance
@ -123,7 +121,7 @@ static NSString *getStringFromPrefs(const char *key)
index = 0;
while ((dsk = PrefsFindString("cdrom", index++)) != NULL) {
NSString *path = [NSString stringWithUTF8String: dsk ];
if (![path isEqualToString:@DEFAULT_CDROM_PATH]) {
if (![path hasPrefix:@"/dev/"]) {
DiskType *disk = [[[DiskType alloc] init] autorelease];
[disk setPath:[NSString stringWithUTF8String: dsk ]];
[disk setIsCDROM:YES];
@ -419,8 +417,6 @@ static NSString *makeRelativeIfNecessary(NSString *path)
PrefsAddString([d isCDROM] ? "cdrom" : "disk", [[d path] UTF8String]);
}
PrefsAddString("cdrom", DEFAULT_CDROM_PATH);
PrefsReplaceInt32("bootdriver", ([bootFrom indexOfSelectedItem] == 1 ? CDROMRefNum : 0));
PrefsReplaceString("rom", [[romFile stringValue] UTF8String]);
PrefsReplaceString("extfs", [[unixRoot stringValue] UTF8String]);