Lines 1-5
Link Here
|
1 |
--- libgamin/gam_api.c.orig 2007-08-27 03:21:03.000000000 -0700 |
1 |
--- libgamin/gam_api.c.orig 2007-08-27 10:21:03 UTC |
2 |
+++ libgamin/gam_api.c 2013-02-16 15:51:11.927100135 -0800 |
2 |
+++ libgamin/gam_api.c |
3 |
@@ -14,6 +14,7 @@ |
3 |
@@ -14,6 +14,7 @@ |
4 |
#include <sys/socket.h> |
4 |
#include <sys/socket.h> |
5 |
#include <sys/un.h> |
5 |
#include <sys/un.h> |
Lines 8-14
Link Here
|
8 |
#include "fam.h" |
8 |
#include "fam.h" |
9 |
#include "gam_protocol.h" |
9 |
#include "gam_protocol.h" |
10 |
#include "gam_data.h" |
10 |
#include "gam_data.h" |
11 |
@@ -117,7 +118,11 @@ |
11 |
@@ -117,7 +118,11 @@ gamin_get_user_name(void) |
12 |
if (user_name[0] != 0) |
12 |
if (user_name[0] != 0) |
13 |
return (user_name); |
13 |
return (user_name); |
14 |
|
14 |
|
Lines 20-26
Link Here
|
20 |
|
20 |
|
21 |
if (pw != NULL) { |
21 |
if (pw != NULL) { |
22 |
strncpy(user_name, pw->pw_name, 99); |
22 |
strncpy(user_name, pw->pw_name, 99); |
23 |
@@ -224,7 +229,11 @@ |
23 |
@@ -224,7 +229,11 @@ gamin_check_secure_dir(void) |
24 |
free(dir); |
24 |
free(dir); |
25 |
return(0); |
25 |
return(0); |
26 |
} |
26 |
} |
Lines 32-38
Link Here
|
32 |
gam_error(DEBUG_INFO, |
32 |
gam_error(DEBUG_INFO, |
33 |
"Socket directory %s has different owner\n", |
33 |
"Socket directory %s has different owner\n", |
34 |
dir); |
34 |
dir); |
35 |
@@ -301,7 +310,11 @@ |
35 |
@@ -301,7 +310,11 @@ gamin_check_secure_path(const char *path |
36 |
if (ret < 0) |
36 |
if (ret < 0) |
37 |
return(0); |
37 |
return(0); |
38 |
|
38 |
|
Lines 44-50
Link Here
|
44 |
gam_error(DEBUG_INFO, |
44 |
gam_error(DEBUG_INFO, |
45 |
"Socket %s has different owner\n", |
45 |
"Socket %s has different owner\n", |
46 |
path); |
46 |
path); |
47 |
@@ -428,10 +441,10 @@ |
47 |
@@ -428,10 +441,10 @@ gamin_write_credential_byte(int fd) |
48 |
{ |
48 |
{ |
49 |
char data[2] = { 0, 0 }; |
49 |
char data[2] = { 0, 0 }; |
50 |
int written; |
50 |
int written; |
Lines 58-64
Link Here
|
58 |
} cmsg; |
58 |
} cmsg; |
59 |
struct iovec iov; |
59 |
struct iovec iov; |
60 |
struct msghdr msg; |
60 |
struct msghdr msg; |
61 |
@@ -443,16 +456,16 @@ |
61 |
@@ -443,16 +456,16 @@ gamin_write_credential_byte(int fd) |
62 |
msg.msg_iov = &iov; |
62 |
msg.msg_iov = &iov; |
63 |
msg.msg_iovlen = 1; |
63 |
msg.msg_iovlen = 1; |
64 |
|
64 |
|
Lines 79-85
Link Here
|
79 |
written = sendmsg(fd, &msg, 0); |
79 |
written = sendmsg(fd, &msg, 0); |
80 |
#else |
80 |
#else |
81 |
written = write(fd, &data[0], 1); |
81 |
written = write(fd, &data[0], 1); |
82 |
@@ -654,15 +667,20 @@ |
82 |
@@ -654,15 +667,20 @@ gamin_check_cred(GAMDataPtr conn, int fd |
83 |
gid_t c_gid; |
83 |
gid_t c_gid; |
84 |
|
84 |
|
85 |
#ifdef HAVE_CMSGCRED |
85 |
#ifdef HAVE_CMSGCRED |
Lines 103-109
Link Here
|
103 |
/* Set the socket to receive credentials on the next message */ |
103 |
/* Set the socket to receive credentials on the next message */ |
104 |
{ |
104 |
{ |
105 |
int on = 1; |
105 |
int on = 1; |
106 |
@@ -683,8 +701,8 @@ |
106 |
@@ -683,8 +701,8 @@ gamin_check_cred(GAMDataPtr conn, int fd |
107 |
|
107 |
|
108 |
#ifdef HAVE_CMSGCRED |
108 |
#ifdef HAVE_CMSGCRED |
109 |
memset(&cmsg, 0, sizeof(cmsg)); |
109 |
memset(&cmsg, 0, sizeof(cmsg)); |
Lines 114-120
Link Here
|
114 |
#endif |
114 |
#endif |
115 |
|
115 |
|
116 |
retry: |
116 |
retry: |
117 |
@@ -701,7 +719,7 @@ |
117 |
@@ -701,7 +719,7 @@ retry: |
118 |
goto failed; |
118 |
goto failed; |
119 |
} |
119 |
} |
120 |
#ifdef HAVE_CMSGCRED |
120 |
#ifdef HAVE_CMSGCRED |
Lines 123-129
Link Here
|
123 |
GAM_DEBUG(DEBUG_INFO, |
123 |
GAM_DEBUG(DEBUG_INFO, |
124 |
"Message from recvmsg() was not SCM_CREDS\n"); |
124 |
"Message from recvmsg() was not SCM_CREDS\n"); |
125 |
goto failed; |
125 |
goto failed; |
126 |
@@ -727,9 +745,10 @@ |
126 |
@@ -727,9 +745,10 @@ retry: |
127 |
goto failed; |
127 |
goto failed; |
128 |
} |
128 |
} |
129 |
#elif defined(HAVE_CMSGCRED) |
129 |
#elif defined(HAVE_CMSGCRED) |
Lines 137-143
Link Here
|
137 |
#else /* !SO_PEERCRED && !HAVE_CMSGCRED */ |
137 |
#else /* !SO_PEERCRED && !HAVE_CMSGCRED */ |
138 |
GAM_DEBUG(DEBUG_INFO, |
138 |
GAM_DEBUG(DEBUG_INFO, |
139 |
"Socket credentials not supported on this OS\n"); |
139 |
"Socket credentials not supported on this OS\n"); |
140 |
@@ -1288,14 +1307,17 @@ |
140 |
@@ -1288,14 +1307,17 @@ FAMNextEvent(FAMConnection * fc, FAMEven |
141 |
|
141 |
|
142 |
// FIXME: drop and reacquire lock while blocked? |
142 |
// FIXME: drop and reacquire lock while blocked? |
143 |
gamin_data_lock(conn); |
143 |
gamin_data_lock(conn); |