Skip to content

Commit

Permalink
[Pal/{Linux,Linux-SGX}] Provide permissions for dev:tty
Browse files Browse the repository at this point in the history
This is so that `dev:tty` doesn't require special treatment in LibOS.

Signed-off-by: Paweł Marczewski <[email protected]>
  • Loading branch information
pwmarcz committed Dec 27, 2021
1 parent b807fa8 commit a0de06b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Pal/src/host/Linux-SGX/db_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "pal_internal.h"
#include "pal_linux.h"
#include "pal_linux_error.h"
#include "perm.h"

static int dev_open(PAL_HANDLE* handle, const char* type, const char* uri, enum pal_access access,
pal_share_flags_t share, enum pal_create_mode create,
Expand Down Expand Up @@ -146,7 +147,7 @@ static int dev_attrquery(const char* type, const char* uri, PAL_STREAM_ATTR* att
attr->readable = true; /* we don't know if it's stdin/stdout so simply return true */
attr->writable = true; /* we don't know if it's stdin/stdout so simply return true */
attr->runnable = false;
attr->share_flags = 0;
attr->share_flags = PERM_rw_rw_rw_;
attr->pending_size = 0;
} else {
/* other devices must query the host */
Expand Down
3 changes: 2 additions & 1 deletion Pal/src/host/Linux/db_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "pal_flags_conv.h"
#include "pal_internal.h"
#include "pal_linux.h"
#include "perm.h"

static int dev_open(PAL_HANDLE* handle, const char* type, const char* uri, enum pal_access access,
pal_share_flags_t share, enum pal_create_mode create,
Expand Down Expand Up @@ -144,7 +145,7 @@ static int dev_attrquery(const char* type, const char* uri, PAL_STREAM_ATTR* att
attr->readable = true; /* we don't know if it's stdin/stdout so simply return true */
attr->writable = true; /* we don't know if it's stdin/stdout so simply return true */
attr->runnable = false;
attr->share_flags = 0;
attr->share_flags = PERM_rw_rw_rw_;
attr->pending_size = 0;
} else {
/* other devices must query the host */
Expand Down

0 comments on commit a0de06b

Please sign in to comment.