From 885af7fe92a3e480bc4850492ec6fc44c61c8f7c Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 21 Mar 2019 14:33:07 +0100 Subject: [PATCH] Fix assign instead of compare Commit 53e0b2255d92c9c21c19306cf37cc8de0476dc9c introduced a minor bug. Instead of comparing errno to ENOENT, the check assigned ENOENT to errno. Coverity: CID 337082 See: https://pagure.io/freeipa/issue/4607 Signed-off-by: Christian Heimes Reviewed-By: Alexander Bokovoy --- client/ipa-getkeytab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ipa-getkeytab.c b/client/ipa-getkeytab.c index b26a26c54..ae3b08e66 100644 --- a/client/ipa-getkeytab.c +++ b/client/ipa-getkeytab.c @@ -687,7 +687,7 @@ static int resolve_ktname(const char *keytab, char **ktname, char **err_msg) * root. For simplicity, only one level if indirection is resolved. */ if ((stat(keytab, &st) == -1) && - (errno = ENOENT) && + (errno == ENOENT) && (lstat(keytab, &lst) == 0) && (S_ISLNK(lst.st_mode))) { /* keytab is a dangling symlink. */