1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
--- src/daemon.c.orig 2014-10-24 21:51:06.000000000 +0200
+++ src/daemon.c 2015-01-16 09:57:05.000000000 +0100
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <sys/prctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -864,8 +863,8 @@ shutdown:
struct sockaddr_un remote;
socklen_t len = sizeof(remote);
- pollfds[nsockets-1].fd = accept(pollfds[0].fd, &remote,
- &len);
+ pollfds[nsockets-1].fd = accept(pollfds[0].fd,
+ (struct sockaddr *)&remote, &len);
pollfds[nsockets-1].events = POLLIN|POLLPRI|POLLHUP;
pollfds[nsockets-1].revents = pollfds[0].revents;
}
@@ -942,7 +941,7 @@ set_up_socket(context *ctx)
.sun_path = SOCKPATH,
};
- int rc = bind(sd, &addr_un, sizeof(addr_un));
+ int rc = bind(sd, (struct sockaddr *)&addr_un, sizeof(addr_un));
if (rc < 0) {
ctx->backup_cms->log(ctx->backup_cms, ctx->priority|LOG_ERR,
"unable to bind to \"%s\": %m",
@@ -998,7 +997,7 @@ check_socket(context *ctx)
struct sockaddr_un remote;
socklen_t size = sizeof(remote);
- rc = getpeername(sd, &remote, &size);
+ rc = getpeername(sd, (struct sockaddr *)&remote, &size);
if (rc < 0) {
close(sd);
return;
@@ -1159,8 +1158,6 @@ daemonize(cms_context *cms_ctx, char *ce
close(fd);
}
- prctl(PR_SET_NAME, "pesignd", 0, 0, 0);
-
setsid();
if (do_fork) {
|