#1108205 popularity-contest: when run in a container, gpg complains about insecure memory

#1108205#5
Date:
2025-06-23 07:57:33 UTC
From:
To:
Hi,

I have an nspawn container that has popularity-contest enabled, and the cron job results in emails telling me:

  gpg: Warning: using insecure memory!

I assume that this is because the container is not configured to allow the permissions required to lock memory on the real system, so despite being run as root, gpg fails to lock the memory, and complains.

One could grant that permission to the container, but that seems like overkill to solve this.

One could normally configure gpg to ignore it, except that gpg is being invoked with --no-options.

Therefore, I would suggest that you add `--no-secmem-warning` to the gpg invocation in order to suppress the warning.  I have tried this, and it works.

After all, the warning is about the danger that the unencrypted data might get saved to swap, and thus be exposed, which is clearly not an issue in this case because the cleartext is being saved as /var/log/popularity-contest anyway, so the warning is really pointless in this case.

Cheers, Phil.

#1108205#10
Date:
2025-06-24 15:30:06 UTC
From:
To:
Hi Philip,

Note that  /etc/cron.daily/popularity-contest is a conffile, so you can suppress the warning.

Thanks, I also have plans to allow different programs than gpg once trixie is released.

Cheers,

#1108205#15
Date:
2025-06-24 20:06:45 UTC
From:
To:
Bill Allombert <ballombe@debian.org> writes:

Absolutely -- already done. :-)

It took me a little while to remember that the machine in question had
been moved from being a VM to a container, which made the inability of
root to lock memmory somewhat puzzling for a while.

I just thought that others could be saved similar effort.

Cheers, Phil.