virtualmin/virtualmin-nginx

Can't access subserver log files for non-root users

Closed this issue · 6 comments

My users can't access any of the sub-server Virtualmin Nginx logs. It simply says "You are not allowed to view this extra log".

I check the server log files list in /syslog/, this is what I get:

image

I certainly sure that is not something we would expect. The number of repeating log files matches the sub-server count attached to this user.

I'm afraid a code patch alone won't fix the problem for the existing server.

Can you attach a screenshot of the link the users are clicking on when they get that "You are not allowed" error message?

Also, what does the file /etc/webmin/syslog/$USERNAME.acl contain (where $USERNAME is the domain owner's login)

OK, I attach raw screenshots here.

image

image

cat /etc/webmin/syslog/maduradirectory.acl returns:

syslog=0
extras=/var/log/virtualmin/diusapi.id_access_log	/var/log/virtualmin/diusapi.id_error_log	/var/log/virtualmin/diusapi.id_access_log	/var/log/virtualmin/diusapi.id_error_log	/var/log/virtualmin/diusapi.id_access_log	/var/log/virtualmin/diusapi.id_error_log	/var/log/virtualmin/diusapi.id_access_log	/var/log/virtualmin/diusapi.id_error_log	/var/log/virtualmin/diusapi.id_access_log	/var/log/virtualmin/diusapi.id_error_log	/var/log/virtualmin/diusapi.id_access_log	/var/log/virtualmin/diusapi.id_error_log	/var/log/virtualmin/diusapi.id_access_log	/var/log/virtualmin/diusapi.id_error_log	/var/log/virtualmin/diusapi.id_access_log	/var/log/virtualmin/diusapi.id_error_log
noedit=1
others=0
any=0
noconfig=1

Also:

webmin: 1.981
virtualmin: 6.17
virtualmin-nginx: 2.22-1

Note that this isn't just affecting one particular user. All my non-root users have this behavior.

Also,

  • ~/domains/<subdomainname>/logs symlinks "seems" correct. (yes they point to correct subdomain name logs but these symlinks are not get updated when domain name was changed). ~/domains/tata-kelola-perpus.diusapi.id/logs refers to /var/log/virtualmin/tata-kelola-perpus.maduradirectory.com_error_log.
  • NGINX records for access_log and error_log are correct.
  • My non-root users still can get the logs with SSH. e.g. tail /var/log/virtualmin/tata-kelola-perpus.diusapi.id_error_log works.

Could be this code be the cause of it?

foreach my $sd (@doms) {
push(@extras, &get_nginx_log($d, 0));
push(@extras, &get_nginx_log($d, 1));
}

it should be $sd instead of $d?

Yes! Thanks for finding this ... I will fix this in the next release of the Nginx plugin.