aboutsummaryrefslogtreecommitdiff
path: root/libcap/libcap.h
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2008-01-24 11:14:20 -0800
committerJorge Lucangeli Obes <jorgelo@google.com>2015-09-03 14:13:03 -0700
commitc2a25909b2c4d989e49cdedcac4dd52c45f0570b (patch)
treea28ef5734c4b09953567398ff90ce4bfce8015d1 /libcap/libcap.h
parent973e826b0e6a4c9802a10140142f9532a592e8fa (diff)
downloadlibcap-c2a25909b2c4d989e49cdedcac4dd52c45f0570b.tar.gz
Fix malloc(size) but in capsh and numeric capabilities (for unnamed bits)
capsh allocated too little memory for the --inh argument - led to glibc aborting with free(). libcap has always had latent support for identifying unnamed capabilities with integers. It was untested (and therefore broken) prior to this commit. Should be fixed now. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'libcap/libcap.h')
-rw-r--r--libcap/libcap.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libcap/libcap.h b/libcap/libcap.h
index 854f907..bd22397 100644
--- a/libcap/libcap.h
+++ b/libcap/libcap.h
@@ -98,6 +98,9 @@ struct _cap_struct {
} u[_LINUX_CAPABILITY_U32S];
};
+/* the maximum bits supportable */
+#define __CAP_MAXBITS (__CAP_BLKS * 32)
+
/* string magic for cap_free */
#define CAP_S_MAGIC 0xCA95D0