mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-25 04:31:52 +00:00
PBHOpenDeny can create files? Need to test on real software.
This commit is contained in:
parent
b60d23ea60
commit
91a0da2e0a
@ -443,9 +443,14 @@ namespace OS { namespace Internal {
|
|||||||
if (filename.empty()) return MacOS::bdNamErr;
|
if (filename.empty()) return MacOS::bdNamErr;
|
||||||
|
|
||||||
int access = 0;
|
int access = 0;
|
||||||
ioPermission &= ~0x30; // drop deny read/write
|
if (ioPermission != 0x33) ioPermission &= ~0x30; // drop deny read/write
|
||||||
switch(ioPermission)
|
switch(ioPermission)
|
||||||
{
|
{
|
||||||
|
case 0x33:
|
||||||
|
// PBHOpenDeny exclusive access.
|
||||||
|
access = O_RDWR | O_CREAT; // | O_EXCL;
|
||||||
|
break;
|
||||||
|
|
||||||
case fsWrPerm:
|
case fsWrPerm:
|
||||||
case fsRdWrPerm:
|
case fsRdWrPerm:
|
||||||
case fsRdWrShPerm:
|
case fsRdWrShPerm:
|
||||||
@ -466,7 +471,7 @@ namespace OS { namespace Internal {
|
|||||||
|
|
||||||
Log(" open(%s, %04x)\n", xname.c_str(), access);
|
Log(" open(%s, %04x)\n", xname.c_str(), access);
|
||||||
|
|
||||||
fd = ::open(xname.c_str(), access);
|
fd = ::open(xname.c_str(), access, 0666);
|
||||||
if (fd < 0 && ioPermission == fsCurPerm && errno == EACCES)
|
if (fd < 0 && ioPermission == fsCurPerm && errno == EACCES)
|
||||||
{
|
{
|
||||||
fd = ::open(xname.c_str(), O_RDONLY);
|
fd = ::open(xname.c_str(), O_RDONLY);
|
||||||
|
Loading…
Reference in New Issue
Block a user