[pmg-devel] code adjustment for PMG in /usr/share/perl5/PMG/DBTools.pm

Patrick Fogarty patrick.fogarty at patanne.com
Fri Apr 12 18:35:01 CEST 2019


I agree that my change works, but introduces the potential for problems, 
and therefore may not be the "correct" answer. In fact I have no 
confirmation that everything is okay. Everything appears to be okay 
after upgrade, except that tracking center loops forever with a 
"connection error". However I did not press matters to determine if 
there truly is an issue.

The environment...
PVE: 5.3-12
PMG: 5.1-3

The is a test environment, so we are using your community repo, not 
subscription. However it is happening in subscription as well.

PMG is running inside a container based on Debian Stretch. It is about 
as unmodified as you can get.

We did make modifications to the PMG install. They are limited to 
/var/lib/pmg/templates/main.cf.in and /var/lib/pmg/templates/init.pre.in
(geoip) and some custom spamassassin rules. Beyond that, nothing has 
been touched.

The upgrade failure happens at the very end during the configuration 
phase. As the post mentioned, I traced the issue to PMG:: DBTools:: 
postgres_admin_cmd. But you have already reviewed the post and the code, 
so you already know that.

Let me know how I can help further.

Thomas Lamprecht wrote on 4/12/19 11:23 AM:
> Hi,
> On 4/12/19 4:17 PM, Patrick Fogarty wrote:
>> If you follow this thread...
>> https://forum.proxmox.com/threads/setuid-postgres-114-failed-inappropriate-ioctl-for-device.41414/
>> ...you will find that I had an issue, as did others, performing upgrades/updates. I adjusted my code manually and things went back to normal. Last month you released PMG 5.2. The upgrade downloads a package that includes the original code, so the upgrade overwrites my changes, then fails the upgrade process "pmg-api --configure", after which I believe the process is in an incomplete state.
>> How can I assist, beyond my post in the above thread, showing the code change I made?
> Either, you could sent a patch here, for this see:
> https://pve.proxmox.com/wiki/Developer_Documentation
> (while written for PVE, almost all is valid for PMG too)
> Else you normally also can make a Bug report, which does not gets as easily forgotten as
> some Forum/Mailing list thread: https://bugzilla.proxmox.com/enter_bug.cgi
> But posting here may be enough this time, Stoiko, could you please take a look
> at the proposed change:
> https://forum.proxmox.com/threads/setuid-postgres-114-failed-inappropriate-ioctl-for-device.41414/#post-233016
> Looking at perl's source code at the Perl_magic_set case for EUID (case '>')
> we just see that there's no special error handling, thus the recommendation
> to check $! (errno or sys_errlist[errno] depending on context) after the call.
> We do that, and it seems correct, so either we need to reset it to 0 befor the
> seteuid call to ensure we do not check an old value or this is correct an the
> seteuid really fails in the posted case..
> Patrick, can you post a bit more details about your setup, you said you run it in
> PVE, inside a Virtual Machine (VM) or Container (CT)?
> Because your change could just omit error checking completely, and thus not be
> the "correct" solution here..
> cheers,
> Thomas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pve.proxmox.com/pipermail/pmg-devel/attachments/20190412/a801dd99/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 99935 bytes
Desc: not available
URL: <http://pve.proxmox.com/pipermail/pmg-devel/attachments/20190412/a801dd99/attachment-0001.png>

More information about the pmg-devel mailing list