#ifndef lint
static const char rcsid[] =
- "$Id: xattr.c,v 1.5 2008/06/09 13:25:40 stelian Exp $";
+ "$Id: xattr.c,v 1.7 2010/06/11 11:19:17 stelian Exp $";
#endif /* not lint */
#include <config.h>
#define EXT2_XATTR_PAD_BITS 2
#define EXT2_XATTR_PAD (1<<EXT2_XATTR_PAD_BITS)
#define EXT2_XATTR_ROUND (EXT2_XATTR_PAD-1)
+#ifndef EXT2_XATTR_LEN
#define EXT2_XATTR_LEN(name_len) \
(((name_len) + EXT2_XATTR_ROUND + \
sizeof(struct ext2_xattr_entry)) & ~EXT2_XATTR_ROUND)
+#endif
#define EXT2_XATTR_NEXT(entry) \
( (struct ext2_xattr_entry *)( \
(char *)(entry) + EXT2_XATTR_LEN((entry)->e_name_len)) )
if (!buffer)
return real_size;
if (real_size > size) {
- fprintf(stderr, "ACL: not enough space to convert (%d %d)\n", real_size, size);
+ fprintf(stderr, "ACL: not enough space to convert (%d %d)\n", real_size, (int)size);
return -1;
}
{
char *path = (char *)private;
int err;
-
+
+ if (Nflag)
+ return GOOD;
+
isSELinux;
#ifdef TRANSSELINUX /*GAN6May06 SELinux MLS */
if (isSELinux)
valuesz = strlen(con) + 1;
valuef[0] = 0;
- strncat(valuef, con, sizeof valuef);
+ strncat(valuef, con, sizeof(valuef) - 1);
freecon(con);
}
else {
if (!transselinuxarg)
err = security_canonicalize_context(value, &con);
else {
- strncat(value, transselinuxarg, sizeof value);
+ strncat(value, transselinuxarg, sizeof(value) - 1);
err = security_canonicalize_context_raw(value, &con);
}
size = strlen(con) + 1;
value[0] = 0;
- strncat(value, con, sizeof value);
+ strncat(value, con, sizeof(value) - 1);
freecon(con);
}
#endif