about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Modules/cap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Src/Modules/cap.c b/Src/Modules/cap.c
index 4242d447f..aaf5e2433 100644
--- a/Src/Modules/cap.c
+++ b/Src/Modules/cap.c
@@ -72,7 +72,10 @@ bin_getcap(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func))
     do {
 	char *result = NULL;
 	ssize_t length;
-	cap_t caps = cap_get_file(*argv);
+	cap_t caps;
+	char *filename;
+
+	caps = cap_get_file(unmetafy(dupstring(*argv), NULL));
 	if(caps)
 	    result = cap_to_text(caps, &length);
 	if (!caps || !result) {
@@ -99,8 +102,7 @@ bin_setcap(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func))
     }
 
     do {
-	unmetafy(*argv, NULL);
-	if(cap_set_file(*argv, caps)) {
+	if(cap_set_file(unmetafy(dupstring(*argv, NULL)), caps)) {
 	    zwarnnam(nam, "%s: %e", *argv, errno);
 	    ret = 1;
 	}