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

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