Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posix_sockets: set read/write permissions for socket fd #11576

Merged
merged 1 commit into from
Aug 2, 2019

Conversation

miri64
Copy link
Member

@miri64 miri64 commented May 24, 2019

Contribution description

In #11212 it was discovered, that the permissions for the file descriptors of POSIX sockets are not set so write and read can be used. This fixes that.

Testing procedure

Flash and run the application provided in #11212 on 2 samr21-xpros. Without this PR echo send returns "Bad file descriptor" as its write() call ends up here

RIOT/sys/vfs/vfs.c

Lines 325 to 328 in f6ee0ac

if (((filp->flags & O_ACCMODE) != O_WRONLY) & ((filp->flags & O_ACCMODE) != O_RDWR)) {
/* File not open for writing */
return -EBADF;
}

Issues/PRs references

Fixes #11212.

@miri64 miri64 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: POSIX Area: POSIX API wrapper Area: network Area: Networking Area: fs Area: File systems labels May 24, 2019
@miri64 miri64 requested a review from kaspar030 May 24, 2019 14:13
@miri64 miri64 added this to the Release 2019.07 milestone Jun 19, 2019
@miri64
Copy link
Member Author

miri64 commented Jun 19, 2019

This bug fix should go into the release.

Copy link
Contributor

@haukepetersen haukepetersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@haukepetersen haukepetersen added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 1, 2019
@haukepetersen
Copy link
Contributor

all green -> go

@haukepetersen haukepetersen merged commit 2ff5720 into RIOT-OS:master Aug 2, 2019
@miri64 miri64 deleted the posix_socket/fix/fd-perms branch August 2, 2019 08:34
@miri64
Copy link
Member Author

miri64 commented Aug 2, 2019

Thanks for the review :-)

@miri64
Copy link
Member Author

miri64 commented Aug 2, 2019

@MrKevinWeiss as you are preparing for a 2019.07.1 release, shall I backport this one?

@MrKevinWeiss
Copy link
Contributor

Sure we can add it to the list!

@MrKevinWeiss MrKevinWeiss added Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch Process: release cycle Integration Process: The PR is connected to the release cycle (e.g. release notes) labels Aug 2, 2019
@kb2ma kb2ma added this to the Release 2019.10 milestone Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: fs Area: File systems Area: network Area: Networking Area: POSIX Area: POSIX API wrapper CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch Process: release cycle Integration Process: The PR is connected to the release cycle (e.g. release notes) Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

POSIX sockets + lwIP: bad file descriptor
4 participants