]> git.proxmox.com Git - pve-cluster.git/commitdiff
set exec bit for openvz scripts
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 3 Oct 2011 05:56:22 +0000 (07:56 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 3 Oct 2011 05:58:26 +0000 (07:58 +0200)
Makefile
data/src/cfs-plug-memdb.c
debian/changelog

index d9ade9c916aa0dd6ec1cd31efae809f3ab38a4b0..8d20e167a9ada093c711e00093ae0075662bfaba 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ RELEASE=2.0
 
 PACKAGE=pve-cluster
 PKGVER=1.0
-PKGREL=7
+PKGREL=8
 
 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
 
index 77ec1c1cf412739422e7fe7a61c1c6bf953be5e5..c0619f94d4c37448cf95371d03e2efe6456628da 100644 (file)
 
 static struct cfs_operations cfs_ops;
 
+static gboolean 
+name_is_openvz_script(
+       const char *name, 
+       guint32 *vmid_ret)
+{
+       if (!name)
+               return FALSE;
+
+       guint32 vmid = 0;
+       char *end = NULL;
+
+       if (name[0] == 'v' && name[1] == 'p' && name[2] == 's') {
+               end = (char *)name + 3;
+       } else {
+               if (name[0] < '1' || name[0] > '9')
+                       return FALSE;
+
+               vmid = strtoul(name, &end, 10);
+       }
+
+       if (!end || end[0] != '.')
+               return FALSE;
+
+       end++;
+
+       gboolean res = FALSE;
+
+       if (end[0] == 'm' && strcmp(end, "mount") == 0)
+               res = TRUE;
+
+       if (end[0] == 'u' && strcmp(end, "umount") == 0)
+               res = TRUE;
+
+       if (end[0] == 's' && 
+           (strcmp(end, "start") == 0 || strcmp(end, "stop") == 0))
+               res = TRUE;
+
+       if (end[0] == 'p' && 
+           (strcmp(end, "premount") == 0 || strcmp(end, "postumount") == 0))
+               res = TRUE;
+
+
+       if (res && vmid_ret)
+               *vmid_ret = vmid;
+
+       return res;
+}
+
 static void tree_entry_stat(memdb_tree_entry_t *te, struct stat *stbuf, gboolean quorate)
 {
        g_return_if_fail(te != NULL);
@@ -53,6 +101,9 @@ static void tree_entry_stat(memdb_tree_entry_t *te, struct stat *stbuf, gboolean
        } else {
                stbuf->st_mode = S_IFREG | (quorate ? 0666 : 0444);
                stbuf->st_nlink = 1;
+               if (name_is_openvz_script(te->name, NULL)) {
+                       stbuf->st_mode |= S_IXUSR;
+               }
        } 
                
        stbuf->st_size = te->size;
index a3d1aa5566616092073061d778e6ca128c92f6f8..4fdaa065c37a74831d0997273f5e1dbfdb98b661 100644 (file)
@@ -1,3 +1,9 @@
+pve-cluster (1.0-8) unstable; urgency=low
+
+  * set exec permission on openvz action scripts
+
+ -- Proxmox Support Team <support@proxmox.com>  Mon, 03 Oct 2011 07:58:05 +0200
+
 pve-cluster (1.0-7) unstable; urgency=low
 
   * fixes for rrdcached