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

HPCC-16105 Fileservices checkExternalFileRights() incorrect check #9102

Merged
merged 2 commits into from
Sep 14, 2016

Conversation

RussWhitehead
Copy link
Member

In fileservices.cpp, method checkExternalFileRights accepts 2 flags indicating
it should test for read, and one for write. The "if" statement presumes that
only one of these can be true. Additionally, the "extpath" variable is never
set, so the code never checks the specified file. This PR sets the path
variable correctly, and checks for both read and write perms independently.

Signed-off-by: Russ Whitehead william.whitehead@lexisnexis.com

In fileservices.cpp, method checkExternalFileRights accepts 2 flags indicating
it should test for read, and one for write. The "if" statement presumes that
only one of these can be true. Additionally, the "extpath" variable is never
set, so the code never checks the specified file. This PR sets the path
variable correctly, and checks for both read and write perms independently.

Signed-off-by: Russ Whitehead <william.whitehead@lexisnexis.com>
@hpcc-jirabot
Copy link

@RussWhitehead
Copy link
Member Author

@rpastrana Please review

@@ -2147,7 +2147,7 @@ FILESERVICES_API char * FILESERVICES_CALL fsfResolveHostName(const char *hostna

static void checkExternalFileRights(ICodeContext *ctx, CDfsLogicalFileName &lfn, bool rd,bool wr)
{
StringAttr extpath;
StringAttr extpath(lfn.get());
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to introduce this var?
Could we use lfn.get() directlty in lines 2157, 2160, and 2165?

@rpastrana
Copy link
Member

@RussWhitehead one minor comment in line. Also, it looks like this changes behavior, you might want to make sure ops knows this change is coming.

@RussWhitehead
Copy link
Member Author

@rpastrana Please rereview

@rpastrana
Copy link
Member

@RussWhitehead looks fine.

@RussWhitehead
Copy link
Member Author

@richardkchapman Please merge and close

@HPCCSmoketest
Copy link
Contributor

Automated Smoketest
Sha: 066c55c
Build: success
Install hpccsystems-platform-community_6.1.0-trunk0.el6.x86_64.rpm
HPCC Start: OK
Unittest result: total:83 passed:83 failed:0

HPCC Stop: OK
HPCC Uninstall: OK

@richardkchapman richardkchapman merged commit efd0381 into hpcc-systems:master Sep 14, 2016
@RussWhitehead RussWhitehead deleted the checkLFN branch September 26, 2016 13:02
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.

5 participants