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

[XrdCl] Fix error checking when setting sec.uid, sec.gid #605

Merged
merged 2 commits into from
Oct 23, 2017

Conversation

gbitzes
Copy link
Contributor

@gbitzes gbitzes commented Oct 20, 2017

Previously, I was calling setfsuid(-1) to check if the
previous call had succeeded, since this syscall will
always return the current fsuid, whether the syscall
itself succeeded or not. There's no way to check
other than calling setfsuid again, since there's no
getfsuid.

The expectation was that setfsuid(-1) will always fail
and not affect the fsuid, effectively acting as getfsuid,
but it appears that on SLC6 it succeeds, setting the
fsuid to.. 4294967295. On Fedora 26 it fails as expected,
I have no idea why there's a difference.

Instead, let's use setfsuid(pFsUid) again, just to
check if the previous call succeeded.

Previously, I was calling setfsuid(-1) to check if the
previous call had succeeded, since this syscall will
always return the current fsuid, whether the syscall
itself succeeded or not. There's no way to check
other than calling setfsuid again, since there's no
getfsuid.

The expectation was that setfsuid(-1) will always fail
and not affect the fsuid, effectively acting as getfsuid,
but it appears that on SLC6 it succeeds, setting the
fsuid to.. 4294967295. On Fedora 26 it fails as expected,
I have no idea why there's a difference.

Instead, let's use setfsuid(pFsUid) again, just to
check if the previous call succeeded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants