Author: rwatson
Date: Tue Mar  2 15:05:48 2010
New Revision: 204581
URL: http://svn.freebsd.org/changeset/base/204581

Log:
  Update device-labeling logic for Biba, LOMAC, and MLS to recognize new-style
  pts devices when various policy ptys_equal flags are enabled.
  
  Submitted by: Estella Mystagic <estella at mystagic.com>
  MFC after:    1 week

Modified:
  head/sys/security/mac_biba/mac_biba.c
  head/sys/security/mac_lomac/mac_lomac.c
  head/sys/security/mac_mls/mac_mls.c

Modified: head/sys/security/mac_biba/mac_biba.c
==============================================================================
--- head/sys/security/mac_biba/mac_biba.c       Tue Mar  2 13:13:12 2010        
(r204580)
+++ head/sys/security/mac_biba/mac_biba.c       Tue Mar  2 15:05:48 2010        
(r204581)
@@ -955,6 +955,7 @@ biba_devfs_create_device(struct ucred *c
                biba_type = MAC_BIBA_TYPE_EQUAL;
        else if (ptys_equal &&
            (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 ||
+           strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 ||
            strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0))
                biba_type = MAC_BIBA_TYPE_EQUAL;
        else

Modified: head/sys/security/mac_lomac/mac_lomac.c
==============================================================================
--- head/sys/security/mac_lomac/mac_lomac.c     Tue Mar  2 13:13:12 2010        
(r204580)
+++ head/sys/security/mac_lomac/mac_lomac.c     Tue Mar  2 15:05:48 2010        
(r204581)
@@ -1043,6 +1043,7 @@ lomac_devfs_create_device(struct ucred *
                lomac_type = MAC_LOMAC_TYPE_EQUAL;
        else if (ptys_equal &&
            (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 ||
+           strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 ||
            strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0))
                lomac_type = MAC_LOMAC_TYPE_EQUAL;
        else

Modified: head/sys/security/mac_mls/mac_mls.c
==============================================================================
--- head/sys/security/mac_mls/mac_mls.c Tue Mar  2 13:13:12 2010        
(r204580)
+++ head/sys/security/mac_mls/mac_mls.c Tue Mar  2 15:05:48 2010        
(r204581)
@@ -918,6 +918,7 @@ mls_devfs_create_device(struct ucred *cr
                mls_type = MAC_MLS_TYPE_HIGH;
        else if (ptys_equal &&
            (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 ||
+           strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 ||
            strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0))
                mls_type = MAC_MLS_TYPE_EQUAL;
        else
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to