- fate#313222 - xenstore-chmod should support 256 permissions
26189-xenstore-chmod.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=217
This commit is contained in:
parent
128dffb75f
commit
cb7a0bd3d6
85
26189-xenstore-chmod.patch
Normal file
85
26189-xenstore-chmod.patch
Normal file
@ -0,0 +1,85 @@
|
||||
# HG changeset patch
|
||||
# Parent 8b93ac0c93f3fb8a140b4688ba71841ac927d4e3
|
||||
xenstore-chmod: handle arbitrary number of perms rather than MAX_PERMS constant
|
||||
|
||||
Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
|
||||
there are more than 16 domU(s) on one hypervisor (it's easy to
|
||||
achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
|
||||
remove MAX_PERMS limitation and make it as arbitrary number of perms.
|
||||
|
||||
Signed-off-by: Chunyan Liu <cyliu@suse.com>
|
||||
Acked-by: Ian Campbell <ian.campbell@citrix.com>
|
||||
|
||||
diff -r 8b93ac0c93f3 tools/xenstore/xenstore_client.c
|
||||
--- a/tools/xenstore/xenstore_client.c Tue Nov 13 11:19:17 2012 +0000
|
||||
+++ b/tools/xenstore/xenstore_client.c Mon Nov 26 11:33:38 2012 +0800
|
||||
@@ -25,7 +25,6 @@
|
||||
#define PATH_SEP '/'
|
||||
#define MAX_PATH_LEN 256
|
||||
|
||||
-#define MAX_PERMS 16
|
||||
|
||||
enum mode {
|
||||
MODE_unknown,
|
||||
@@ -407,44 +406,41 @@ perform(enum mode mode, int optind, int
|
||||
output("%s\n", list[i]);
|
||||
}
|
||||
free(list);
|
||||
- optind++;
|
||||
- break;
|
||||
- }
|
||||
- case MODE_ls: {
|
||||
- do_ls(xsh, argv[optind], 0, prefix);
|
||||
- optind++;
|
||||
- break;
|
||||
+ optind++;
|
||||
+ break;
|
||||
+ }
|
||||
+ case MODE_ls: {
|
||||
+ do_ls(xsh, argv[optind], 0, prefix);
|
||||
+ optind++;
|
||||
+ break;
|
||||
}
|
||||
case MODE_chmod: {
|
||||
- struct xs_permissions perms[MAX_PERMS];
|
||||
- int nperms = 0;
|
||||
/* save path pointer: */
|
||||
char *path = argv[optind++];
|
||||
- for (; argv[optind]; optind++, nperms++)
|
||||
+ int nperms = argc - optind;
|
||||
+ struct xs_permissions perms[nperms];
|
||||
+ int i;
|
||||
+ for (i = 0; argv[optind]; optind++, i++)
|
||||
{
|
||||
- if (MAX_PERMS <= nperms)
|
||||
- errx(1, "Too many permissions specified. "
|
||||
- "Maximum per invocation is %d.", MAX_PERMS);
|
||||
-
|
||||
- perms[nperms].id = atoi(argv[optind]+1);
|
||||
+ perms[i].id = atoi(argv[optind]+1);
|
||||
|
||||
switch (argv[optind][0])
|
||||
{
|
||||
case 'n':
|
||||
- perms[nperms].perms = XS_PERM_NONE;
|
||||
+ perms[i].perms = XS_PERM_NONE;
|
||||
break;
|
||||
case 'r':
|
||||
- perms[nperms].perms = XS_PERM_READ;
|
||||
+ perms[i].perms = XS_PERM_READ;
|
||||
break;
|
||||
case 'w':
|
||||
- perms[nperms].perms = XS_PERM_WRITE;
|
||||
+ perms[i].perms = XS_PERM_WRITE;
|
||||
break;
|
||||
case 'b':
|
||||
- perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
|
||||
+ perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
|
||||
break;
|
||||
default:
|
||||
errx(1, "Invalid permission specification: '%c'",
|
||||
- argv[optind][0]);
|
||||
+ argv[optind][0]);
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 30 10:30:10 CST 2012 - cyliu@suse.com
|
||||
|
||||
- fate#313222 - xenstore-chmod should support 256 permissions
|
||||
26189-xenstore-chmod.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 27 09:17:17 MST 2012 - carnold@novell.com
|
||||
|
||||
|
3
xen.spec
3
xen.spec
@ -15,6 +15,7 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: xen
|
||||
ExclusiveArch: %ix86 x86_64
|
||||
%define xvers 4.2
|
||||
@ -243,6 +244,7 @@ Patch26151: 26151-gnttab-compat-get-status-frames.patch
|
||||
Patch26179: 26179-PCI-find-next-cap.patch
|
||||
Patch26183: 26183-x86-HPET-masking.patch
|
||||
Patch26188: 26188-x86-time-scale-asm.patch
|
||||
Patch26189: 26189-xenstore-chmod.patch
|
||||
Patch25: CVE-2012-4544-xsa25.patch
|
||||
Patch26: CVE-2012-5510-xsa26.patch
|
||||
Patch27: CVE-2012-5511-xsa27.patch
|
||||
@ -782,6 +784,7 @@ tar xfj %{SOURCE6} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools
|
||||
%patch26179 -p1
|
||||
%patch26183 -p1
|
||||
%patch26188 -p1
|
||||
%patch26189 -p1
|
||||
%patch25 -p1
|
||||
%patch26 -p1
|
||||
%patch27 -p1
|
||||
|
Loading…
x
Reference in New Issue
Block a user