*/
#include "includes.h"
+#include "nsswitch/winbind_client.h"
/* Global variables. These are effectively the client state information */
{
struct sockaddr_un sunaddr;
struct stat st;
- pstring path;
+ char *path;
int fd;
int wait_time;
int slept;
/* Connect to socket */
- snprintf(path, sizeof(path), "%s%s", dir, "/" WINBINDD_SOCKET_NAME);
-
+ asprintf(&path, "%s%s", dir, "/" WINBINDD_SOCKET_NAME);
ZERO_STRUCT(sunaddr);
sunaddr.sun_family = AF_UNIX;
strncpy(sunaddr.sun_path, path, sizeof(sunaddr.sun_path) - 1);
the winbindd daemon is not running. */
if (lstat(path, &st) == -1) {
+ SAFE_FREE(path);
return -1;
}
+
+ SAFE_FREE(path);
/* Check permissions on unix socket file */
struct timeval tv;
fd_set w_fds;
int ret;
- int connect_errno = 0, errnosize;
+ int connect_errno = 0;
+ socklen_t errnosize;
if (wait_time >= CONNECT_TIMEOUT)
goto error_out;