diff --git a/src/kits/storage/LibBeAdapter.cpp b/src/kits/storage/LibBeAdapter.cpp index bc26079494..7f0515acf4 100644 --- a/src/kits/storage/LibBeAdapter.cpp +++ b/src/kits/storage/LibBeAdapter.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -16,6 +17,8 @@ #include +mode_t __gUmask = S_IUMSK; + enum { FD_TYPE_UNKNOWN, FD_TYPE_DIR, @@ -176,8 +179,9 @@ get_path(int fd, const char *relPath, BPath &path) } // _kern_open +extern "C" int -_kern_open(int fd, const char *path, int omode) +_kern_open(int fd, const char *path, int omode, int permissions) { status_t error; BPath fullPath; @@ -191,7 +195,7 @@ _kern_open(int fd, const char *path, int omode) path = fullPath.Path(); } // open the file - int result = open(path, omode); + int result = open(path, omode, permissions); if (result < 0) return errno; return result; @@ -201,7 +205,8 @@ _kern_open(int fd, const char *path, int omode) // _kern_open_entry_ref extern "C" int -_kern_open_entry_ref(dev_t device, ino_t inode, const char *name, int omode) +_kern_open_entry_ref(dev_t device, ino_t inode, const char *name, int omode, + int permissions) { BPath fullPath; node_ref ref; @@ -216,7 +221,7 @@ _kern_open_entry_ref(dev_t device, ino_t inode, const char *name, int omode) if (error != B_OK) return error; // open the file - int fd = open(fullPath.Path(), omode); + int fd = open(fullPath.Path(), omode, permissions); if (fd < 0) return errno; return fd;