mcstrans: remove unused getpeercon_raw() call
PATCH 1/1 mcstrans: remove unused getpeercon_raw() call
There is a call to getpeercon_raw() in mcstransd, but nothing is done with the context. The purpose of process_request() is to translate a context and we would like that to succeed even if, for some reason, getpeercon_raw() fails.
--- mcstrans/src/mcstransd.c | 6 ------ 1 file changed, 6 deletions(-)
mcstrans/src/mcstransd.c +0 -6
@@ -142,13 +142,8 @@ process_request(int fd, uint32_t function, char *data1, char *UNUSED(data2)) {int32_t result;char *out =NULL ; -char *peercon =NULL ;int ret; - ret =getpeercon_raw (fd, &peercon); -if (ret <0 ) -return ret; -/* TODO: Check if MLS clearance (in peercon) dominates the MLS label * (in the request input). */
@@ -184,7 +179,6 @@ process_request(int fd, uint32_t function, char *data1, char *UNUSED(data2)) }free (out); -freecon (peercon);return ret; }
Signature · 1 line
2.19.0
Quoted 4 lines · Yuli Khodorkovskiy
There is a call to
getpeercon_raw()in mcstransd, but nothing is done with the context. The purpose ofprocess_request()is to translate a context and we would like that to succeed even if, for some reason,getpeercon_raw()fails.
If we are going to remove that, then shouldn't we also remove the TODO comment about performing a check using the peercon?
Quoted 34 lines
Signed-off-by Yuli Khodorkovskiy <[email protected]>Signed-off-by Joshua Brindle <[email protected]>--- mcstrans/src/mcstransd.c | 6 ------ 1 file changed, 6 deletions(-)mcstrans/src/mcstransd.c +0
-6@@ -142,13 +142,8 @@ process_request(int fd, uint32_t function, char *data1, char *UNUSED(data2)) {int32_t result;char *out =NULL ; -char *peercon =NULL ;int ret; - ret =getpeercon_raw (fd, &peercon); -if (ret <0 ) -return ret; -/* TODO: Check if MLS clearance (in peercon) dominates the MLS label * (in the request input). */ @@ -184,7 +179,6 @@ process_request(int fd, uint32_t function, char *data1, char *UNUSED(data2)) }free (out); -freecon (peercon);return ret; }
Yeah, good point. I’ll resend.
Quoted 39 lines · Stephen Smalley
Quoted 4 lines · Yuli Khodorkovskiy
There is a call to
getpeercon_raw()in mcstransd, but nothing is done with the context. The purpose ofprocess_request()is to translate a context and we would like that to succeed even if, for some reason,getpeercon_raw()fails.If we are going to remove that, then shouldn't we also remove the TODO comment about performing a check using the peercon?
Quoted 28 lines
Signed-off-by Yuli Khodorkovskiy <[email protected]>Signed-off-by Joshua Brindle <[email protected]>--- mcstrans/src/mcstransd.c | 6 ------ 1 file changed, 6 deletions(-)mcstrans/src/mcstransd.c +0
-5@@ -142,13 +142,8 @@ process_request(int fd, uint32_t function, char *data1, char *UNUSED(data2)) {int32_t result;char *out =NULL ; -char *peercon =NULL ;int ret; - ret =getpeercon_raw (fd, &peercon); -if (ret <0 ) -return ret; -/* TODO: Check if MLS clearance (in peercon) dominates the MLS label * (in the request input). */ @@ -184,7 +179,6 @@ process_request(int fd, uint32_t function, char *data1, char *UNUSED(data2)) }free (out); -freecon (peercon);return ret; }