diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-11-24 20:57:40 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-11-24 20:57:40 +0000 |
commit | fa87f197c214620b00bc07c38034b38efa638210 (patch) | |
tree | d56484e2b541f2f3369e97d2d6376086fc4f1d5e | |
parent | 7733ece4724d164f31e3be337ed09022f97d1d0e (diff) | |
download | netsurf-fa87f197c214620b00bc07c38034b38efa638210.tar.gz netsurf-fa87f197c214620b00bc07c38034b38efa638210.tar.bz2 |
Abort if we're on a write-protected volume
Partial fix for 2397
-rw-r--r-- | amiga/gui.c | 24 |
1 files changed, 24 insertions, 0 deletions
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 */ |