On Wed, 2011-03-30 at 10:33 +0100, Frank Pan wrote:
> The entries in xenstore have permission attributes. The
> attributes can be easily altered by xenstore-chmod, however,
> I cannot find an easy way to view them.
> I've modified xenstore_client.c to raise a new utility.
> The utility checks the permission and makes an easy-to-look output.
You can sort of get this from "xenstore-ls -p" but a stat option seems
like a worthwhile addition.
> Please tell me any suggestions.
I think I'd suggest pulling the core of the new functionality out of
perform() and into a new function do_stat().
> + case MODE_stat:
> + mstr = incl_mode ? "stat " : "";
> + errx(1, "Usage: %s %s[-h] [-s] key [...]", progname, mstr);
Does it deal with multiple key names as a paramter? If not then I guess
the [...] can be dropped, or else the necessary support added.
> +static const char *
> +perm_type_str(int perm_type)
Can you use xs_perm_to_string here instead?
> @@ -459,6 +480,34 @@ perform(enum mode mode, int optind, int argc,
> + output("Owner:\t\t\t%d\n", perms.id);
> + output("Default permission:\t%s\n",
> + output("Permissions:\t\t", perms.id);
Xen-devel mailing list