aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-05-25 14:14:07 +0100
committerDaniel P. Berrange <berrange@redhat.com>2012-05-28 10:43:01 +0100
commitebbcc0263969cc4472f4aafea8901154c790a196 (patch)
treea814447ea77f4a4db9fa53f974ee0a317749f68e /src/security
parentmaint: avoid new automake warning about AM_PROG_CC_STDC (diff)
downloadlibvirt-ebbcc0263969cc4472f4aafea8901154c790a196.tar.gz
libvirt-ebbcc0263969cc4472f4aafea8901154c790a196.tar.bz2
libvirt-ebbcc0263969cc4472f4aafea8901154c790a196.zip
Remove last usage of PATH_MAX and ban its future use
Remove a number of pointless checks against PATH_MAX and add a syntax-check rule to prevent its use in future Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'src/security')
-rw-r--r--src/security/virt-aa-helper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index a5cb85c83..7b41d3849 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -473,7 +473,7 @@ valid_name(const char *name)
* used to subvert the profile */
const char *bad = " /[]*";
- if (strlen(name) == 0 || strlen(name) > PATH_MAX - 1)
+ if (strlen(name) == 0)
return -1;
if (strcspn(name, bad) != strlen(name))
@@ -544,7 +544,7 @@ valid_path(const char *path, const bool readonly)
"/sys/devices/pci" /* for hostdev pci devices */
};
- if (path == NULL || strlen(path) > PATH_MAX - 1) {
+ if (path == NULL) {
vah_error(NULL, 0, _("bad pathname"));
return -1;
}