-
Notifications
You must be signed in to change notification settings - Fork 301
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
Conversation
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>
https://track.hpccsystems.com/browse/HPCC-16105 |
@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()); |
There was a problem hiding this comment.
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?
@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. |
@rpastrana Please rereview |
@RussWhitehead looks fine. |
@richardkchapman Please merge and close |
Automated Smoketest HPCC Stop: OK |
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