[pve-devel] r5582 - in pve-cluster/trunk/data: . src
svn-commits at proxmox.com
svn-commits at proxmox.com
Tue Feb 22 11:28:26 CET 2011
Author: dietmar
Date: 2011-02-22 11:28:26 +0100 (Tue, 22 Feb 2011)
New Revision: 5582
Modified:
pve-cluster/trunk/data/ChangeLog
pve-cluster/trunk/data/src/cfs-utils.c
Log:
* src/cfs-utils.c (path_is_private): skip '/'
Modified: pve-cluster/trunk/data/ChangeLog
===================================================================
--- pve-cluster/trunk/data/ChangeLog 2011-02-22 10:01:32 UTC (rev 5581)
+++ pve-cluster/trunk/data/ChangeLog 2011-02-22 10:28:26 UTC (rev 5582)
@@ -1,3 +1,7 @@
+2011-02-22 Proxmox Support Team <support at proxmox.com>
+
+ * src/cfs-utils.c (path_is_private): skip '/'
+
2011-02-16 Proxmox Support Team <support at proxmox.com>
* perl/pvecm: do not use PVE::RPCEnvironment
Modified: pve-cluster/trunk/data/src/cfs-utils.c
===================================================================
--- pve-cluster/trunk/data/src/cfs-utils.c 2011-02-22 10:01:32 UTC (rev 5581)
+++ pve-cluster/trunk/data/src/cfs-utils.c 2011-02-22 10:28:26 UTC (rev 5582)
@@ -415,11 +415,13 @@
gboolean
path_is_private(const char *path)
{
- if ((strncmp(path, "/priv", 5) == 0) && (path[5] == 0 || path[5] == '/')) {
+ while (*path == '/') path++;
+
+ if ((strncmp(path, "priv", 4) == 0) && (path[4] == 0 || path[4] == '/')) {
return TRUE;
} else {
- if (strncmp(path, "/nodes/", 7) == 0) {
- const char *tmp = path + 7;
+ if (strncmp(path, "nodes/", 6) == 0) {
+ const char *tmp = path + 6;
while(*tmp && *tmp != '/') tmp++;
if (*tmp == '/' &&
(strncmp(tmp, "/priv", 5) == 0) &&
@@ -434,5 +436,7 @@
gboolean
path_is_lockdir(const char *path)
{
+ while (*path == '/') path++;
+
return (strncmp(path, "priv/lock/", 10) == 0) && (strlen(path) > 10);
}
More information about the pve-devel
mailing list