Blame SOURCES/autofs-5.0.8-simple-coverity-fixes.patch

304803
autofs-5.0.8 - simple coverity fixes
304803
304803
From: Ian Kent <ikent@redhat.com>
304803
304803
Add a couple of simple corrections reported by Coverity.
304803
---
304803
 CHANGELOG                |    1 +
304803
 daemon/automount.c       |    6 ------
304803
 daemon/lookup.c          |    3 ++-
304803
 modules/lookup_hosts.c   |    3 ++-
304803
 modules/lookup_program.c |    3 ++-
304803
 modules/mount_bind.c     |    4 ++--
304803
 6 files changed, 9 insertions(+), 11 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -99,6 +99,7 @@
304803
 - fix lookup_nss_mount() map lookup.
304803
 - dont ignore null cache entries on multi mount umount.
304803
 - fix inconsistent error returns in handle_packet_missing_direct().
304803
+- simple coverity fixes.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/daemon/automount.c
304803
+++ autofs-5.0.7/daemon/automount.c
304803
@@ -1776,12 +1776,6 @@ static void show_build_info(void)
304803
 #ifdef ENABLE_FORCED_SHUTDOWN
304803
 	printf("ENABLE_FORCED_SHUTDOWN ");
304803
 	count = count + 23;
304803
-
304803
-	if (count > 60) {
304803
-		printf("\n  ");
304803
-		count = 0;
304803
-	}
304803
-
304803
 #endif
304803
 
304803
 #ifdef ENABLE_IGNORE_BUSY_MOUNTS
304803
--- autofs-5.0.7.orig/daemon/lookup.c
304803
+++ autofs-5.0.7/daemon/lookup.c
304803
@@ -959,7 +959,8 @@ static void update_negative_cache(struct
304803
 				rv = cache_update(map->mc, map, name, NULL, now);
304803
 			if (rv != CHE_FAIL) {
304803
 				me = cache_lookup_distinct(map->mc, name);
304803
-				me->status = now + ap->negative_timeout;
304803
+				if (me)
304803
+					me->status = now + ap->negative_timeout;
304803
 			}
304803
 			cache_unlock(map->mc);
304803
 		}
304803
--- autofs-5.0.7.orig/modules/lookup_hosts.c
304803
+++ autofs-5.0.7/modules/lookup_hosts.c
304803
@@ -161,7 +161,8 @@ static int do_parse_mount(struct autofs_
304803
 			rv = cache_update(mc, source, name, NULL, now);
304803
 		if (rv != CHE_FAIL) {
304803
 			me = cache_lookup_distinct(mc, name);
304803
-			me->status = now + ap->negative_timeout;
304803
+			if (me)
304803
+				me->status = now + ap->negative_timeout;
304803
 		}
304803
 		cache_unlock(mc);
304803
 		return NSS_STATUS_TRYAGAIN;
304803
--- autofs-5.0.7.orig/modules/lookup_program.c
304803
+++ autofs-5.0.7/modules/lookup_program.c
304803
@@ -459,7 +459,8 @@ out_free:
304803
 			rv = cache_update(mc, source, name, NULL, now);
304803
 		if (rv != CHE_FAIL) {
304803
 			me = cache_lookup_distinct(mc, name);
304803
-			me->status = now + ap->negative_timeout;
304803
+			if (me)
304803
+				me->status = now + ap->negative_timeout;
304803
 		}
304803
 		cache_unlock(mc);
304803
 		return NSS_STATUS_TRYAGAIN;
304803
--- autofs-5.0.7.orig/modules/mount_bind.c
304803
+++ autofs-5.0.7/modules/mount_bind.c
304803
@@ -214,14 +214,14 @@ int mount_mount(struct autofs_point *ap,
304803
 			      MODPREFIX
304803
 			      "failed to create symlink %s -> %s",
304803
 			      fullpath, what);
304803
-			if ((ap->flags & MOUNT_FLAG_GHOST) && !status)
304803
+			if ((ap->flags & MOUNT_FLAG_GHOST) && !status) {
304803
 				if (mkdir_path(fullpath, 0555) && errno != EEXIST) {
304803
 					char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
304803
 					error(ap->logopt,
304803
 					      MODPREFIX "mkdir_path %s failed: %s",
304803
 					      fullpath, estr);
304803
 				}
304803
-			else {
304803
+			} else {
304803
 				if (ap->type == LKP_INDIRECT)
304803
 					rmdir_path(ap, fullpath, ap->dev);
304803
 			}