rpcbind/rpcbind-0.2.4-systemd-rundir.patch
Scott Mayhew 941d5b4be9 Updated to the latest upstream release: rpcbind-1_2_9
- Updated the URL in the RPM header to
  https://sourceforge.net/projects/rpcbind
- Updated to rpcbind-1.2.9 to fix various memory leaks
- Renamed RPCBIND_ARGS to RPCBIND_OPTIONS in /etc/sysconfig/rpcbind

Resolves: RHEL-174800
Resolves: RHEL-174804
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
2026-07-01 09:52:20 -04:00

36 lines
1.0 KiB
Diff

diff -up rpcbind-1.2.8/src/rpcbind.c.orig rpcbind-1.2.8/src/rpcbind.c
--- rpcbind-1.2.8/src/rpcbind.c.orig 2025-07-26 16:57:24.000000000 -0400
+++ rpcbind-1.2.8/src/rpcbind.c 2025-07-26 17:15:51.933467872 -0400
@@ -214,6 +214,8 @@ static void version()
fprintf(stderr, "\n");
}
+char *systemdtmp = "/usr/bin/systemd-tmpfiles --create rpcbind.conf";
+
int
main(int argc, char *argv[])
{
@@ -221,13 +223,21 @@ main(int argc, char *argv[])
void *nc_handle; /* Net config handle */
struct rlimit rl;
int maxrec = RPC_MAXDATASIZE;
+ int once = 1;
parseargs(argc, argv);
+tryagain:
/* Check that another rpcbind isn't already running. */
if ((rpcbindlockfd = (open(RPCBINDDLOCK,
- O_RDONLY|O_CREAT, 0444))) == -1)
+ O_RDONLY|O_CREAT, 0444))) == -1) {
+ if (once) {
+ once = system(systemdtmp); /* set once to avoid a warning */
+ once = 0;
+ goto tryagain;
+ }
err(1, "%s", RPCBINDDLOCK);
+ }
if(flock(rpcbindlockfd, LOCK_EX|LOCK_NB) == -1 && errno == EWOULDBLOCK)
errx(1, "another rpcbind is already running. Aborting");