Commit f4ebcb5b authored by aburtsev's avatar aburtsev

[XCAP] Commit outstanding changes before editing code

parent 7ce67518
......@@ -931,6 +931,7 @@ static int grant_def_cap(xc_interface *xch,int *def_domains, int size, struct ca
return 0;
}
#endif
/* Convert strings to capabilities. False if a problem.
* Permission scheme in xenstore is weird. Here are the rules -
1) Domain 0 may read or write anywhere in the store,
......@@ -1029,17 +1030,23 @@ bool xs_strings_to_caps(unsigned int num, struct capability *caps, const char *s
def_size = 2;
}
/* Grant this to owner. */
list[0] = caps[0];
list[1] = caps[1];
/* xenstore runs in the context of dom0.
cap_create will anyway create cap in dom0's cap_space.
Hence this condition is to grant it only to other domains.
*/
if ( owner_domid != 0 ) {
/* Grant this to owner. */
list[0] = caps[0];
list[1] = caps[1];
log("xs_strings_to_caps: Granting read and write caps to owner_domid (%d)\n",owner_domid);
log("xs_strings_to_caps: Granting read and write caps to owner_domid (%d)\n",owner_domid);
if (xc_cap_grant(xch, owner_domid, 2, &list, 2) == 1)
{
log("xs_strings_to_caps: Error in xc_cap_grant.\n");
goto out;
}
if (xc_cap_grant(xch, owner_domid, 2, &list, 2) == 1)
{
log("xs_strings_to_caps: Error in xc_cap_grant.\n");
goto out;
}
}
for (p = end+1, i = 1; i < num; i++) {
/* "r", "w", or "b" for both. */
......@@ -2080,13 +2087,13 @@ static void manual_node(const char *name, const char *child)
xch = xc_interface_open(0,0,0);
if (xc_cap_create(xch,&node->caps[0]))
{
log("xs_strings_to_caps: Error in xc_cap_create.\n");
log("manual_node: Error in xc_cap_create.\n");
xc_interface_close(xch);
}
if (xc_cap_create(xch, &node->caps[1]))
{
log("xs_strings_to_caps: Error in xc_cap_create.\n");
log("manual_node: Error in xc_cap_create.\n");
xc_interface_close(xch);
}
xc_interface_close(xch);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment