All of lore.kernel.org
 help / color / mirror / Atom feed
From: Debian User <rogelio@evoworks.evoserve.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH] atuomatic type transitions for pts in devfs
Date: Wed, 10 Jul 2002 23:14:14 +0800	[thread overview]
Message-ID: <3D2C4F46.1040408@evoworks.evoserve.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 124 bytes --]

This patch only works properly with a devfsd less system. Devfsd needs 
to be patched for this to work on systems using it.

[-- Attachment #2: automatic_transition_in_devfs.diff --]
[-- Type: text/plain, Size: 1176 bytes --]

--- /root/tmp/lsm-2.4/security/selinux/hooks.c	Wed Jul 10 01:11:11 2002
+++ security/selinux/hooks.c	Wed Jul 10 03:45:14 2002
@@ -689,7 +689,7 @@
 {
 	struct superblock_security_struct *sbsec = NULL; 
 	struct inode_security_struct *isec = inode->i_security;
-	security_id_t sid;
+	security_id_t sid, devfs_pts_sid;
 	char *buffer, *path;
 	struct dentry *dentry;
 	int rc;
@@ -779,10 +779,21 @@
 				path = avc_d_path(dentry, buffer,
 						  PAGE_SIZE);
 				if (path) {
+
+                            if ( (!memcmp(inode->i_sb->s_type->name, "devfs", 5)) && (!memcmp(path, "/pts/", 5)) ) {
+                                security_genfs_sid("devfs", "/pts", SECCLASS_DIR, &devfs_pts_sid);
+		                /* Try to obtain a transition SID. */
+		                rc = security_transition_sid(isec->task_sid, 
+                                                             devfs_pts_sid, 
+					                     isec->sclass,
+					                     &sid);
+
+                            } else {
 					rc = security_genfs_sid(inode->i_sb->s_type->name,
 								path, 
 								isec->sclass,
 								&sid);
+			    }
 					if (!rc)
 						isec->sid = sid;
 				}

             reply	other threads:[~2002-07-10 15:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-10 15:14 Debian User [this message]
2002-07-10 16:38 ` [PATCH] atuomatic type transitions for pts in devfs Stephen Smalley
2002-07-12 16:24 ` Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D2C4F46.1040408@evoworks.evoserve.com \
    --to=rogelio@evoworks.evoserve.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.