ia64/xen-unstable

changeset 17420:506c21c5c555

xenstore: fix canonicalize for metanodes

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Apr 09 15:59:54 2008 +0100 (2008-04-09)
parents 3cac47973e15
children 70ebf23f8a43
files tools/xenstore/xenstored_core.c tools/xenstore/xenstored_watch.c
line diff
     1.1 --- a/tools/xenstore/xenstored_core.c	Wed Apr 09 15:57:31 2008 +0100
     1.2 +++ b/tools/xenstore/xenstored_core.c	Wed Apr 09 15:59:54 2008 +0100
     1.3 @@ -722,7 +722,7 @@ char *canonicalize(struct connection *co
     1.4  {
     1.5  	const char *prefix;
     1.6  
     1.7 -	if (!node || strstarts(node, "/"))
     1.8 +	if (!node || (node[0] == '/') || (node[0] == '@'))
     1.9  		return (char *)node;
    1.10  	prefix = get_implicit_path(conn);
    1.11  	if (prefix)
     2.1 --- a/tools/xenstore/xenstored_watch.c	Wed Apr 09 15:57:31 2008 +0100
     2.2 +++ b/tools/xenstore/xenstored_watch.c	Wed Apr 09 15:59:54 2008 +0100
     2.3 @@ -183,7 +183,7 @@ void do_unwatch(struct connection *conn,
     2.4  		return;
     2.5  	}
     2.6  
     2.7 -	node = strstarts(vec[0], "@") ? vec[0] : canonicalize(conn, vec[0]);
     2.8 +	node = canonicalize(conn, vec[0]);
     2.9  	list_for_each_entry(watch, &conn->watches, list) {
    2.10  		if (streq(watch->node, node) && streq(watch->token, vec[1])) {
    2.11  			list_del(&watch->list);