-
Notifications
You must be signed in to change notification settings - Fork 247
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
Fixing of nitpicks #65
Conversation
@@ -1104,7 +1104,6 @@ bool sss_krb5_realm_has_proxy(const char *realm) | |||
|
|||
kerr = profile_get_values(profile, profile_path, &list); | |||
if (kerr == PROF_NO_RELATION || kerr == PROF_NO_SECTION) { | |||
kerr = 0; | |||
goto done; |
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.
The value of res
will be false
here.
Should it be true
? It's my assumption based on kerr = 0
@jhrozek is author of this code
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.
False is correct, please see the commit message of cbf20090fa92cc9a6e31e3c903b21d020c519367. I don't remember why I used kerr=0 there, maybe in the past we used to return kerr.
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.
hmm,
sh$ $git show cbf20090fa92cc9a6e31e3c903b21d020c519367
tree cbf20090fa92cc9a6e31e3c903b21d020c519367
.git-commit-template
.gitignore
.tx/
BUILD.txt
COPYING
Makefile.am
README
Vagrantfile
configure.ac
contrib/
m4/
po/
scripts/
src/
version.m4
zanata.xml
if (ret != EOK) { | ||
/* Something bad happened. Just kill the request. */ | ||
goto done; | ||
} | ||
if (reply == NULL) { |
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.
This change is not really required because reply
is initialized to NULL
in the function rdp_process_pending_call
The question is whether we need a if (reply == NULL)
branch after this change.
I like consistency but It would be good to know why @pbrezina wrote is in such way,
BTW return value of rdp_process_pending_call
is checked on line 203 but here the output argument was checked.
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.
I am little confused. It is more about philosophy of code.
I discussed similar issue with some members of sssd team. The question is what is more important if error code or returned values. I show short example:
Let we have function call like:
errno_t ret = my_function(input_argument, &output_data);
Is better to rely on value of ret or on value of output_data?
Our result was if ret != EOK
it we should assume that output_data
could be corrupted.
I understand that this comment is not strictly connected to recent issue. But, I would like to ask: "Do we have genral rule for those situations?"
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.
I don't insist on the patch RESPONDER: Adding of return value checking
.
On Tue, Oct 25, 2016 at 09:28:27AM -0700, lslebodn wrote:
Sorry, I meant this one:
The commit message says that in that case we return false and even in retrospective it makes sense to me because the config doesn't have any related information to proxying. |
How @jhrozek said above false is right returning value. Proposed patch is about removing of |
On (08/11/16 05:26), celestian wrote:
As I previously wrote, we should be consistent. Ask @pbrezina why he wrote the code in such way. LS |
@pbrezina please, could you join discussion? How we can see we call function
|
OK, I prefer checking of return value. So I pushed new version. I kept |
On (14/11/16 04:43), celestian wrote:
LS |
Hello,
there are two simple patches. I found those things during static analysis of SSSD code.
Petr