aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_core.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2007-12-14 10:15:00 +0000
committerKeir Fraser <keir.fraser@citrix.com>2007-12-14 10:15:00 +0000
commit625a82b59cc973fc6adcca234e05e53fff4a96b5 (patch)
treeb67fc0be96f43cbe1491c00dd3dd1dbe961e21fb /tools/xenstore/xenstored_core.c
parent298950dbe88deb0697fdd4f273f1583dc51d20cc (diff)
downloadxen-625a82b59cc973fc6adcca234e05e53fff4a96b5.tar.gz
xen-625a82b59cc973fc6adcca234e05e53fff4a96b5.tar.bz2
xen-625a82b59cc973fc6adcca234e05e53fff4a96b5.zip
xenstore size limits
* Documents the existing 4kby size limit on xenstore message payloads * Causes xs.c in libxenstore to fail locally rather than violating said limit (which is good because xenstored kills the client connection if it's exceeded). * Introduces some limits on path lengths in xenstored. I trust no-one is using path lengths >2kby. This is good because currently a domain client can create a 4kby relative path that the dom0 tools cannot access since they'd have to specify the somewhat longer absolute path. * Removes uses of the host's PATH_MAX (!) Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/xenstore/xenstored_core.c')
-rw-r--r--tools/xenstore/xenstored_core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 825d834e37..acf6dd3918 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -672,6 +672,9 @@ bool is_valid_nodename(const char *node)
if (strstr(node, "//"))
return false;
+ if (strlen(node) > XENSTORE_ABS_PATH_MAX)
+ return false;
+
return valid_chars(node);
}
@@ -1281,7 +1284,7 @@ static void handle_input(struct connection *conn)
if (in->used != sizeof(in->hdr))
return;
- if (in->hdr.msg.len > PATH_MAX) {
+ if (in->hdr.msg.len > XENSTORE_PAYLOAD_MAX) {
syslog(LOG_ERR, "Client tried to feed us %i",
in->hdr.msg.len);
goto bad_client;