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

Added check for resolv.conf symlink #2349

Merged
merged 3 commits into from
Jan 7, 2019

Conversation

pierantoniomerlino
Copy link
Contributor

Signed-off-by: pierantoniomerlino [email protected]

Brief description of the PR.
If the resolv.conf file is a symlink, Kura fails to write the DNS servers on it. This PR adds a check before writing on that file.

Signed-off-by: pierantoniomerlino <[email protected]>
@@ -367,6 +370,17 @@ private synchronized String getRealPath(File file) throws KuraException {

private synchronized void writeDnsFile(Set<IPAddress> servers) {
logger.debug("Writing DNS servers to file");
// Check if DNS_FILE_NAME is a symlink and it is broken or points to unmanaged location.
// In this case, delete it.
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe move this block to a specific method with a meaningful name, in order to be able to remove the comment.

nicolatimeus and others added 2 commits January 7, 2019 14:45
Signed-off-by: nicolatimeus <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
@MMaiero MMaiero merged commit fbbff6d into eclipse-kura:develop Jan 7, 2019
@MMaiero MMaiero deleted the fix_dns branch January 7, 2019 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants