[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] dom0 and anonymous connections can create unlimited sized entries in the store.
# HG changeset patch # User vhanquez@xxxxxxxxxxxxxxxxxxxxxxx # Node ID 891e0d1cf4abfac1b3ce1210f22032dad205d46d # Parent 08f5adb5058b6122e802aa243c4dd253c701c00c dom0 and anonymous connections can create unlimited sized entries in the store. Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx> --- tools/xenstore/xenstored_core.c | 2 +- tools/xenstore/xenstored_domain.c | 9 +++++++-- tools/xenstore/xenstored_domain.h | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff -r 08f5adb5058b -r 891e0d1cf4ab tools/xenstore/xenstored_core.c --- a/tools/xenstore/xenstored_core.c Thu May 11 15:01:54 2006 +0100 +++ b/tools/xenstore/xenstored_core.c Thu May 11 15:51:56 2006 +0100 @@ -461,7 +461,7 @@ static bool write_node(struct connection + node->num_perms*sizeof(node->perms[0]) + node->datalen + node->childlen; - if (data.dsize >= quota_max_entry_size) + if (domain_is_unprivileged(conn) && data.dsize >= quota_max_entry_size) goto error; data.dptr = talloc_size(node, data.dsize); diff -r 08f5adb5058b -r 891e0d1cf4ab tools/xenstore/xenstored_domain.c --- a/tools/xenstore/xenstored_domain.c Thu May 11 15:01:54 2006 +0100 +++ b/tools/xenstore/xenstored_domain.c Thu May 11 15:51:56 2006 +0100 @@ -248,6 +248,11 @@ bool domain_can_read(struct connection * { struct xenstore_domain_interface *intf = conn->domain->interface; return (intf->req_cons != intf->req_prod); +} + +bool domain_is_unprivileged(struct connection *conn) +{ + return (conn && conn->domain && conn->domain->domid != 0); } bool domain_can_write(struct connection *conn) @@ -587,7 +592,7 @@ void domain_entry_dec(struct connection int domain_entry(struct connection *conn) { - return (conn && conn->domain && conn->domain->domid) + return (domain_is_unprivileged(conn)) ? conn->domain->nbentry : 0; } @@ -609,7 +614,7 @@ void domain_watch_dec(struct connection int domain_watch(struct connection *conn) { - return (conn && conn->domain && conn->domain->domid) + return (domain_is_unprivileged(conn)) ? conn->domain->nbwatch : 0; } diff -r 08f5adb5058b -r 891e0d1cf4ab tools/xenstore/xenstored_domain.h --- a/tools/xenstore/xenstored_domain.h Thu May 11 15:01:54 2006 +0100 +++ b/tools/xenstore/xenstored_domain.h Thu May 11 15:51:56 2006 +0100 @@ -47,6 +47,8 @@ bool domain_can_read(struct connection * bool domain_can_read(struct connection *conn); bool domain_can_write(struct connection *conn); +bool domain_is_unprivileged(struct connection *conn); + /* Quota manipulation */ void domain_entry_inc(struct connection *conn); void domain_entry_dec(struct connection *conn); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |