[Bug 2100849] [NEW] anacron 2.3-41ubuntu1 not removing temp files
Sander van Malssen
2100849 at bugs.launchpad.net
Tue Mar 4 11:01:49 UTC 2025
Public bug reported:
Version 2.3-41ubuntu1 changed runjob.c:temp_file() to use mkstemp()
instead of tempnam() but forgets to unlink the temp file after creating
it as the old code used to do. It can be added back with just one line
of code:
--- anacron-2.3-41ubuntu1/runjob.c.orig 2025-03-04 11:25:47.000000000 +0100
+++ anacron-2.3-41ubuntu1/runjob.c 2025-03-04 11:42:41.680928448 +0100
@@ -52,6 +52,7 @@
} while (fd == -1 && i < max_retries);
if (fd == -1) die_e("Failed to create and open unique temporary filename");
+ if (unlink(template)) die_e("Can't unlink temporary file");
fcntl(fd, F_SETFD, 1); /* set close-on-exec flag */
return fd;
}
** Affects: anacron (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to anacron in Ubuntu.
https://bugs.launchpad.net/bugs/2100849
Title:
anacron 2.3-41ubuntu1 not removing temp files
Status in anacron package in Ubuntu:
New
Bug description:
Version 2.3-41ubuntu1 changed runjob.c:temp_file() to use mkstemp()
instead of tempnam() but forgets to unlink the temp file after
creating it as the old code used to do. It can be added back with just
one line of code:
--- anacron-2.3-41ubuntu1/runjob.c.orig 2025-03-04 11:25:47.000000000 +0100
+++ anacron-2.3-41ubuntu1/runjob.c 2025-03-04 11:42:41.680928448 +0100
@@ -52,6 +52,7 @@
} while (fd == -1 && i < max_retries);
if (fd == -1) die_e("Failed to create and open unique temporary filename");
+ if (unlink(template)) die_e("Can't unlink temporary file");
fcntl(fd, F_SETFD, 1); /* set close-on-exec flag */
return fd;
}
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/anacron/+bug/2100849/+subscriptions
More information about the foundations-bugs
mailing list