newrole patch
Only uses file descriptor = 0
Reads securetty_context file for matches
newrole/newrole.c +10 -0
@@ -741,6 +741,7 @@char *level_s =NULL ;/* level spec'd by user in argv[] */ char *range_ptr =NULL ;security_context_t new_con =NULL ; +security_context_t tty_con =NULL ;context_t context =NULL ;/* manipulatable form of new_context */ const struct option long_options[] = { {"role" ,1 ,0 ,'r' },
@@ -793,6 +794,15 @@ "specified\n"));return -1 ; } +if (fgetfilecon (0 ,&tty_con) >=0 ) { +if (selinux_check_securetty_context (tty_con) !=1 ) { +fprintf (stderr,"Error: you are not allowed to change levels on a non secure terminal\n" ); +freecon (tty_con); +return -1 ; + } +freecon (tty_con); + } + level_s = optarg;break ;default :
Quoted 3 lines · Daniel J Walsh
Only uses file descriptor = 0
Reads
securetty_contextfile for matches
Corrected version (to match the return value convention) merged in policycoreutils 1.33.12.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.