rpm-software-management / librepo

A library providing C and Python (libcURL like) API for downloading packages and linux repository metadata in rpm-md format
http://rpm-software-management.github.io/librepo/
GNU Lesser General Public License v2.1
75 stars 91 forks source link

Create a directory for gpg sockets in /run/user/ (RhBug:1769831,1771012) #178

Closed lukash closed 4 years ago

lukash commented 4 years ago

The solution of sending the "KILLAGENT" message to gpgagent to make it clean up its sockets in gpg home dir is causing a race condition with the gpgme_release() function.

Instead of trying to make the agent clean up its sockets (which doesn't seem to be reliably possible), take advantage of its feature to create the sockets under '/run/user/$UID' if this directory is present. The sockets shouldn't be causing any trouble in this directory.

The commit creates the '/run/user/$UID' directory if it's not present on the system. The sockets are then created there.

https://bugzilla.redhat.com/show_bug.cgi?id=1769831 https://bugzilla.redhat.com/show_bug.cgi?id=1771012

Fixes https://github.com/rpm-software-management/microdnf/issues/50