]> xenbits.xensource.com Git - xen.git/commitdiff
xenstore: fix canonicalize for metanodes
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 9 Apr 2008 14:59:54 +0000 (15:59 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 9 Apr 2008 14:59:54 +0000 (15:59 +0100)
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_watch.c

index a643f2d9690c84a41605d84827ff174b1a5411dc..657322ab8c51cd25ca7e0eed32209dc823a68dd8 100644 (file)
@@ -722,7 +722,7 @@ char *canonicalize(struct connection *conn, const char *node)
 {
        const char *prefix;
 
-       if (!node || strstarts(node, "/"))
+       if (!node || (node[0] == '/') || (node[0] == '@'))
                return (char *)node;
        prefix = get_implicit_path(conn);
        if (prefix)
index 8e3e4f2b61c1f21ecc90fea3c004fa7b18794a82..16d30899d47f90cf457bcd89701890afa2f14843 100644 (file)
@@ -183,7 +183,7 @@ void do_unwatch(struct connection *conn, struct buffered_data *in)
                return;
        }
 
-       node = strstarts(vec[0], "@") ? vec[0] : canonicalize(conn, vec[0]);
+       node = canonicalize(conn, vec[0]);
        list_for_each_entry(watch, &conn->watches, list) {
                if (streq(watch->node, node) && streq(watch->token, vec[1])) {
                        list_del(&watch->list);