[lxc-users] Ownership changes after container move

Jamie Brown Jamie.Brown at mpec.co.uk
Tue Nov 10 15:46:15 UTC 2015


# lxc exec test -- ls -lAn /home/jamie
total 16
-rw-r--r-- 1 1000 1001  220 Nov 10 15:19 .bash_logout
-rw-r--r-- 1 1000 1001 3637 Nov 10 15:19 .bashrc
-rw-r--r-- 1 1000 1001  675 Nov 10 15:19 .profile
drwx------ 2 1000 1001 4096 Nov 10 15:20 .ssh



# lxc stop test
# lxc move local-server:test remote-server:test

# lxc start remote-server:test
# lxc exec remote-server:test -- ls -lAn /home/jamie
total 16
-rw-r--r-- 1 1001 1002  220 Nov 10 15:19 .bash_logout
-rw-r--r-- 1 1001 1002 3637 Nov 10 15:19 .bashrc
-rw-r--r-- 1 1001 1002  675 Nov 10 15:19 .profile
drwx------ 2 1001 1002 4096 Nov 10 15:20 .ssh


It changed in the other direction after repeating too, so not just limited to single direction.







On 10/11/2015, 15:30, "lxc-users on behalf of Serge Hallyn" <lxc-users-bounces at lists.linuxcontainers.org on behalf of serge.hallyn at ubuntu.com> wrote:

>Quoting Tycho Andersen (tycho.andersen at canonical.com):
>> Hi Jamie,
>> 
>> On Tue, Nov 10, 2015 at 09:10:22AM +0000, Jamie Brown wrote:
>> > Hi,
>> > 
>> > I’ve discovered that some file ownership changes have occurred after moving stopped containers between hosts.
>> > 
>> > Prior to the move there were various user directories (e.g. “/home/jamie”) with ownership set to jamie:jamie. After moving, the ownership was changed to ubuntu:ubuntu.
>> 
>> Sounds like a pretty serious bug. Do you happen to know how to
>> reproduce the problem?
>
>Can you, from the hosts, do a ls -ln on one of the offending
>directories and show the results?  Seems there are 3 possiblities,
>
>1. the files are simply chowned to wrong uid altogether
>2. the files are chowned to the username rather than uid, and jamie's
>   user/group is different between hosts.  That's a bug in lxd, it
>   should use the numeric values.  (Probably a missing tar flag)
>3. the files are chowned (correctly) to the original uid, but
>   the way you're looking at the files uses a different /etc/{passwd,group}
>   so the names appear different.
>_______________________________________________
>lxc-users mailing list
>lxc-users at lists.linuxcontainers.org
>http://lists.linuxcontainers.org/listinfo/lxc-users


More information about the lxc-users mailing list