From fa87f197c214620b00bc07c38034b38efa638210 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Tue, 24 Nov 2015 20:57:40 +0000 Subject: Abort if we're on a write-protected volume Partial fix for 2397 --- amiga/gui.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'amiga') diff --git a/amiga/gui.c b/amiga/gui.c index a3cd57bcc..6859143c8 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -5483,6 +5483,30 @@ int main(int argc, char** argv) } } +#ifdef __amigaos4__ + if(LIB_IS_AT_LEAST((struct Library *)DOSBase, 51, 96)) { + struct InfoData *infodata = AllocDosObject(DOS_INFODATA, 0); + if(infodata == NULL) { + ami_misc_fatal_error("Failed to allocate memory"); + return RETURN_FAIL; + } + GetDiskInfoTags(GDI_StringNameInput, users_dir, + GDI_InfoData, infodata, + TAG_DONE); + if(infodata->id_DiskState == ID_DISKSTATE_WRITE_PROTECTED) { + FreeDosObject(DOS_INFODATA, infodata); + ami_misc_fatal_error("Cannot run with user dir on a write-protected volume"); + return RETURN_FAIL; + } + FreeDosObject(DOS_INFODATA, infodata); + } else { +#else +//FIXME for OS3 and older OS4 +#endif +#ifdef __amigaos4__ + } +#endif + int len = strlen(current_user); len += strlen(users_dir); len += 2; /* for poss path sep and NULL term */ -- cgit v1.2.3