typedef struct fr_command_socket_t {
char *path;
+ char *copy; /* <sigh> */
uid_t uid;
gid_t gid;
int mode;
return sockfd;
}
+
static void command_close_socket(rad_listen_t *this)
{
this->status = RAD_LISTEN_STATUS_CLOSED;
};
+static void command_socket_free(rad_listen_t *this)
+{
+ fr_command_socket_t *sock = this->data;
+
+ unlink(sock->copy);
+ free(sock->copy);
+ sock->copy = NULL;
+}
+
+
/*
* Parse the unix domain sockets.
*
return -1;
}
+ sock->copy = NULL;
+ if (sock->path) sock->copy = strdup(sock->path);
+
#if defined(HAVE_GETPEEREID) || defined (SO_PEERCRED)
if (sock->uid_name) {
struct passwd *pw;
#ifdef WITH_COMMAND_SOCKET
/* TCP command socket */
- { command_socket_parse, NULL,
+ { command_socket_parse, command_socket_free,
command_domain_accept, command_domain_send,
command_socket_print, command_socket_encode, command_socket_decode },
#endif