The local parameter shadowed the static ctlname, so `strdup()` was
assigned to the parameter and the global stayed NULL. As a result,
`asroot_ctl_cleanup()` never cleaned up the registered control socket.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
void
#ifdef ENABLE_PRIVSEP
-priv_init(const char *chrootdir, int ctl, uid_t uid, gid_t gid, const char *ctlname)
+priv_init(const char *chrootdir, int ctl, uid_t uid, gid_t gid, const char *name)
#else
-priv_init(const char *ctlname)
+priv_init(const char *name)
#endif
{
/* Store the expected control socket path for asroot_ctl_cleanup() */
- if (ctlname) {
- ctlname = strdup(ctlname);
+ if (name) {
+ ctlname = strdup(name);
if (ctlname == NULL) fatal("privsep", NULL);
}