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

src/freon.c: Check before extracting mode in open #3273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

src/freon.c: Check before extracting mode in open #3273

wants to merge 1 commit into from

Conversation

jbaum98
Copy link
Contributor

@jbaum98 jbaum98 commented Jun 14, 2017

Fixes #3140

va_list argp;
va_start(argp, flags);
mode_t mode = va_arg(argp, mode_t);
if (flags & (O_CREAT | O_TMPFILE))
Copy link
Owner

Choose a reason for hiding this comment

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

O_TMPFILE apparently isn't defined in precise. I think you need some sort of compatibility define.

@dnschneid dnschneid added the pie label Nov 20, 2017
@dnschneid
Copy link
Owner

Fixing this PR should be pretty straightforward...

@jbaum98
Copy link
Contributor Author

jbaum98 commented Nov 20, 2017

Sorry I didn't see this. So should I define O_TMPFILE to be a number with only ones so that bitwise or-ing it has no effect? Ie ~0?

@dnschneid
Copy link
Owner

No, I suspect you're just missing an include.

@jbaum98
Copy link
Contributor Author

jbaum98 commented Nov 20, 2017

Okay I've added an #include <fcntl.h> based on the man page, but I don't have a linux machine handy right now to test it. The commit is here: 51ffe99 but I can't push it because I've deleted the original branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

src/freon.c mishandles 3rd arg to open functions (mode)
2 participants