zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: 3.1.6-pws-2: cap_free
@ 1999-09-01  8:00 Peter Stephenson
  1999-09-01 10:50 ` Zefram
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 1999-09-01  8:00 UTC (permalink / raw)
  To: Zsh hackers list

I've finally compiled on a system with POSIX capability sets.  This one
definitely needs cap_free to get the value returned from cap_get_proc, not
a pointer to it.  If there are implementations which do this the other way,
we have problems.

You can test this if you also have --enable-zsh-mem --enable-zsh-mem-debug,
because you get a bad free warning from e.g. `print -P "%#"'.

--- Src/utils.c.cap	Mon Aug  2 09:24:34 1999
+++ Src/utils.c	Tue Aug 31 13:29:26 1999
@@ -3633,10 +3633,10 @@
 	    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);
+		    cap_free(caps);
 		    return 1;
 		}
-	    cap_free(&caps);
+	    cap_free(caps);
 	}
     }
 #endif /* HAVE_CAP_GET_PROC */

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: 3.1.6-pws-2: cap_free
  1999-09-01  8:00 PATCH: 3.1.6-pws-2: cap_free Peter Stephenson
@ 1999-09-01 10:50 ` Zefram
  0 siblings, 0 replies; 2+ messages in thread
From: Zefram @ 1999-09-01 10:50 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

Peter Stephenson wrote:
>I've finally compiled on a system with POSIX capability sets.  This one
>definitely needs cap_free to get the value returned from cap_get_proc, not
>a pointer to it.  If there are implementations which do this the other way,
>we have problems.

When I wrote that code, I was working from an alpha version of the Linux
libcap (which I was co-writing), which was based on a not-entirely-clear
summary of a draft of POSIX.6.  I wouldn't be surprised if that's how
it's supposed to be.

-zefram


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-09-01 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-01  8:00 PATCH: 3.1.6-pws-2: cap_free Peter Stephenson
1999-09-01 10:50 ` Zefram

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).