mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
committed by
gVisor bot
parent
bb1ae811f4
commit
ffc3a0d840
@@ -117,7 +117,7 @@ func NewDentry(ctx context.Context, mnt *vfs.Mount) *vfs.Dentry {
|
||||
fs := mnt.Filesystem().Impl().(*filesystem)
|
||||
|
||||
// File mode matches net/socket.c:sock_alloc.
|
||||
filemode := linux.FileMode(linux.S_IFSOCK | 0600)
|
||||
filemode := linux.FileMode(linux.S_IFSOCK | 0777)
|
||||
i := &inode{}
|
||||
i.InodeAttrs.Init(ctx, auth.CredentialsFromContext(ctx), linux.UNNAMED_MAJOR, fs.devMinor, fs.Filesystem.NextIno(), filemode)
|
||||
|
||||
|
||||
@@ -183,6 +183,16 @@ TEST(SocketTest, UnixSCMRightsOnlyPassedOnce) {
|
||||
ASSERT_TRUE(WIFEXITED(status) && WEXITSTATUS(status) == 0);
|
||||
}
|
||||
|
||||
TEST(SocketTest, Permission) {
|
||||
SKIP_IF(IsRunningWithVFS1());
|
||||
|
||||
FileDescriptor socket =
|
||||
ASSERT_NO_ERRNO_AND_VALUE(Socket(AF_UNIX, SOCK_DGRAM, 0));
|
||||
|
||||
auto stat = ASSERT_NO_ERRNO_AND_VALUE(Fstat(socket.get()));
|
||||
EXPECT_EQ(0777, stat.st_mode & ~S_IFMT);
|
||||
}
|
||||
|
||||
using SocketOpenTest = ::testing::TestWithParam<int>;
|
||||
|
||||
// UDS cannot be opened.
|
||||
|
||||
Reference in New Issue
Block a user