All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] atuomatic type transitions for pts in devfs
@ 2002-07-10 15:14 Debian User
  2002-07-10 16:38 ` Stephen Smalley
  2002-07-12 16:24 ` Stephen Smalley
  0 siblings, 2 replies; 3+ messages in thread
From: Debian User @ 2002-07-10 15:14 UTC (permalink / raw)
  To: selinux

[-- 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;
 				}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-07-12 16:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-10 15:14 [PATCH] atuomatic type transitions for pts in devfs Debian User
2002-07-10 16:38 ` Stephen Smalley
2002-07-12 16:24 ` Stephen Smalley

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.