diff options
author | cl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk> | 2005-09-05 19:43:04 +0000 |
---|---|---|
committer | cl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk> | 2005-09-05 19:43:04 +0000 |
commit | 84ff1f21556688762372eac5891959859880ff58 (patch) | |
tree | 84db6bd5d863ef99ecf239d317bb36c662cec1b8 /tools/xenstore/xenstored_watch.c | |
parent | fb3841431b42fbd3d5c16f84ea64b2810d62f489 (diff) | |
download | xen-84ff1f21556688762372eac5891959859880ff58.tar.gz xen-84ff1f21556688762372eac5891959859880ff58.tar.bz2 xen-84ff1f21556688762372eac5891959859880ff58.zip |
Add @introduceDomain event-watch and replace consoled watch on /console.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Diffstat (limited to 'tools/xenstore/xenstored_watch.c')
-rw-r--r-- | tools/xenstore/xenstored_watch.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c index a2727e46e4..804a386868 100644 --- a/tools/xenstore/xenstored_watch.c +++ b/tools/xenstore/xenstored_watch.c @@ -103,7 +103,8 @@ static void add_event(struct connection *conn, /* Check read permission: no permission, no watch event. * If it doesn't exist, we need permission to read parent. */ - if (!check_node_perms(conn, node, XS_PERM_READ|XS_PERM_ENOENT_OK)) { + if (!check_node_perms(conn, node, XS_PERM_READ|XS_PERM_ENOENT_OK) && + !check_event_node(node)) { fprintf(stderr, "No permission for %s\n", node); return; } @@ -213,11 +214,16 @@ void do_watch(struct connection *conn, struct buffered_data *in) return; } - relative = !strstarts(vec[0], "/"); - vec[0] = canonicalize(conn, vec[0]); - if (!is_valid_nodename(vec[0])) { - send_error(conn, errno); - return; + if (strstarts(vec[0], "@")) { + relative = false; + /* check if valid event */ + } else { + relative = !strstarts(vec[0], "/"); + vec[0] = canonicalize(conn, vec[0]); + if (!is_valid_nodename(vec[0])) { + send_error(conn, errno); + return; + } } watch = talloc(conn, struct watch); |