You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that If I use the getFullnameById function directly from other files. it could not find the full name properly. cause the code tries to load the key file statically even though it uses chroot environment.
I think that it should be changed as the diff.
Please investigate this problem and merge them if you do not find any problems.
I use the ossec-authd daemon to register new agents for automation.
the problem is that there are too many duplicated agent record in the clients.key file.
so I started to modifying it.
but I think some codes have to be changed to increase the usability. cause you can not call these function directly. for instance, some function needs an environment variable to remove the agent.
so I changed the addagent/manage_agents.c file as below:
creating a new function named remove_agent_by_id, which requires an id to remove the record.
modified the previous function, remove_agent, this is no longer contains remove functionality.
instead, it uses the remove_agent_by_id function.
netman2k
changed the title
Need to change the codes that loads the key file to read or write
Refactoring the addagent files for improving the usability
Mar 4, 2016
Reviewed 3 of 3 files at r1.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.
src/addagent/manage_agents.c, line 344 [r1] (raw file):
Whole do look is not needed. As you break out of it. Should be noted that the original do loop was to allow multiple input. This do look do not do that.
src/addagent/manage_agents.c, line 345 [r1] (raw file):
Removing the Do loop means that this function and user interfaces changes. It will no longer loop and allow many input if i am reading this correctly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found that If I use the getFullnameById function directly from other files. it could not find the full name properly. cause the code tries to load the key file statically even though it uses chroot environment.
I think that it should be changed as the diff.
Please investigate this problem and merge them if you do not find any problems.