about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-05-29 15:09:06 +0000
committerClint Adams <clint@users.sourceforge.net>2001-05-29 15:09:06 +0000
commit23e2a3e5f894c06203de2c2377dad81c9a37d01d (patch)
tree421b5814c50d6e6ce30650755a8630393fb5b239
parent84c856aa008c3466646854d23726225781b042dd (diff)
downloadzsh-23e2a3e5f894c06203de2c2377dad81c9a37d01d.tar.gz
zsh-23e2a3e5f894c06203de2c2377dad81c9a37d01d.tar.xz
zsh-23e2a3e5f894c06203de2c2377dad81c9a37d01d.zip
14541: %# with capabilities prompt-expand to # iff Effective set non-empty or euid=0
-rw-r--r--ChangeLog3
-rw-r--r--Src/utils.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 61c52997a..1cdf4ccc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-05-29  Clint Adams  <clint@zsh.org>
 
+	* 14541: %# with capabilities should prompt-expand to #
+	iff (euid=0 or the Effective set is non-empty).
+
 	* 14538: cleaner _perl_config_vars from Matt Zimmerman.
 
 	* 14536: Completion/Debian/Command/_update-alternatives:
diff --git a/Src/utils.c b/Src/utils.c
index 3c169f066..6bede2e43 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -3667,11 +3667,7 @@ privasserted(void)
 	    cap_flag_value_t val;
 	    cap_value_t n;
 	    for(n = 0; !cap_get_flag(caps, n, CAP_EFFECTIVE, &val); n++)
-		if(val ||
-		   (!cap_get_flag(caps, n, CAP_INHERITABLE, &val) && val)) {
-		    cap_free(caps);
-		    return 1;
-		}
+		if(val) return 1;
 	    cap_free(caps);
 	}
     }