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

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