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

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