The original rationale for this was to make sure that if
lxcpath was /home/serge/lxcbase, then then lockdir
(/run/user/serge/lock/lxc/home/serge/lxcbase) would be
owned by the same user as /home/serge/lxcbase.

The only user who can chown to other uids (without CAP_CHOWN
added to fP) is root, who shouldn't be mucking with non-root
owned containers anyway.  In the meantime this causes a bunch
of noise for arguably no benefit.

Signed-off-by: Serge Hallyn <serge.hal...@ubuntu.com>
---
 src/lxc/lxclock.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/src/lxc/lxclock.c b/src/lxc/lxclock.c
index fb2996d..020bd34 100644
--- a/src/lxc/lxclock.c
+++ b/src/lxc/lxclock.c
@@ -46,7 +46,6 @@ static char *lxclock_name(const char *p, const char *n)
        int len;
        char *dest;
        const char *rundir;
-       struct stat sb;
 
        /* lockfile will be:
         * "/run" + "/lock/lxc/$lxcpath/$lxcname + '\0' if root
@@ -75,15 +74,6 @@ static char *lxclock_name(const char *p, const char *n)
                return NULL;
        }
 
-       ret = stat(p, &sb);
-       if (ret == 0) {
-               // best effort.  If this fails, ignore it
-               if (chown(dest, sb.st_uid, sb.st_gid) < 0)
-                       ERROR("Failed to set owner for lockdir %s\n", dest);
-               if (chmod(dest, sb.st_mode) < 0)
-                       ERROR("Failed to set mode for lockdir %s\n", dest);
-       }
-
        ret = snprintf(dest, len, "%s/lock/lxc/%s/%s", rundir, p, n);
        if (ret < 0 || ret >= len) {
                free(dest);
-- 
1.8.1.2


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to