Skip to contentSkip to conversation

libselinux -- Hide unnecessarily-exported library destructors

PATCH In review Laurent Bigonville 3 participants 4 messages Mar 26, 2012 – Mar 27, 2012 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libselinux -- Hide unnecessarily-exported library destructors

Hi,

Description: Hide unnecessarily-exported library destructors
This change was extracted from the old monolithic Debian patch. I have not been able to find an explanation for why it is needed, but it should be forwarded upstream for review.
.
Author: Unknown

---
Forwarded: no
Last-Update: 2011-10-13

libselinux/src/matchpathcon.c +1 -1
@@ -291,7 +291,7 @@ static void matchpathcon_thread_destruct
 	matchpathcon_fini();
 }
 
-void __attribute__((destructor)) matchpathcon_lib_destructor(void)
+void hidden __attribute__((destructor)) matchpathcon_lib_destructor(void)
 {
 	if (destructor_key_initialized)
 		__selinux_key_delete(destructor_key);
src/setrans_client.c +1 -1
@@ -253,7 +253,7 @@ static void setrans_thread_destructor(vo
 	free(prev_r2c_raw);
 }
 
-void __attribute__((destructor)) setrans_lib_destructor(void)
+void hidden __attribute__((destructor)) setrans_lib_destructor(void)
 {
 	if (destructor_key_initialized)
 		__selinux_key_delete(destructor_key);

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw

I'm not suggesting you take on this work but this is a general suggestion. Should we change the default visibility in the compile to hidden and just export the symbols we want. This way we don't forget to mark things hidden in the future?

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw

I thought we already had a general agreement to do so, at least that was my impression after the last time I raised a related issue on this list.

But as you say it needs to be done by someone.

Quoted 12 lines · David Quigley

I'm not suggesting you take on this work but this is a general suggestion. Should we change the default visibility in the compile to hidden and just export the symbols we want. This way we don't forget to

mark things hidden in the future?

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.

Signature · 7 lines
Sent from my Samsung Galaxy S Android phone with K-9 Mail.


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#3 lore raw
In reply to Laurent Bigonville
Quoted 6 lines · Laurent Bigonville

Description: Hide unnecessarily-exported library destructors
This change was extracted from the old monolithic Debian patch. I have
not been able to find an explanation for why it is needed, but it should be forwarded upstream for review.
.
Author: Unknown

This is needed because the Debian build system whinges when the list of exports changes. There was never a need to have them exported so it was best to just make them hidden.

I think I wrote the patch in question.

Quoted 31 lines

---
Forwarded: no
Last-Update: 2011-10-13

libselinux/src/matchpathcon.c +1 -1
@@ -291,7 +291,7 @@ static void matchpathcon_thread_destruct
 	matchpathcon_fini();
 }
 
-void __attribute__((destructor)) matchpathcon_lib_destructor(void)
+void hidden __attribute__((destructor)) matchpathcon_lib_destructor(void)
 {
 	if (destructor_key_initialized)
 		__selinux_key_delete(destructor_key);
src/setrans_client.c +1 -2
@@ -253,7 +253,7 @@ static void setrans_thread_destructor(vo
 	free(prev_r2c_raw);
 }
 
-void __attribute__((destructor)) setrans_lib_destructor(void)
+void hidden __attribute__((destructor)) setrans_lib_destructor(void)
 {
 	if (destructor_key_initialized)
 		__selinux_key_delete(destructor_key);
 
--

This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

Signature · 7 lines
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.