PERFORCE change 42884 for review
Chris Vance
cvance at FreeBSD.org
Fri Nov 21 12:01:57 GMT 2003
http://perforce.freebsd.org/chv.cgi?CH=42884
Change 42884 by cvance at cvance_osx_laptop on 2003/11/21 04:01:04
Add back code to label newly created files using extattrs
Affected files ...
.. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_mac.c#31 edit
.. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/sebsd.c#16 edit
Differences ...
==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_mac.c#31 (text+ko) ====
@@ -1484,7 +1484,6 @@
&vp->v_label);
}
-#if 0
int
mac_create_vnode_extattr(struct ucred *cred, struct mount *mp,
struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
@@ -1520,7 +1519,6 @@
return (error);
}
-#endif
static int
mac_setlabel_vnode_extattr(struct ucred *cred, struct vnode *vp,
==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/sebsd.c#16 (text+ko) ====
@@ -919,7 +919,6 @@
#endif
}
-#ifdef HAS_EXTATTRS
static int
sebsd_create_vnode_extattr(struct ucred *cred, struct mount *mp,
struct label *fslabel, struct vnode *parent, struct label *parentlabel,
@@ -933,6 +932,7 @@
int error;
int tclass;
+ printf("sebsd_create_vnode_extattr called\n");
task = SLOT(&cred->cr_label);
dir = SLOT(parentlabel);
vsec = SLOT(childlabel);
@@ -956,12 +956,11 @@
error = vn_extattr_set(child, IO_NODELOCKED,
SEBSD_MAC_EXTATTR_NAMESPACE,
SEBSD_MAC_EXTATTR_NAME,
- context_len, context, curthread);
+ context_len, context, current_proc());
security_free_context(context);
return (error);
}
-#endif
#ifdef CAPABILITIES
static int
@@ -2184,10 +2183,10 @@
/* Create Labels */
.mpo_create_cred = sebsd_create_cred,
+ .mpo_create_devfs_device = sebsd_create_devfs_device,
.mpo_create_proc0 = sebsd_create_proc0,
.mpo_create_proc1 = sebsd_create_proc1,
-
- .mpo_create_devfs_device = sebsd_create_devfs_device,
+ .mpo_create_vnode_extattr = sebsd_create_vnode_extattr,
.mpo_associate_vnode_singlelabel = sebsd_associate_vnode_singlelabel,
.mpo_associate_vnode_extattr = sebsd_associate_vnode_extattr,
@@ -2357,9 +2356,6 @@
.mpo_create_root_mount = sebsd_create_root_mount,
/* .mpo_create_socket = sebsd_create_socket, */
/* .mpo_create_socket_from_socket = sebsd_create_socket_from_socket, */
-#ifdef HAS_EXTATTRS
- .mpo_create_vnode_extattr = sebsd_create_vnode_extattr,
-#endif
#ifdef HAS_DEVFS_DIRENT
.mpo_associate_vnode_devfs = sebsd_associate_vnode_devfs,
#endif
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list