When converting from sub-server to parent server: Virtual server users are "lost"

I'm not 100% sure if I'm doing or understanding something wrong here, but:

  • I created a test server "test1.domain.tld" as parent/toplevel
  • Under that, I created a sub-server "test2.domain.tld"
  • In that subserver, I created a test user "test@test2.domain.tld" (in this case: an Website FTP Access user).
  • I converted the sub-server to a parent server, keeping its domain name
  • Error: The "test" user is no longer listed in the now parent "test2.domain.tld"!
  • But: The user's entry in passwd (with the previous home directory), database users, etc. still exist. The user is not associated with Virtualmin anymore though.

Am I doing something wrong? Or is this a bug? I'd think that when converting a server, its users should be converted too, at least FTP Access users.

Status: 
Closed (fixed)

Comments

As a further discrepancy when moving a sub-server to parent, the AuthUserFile directive in the stats directory .htaccess file is not adjusted to the new home path.

For this user who got lost - does his UID and GID in /etc/passwd match the UID and GID of the new domain owner user? Or the original parent domain owner?

BTW, the problem of the .htaccess file not being updated is clearly a bug - I will fix that in the next release.

The lost users keep all their previous data in the passwd file, UID, GID and home directory.

I.e. UID and GID of the testuser is still that of the previous parent server, while the moved subserver (now parent server) gets new IDs.

How does Virtualmin determine whether a Linux system user belongs to a virtual server, and to which one? Does it have a separate "association list" for that? Or does it somehow go by UID/GID?

Also, if it helps or you can't reproduce the behavior on your system, I can send you a login to my experimental Virtualmin again where you can do the sequence in the first post.

Ok, I found the bug that causes this, and will have it fixed in the next Virtualmin release.

Thanks Jamie! Could I maybe get a quick-fix before the next release (depending on when that's gonna be), because I have some more subservers to convert to parent the next days, and I don't wanna lose their user associations as well. ;)

Also I'm surprised that I'm the first to report this... am I the only person who uses this function on servers with users? :)

Sure, I can send you an updated package - although you will also need to install the new Webmin version 1.670 for it to work. Are you running the GPL or pro version, and on which linux distribution?

Probably nobody noticed this before because it only effects "website FTP" users in sub-servers.

Re: "only website FTP users": I just tested some more, and it also affects regular mail users, if the "Accept mail for domain" feature happens to be turned off. :) You might want to investigate that too, to avoid bad surprises.

As for package: I'm using Pro on Ubuntu 12.04 x64. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.