comparison src/dnsbl.cpp @ 43:acbe44bbba22

seems to drop root privs ok now
author carl
date Mon, 05 Jul 2004 22:24:22 -0700
parents afcf403709ef
children 6b79046b18c2
comparison
equal deleted inserted replaced
42:afcf403709ef 43:acbe44bbba22
1287 1287
1288 1288
1289 static void setup_socket(char *sock); 1289 static void setup_socket(char *sock);
1290 static void setup_socket(char *sock) { 1290 static void setup_socket(char *sock) {
1291 unlink(sock); 1291 unlink(sock);
1292 sockaddr_un addr; 1292 // sockaddr_un addr;
1293 memset(&addr, '\0', sizeof addr); 1293 // memset(&addr, '\0', sizeof addr);
1294 addr.sun_family = AF_UNIX; 1294 // addr.sun_family = AF_UNIX;
1295 strncpy(addr.sun_path, sock, sizeof(addr.sun_path)-1); 1295 // strncpy(addr.sun_path, sock, sizeof(addr.sun_path)-1);
1296 int s = socket(AF_UNIX, SOCK_STREAM, 0); 1296 // int s = socket(AF_UNIX, SOCK_STREAM, 0);
1297 bind(s, (sockaddr*)&addr, sizeof(addr)); 1297 // bind(s, (sockaddr*)&addr, sizeof(addr));
1298 close(s); 1298 // close(s);
1299 } 1299 }
1300 1300
1301 1301
1302 int main(int argc, char**argv) 1302 int main(int argc, char**argv)
1303 { 1303 {