Deleted Added
full compact
26c26
< * $FreeBSD: head/sys/kern/kern_exec.c 106459 2002-11-05 14:57:49Z rwatson $
---
> * $FreeBSD: head/sys/kern/kern_exec.c 106468 2002-11-05 17:51:56Z rwatson $
80c80
< char **envv);
---
> char **envv, struct mac *mac_p);
147c147
< kern_execve(td, fname, argv, envv)
---
> kern_execve(td, fname, argv, envv, mac_p)
151a152
> struct mac *mac_p;
171c172,174
< int will_transition;
---
> struct label interplabel; /* label of the interpreted vnode */
> struct label execlabel; /* optional label argument */
> int will_transition, interplabelvalid = 0;
207a211
> imgp->execlabel = NULL;
221a226,233
> #ifdef MAC
> error = mac_execve_enter(imgp, mac_p, &execlabel);
> if (error) {
> mtx_lock(&Giant);
> goto exec_fail;
> }
> #endif
>
327a340,344
> #ifdef MAC
> mac_init_vnode_label(&interplabel);
> mac_copy_vnode_label(&ndp->ni_vp->v_label, &interplabel);
> interplabelvalid = 1;
> #endif
434a452,454
> *
> * XXXMAC: For the time being, use NOSUID to also prohibit
> * transitions on the file system.
443c463,464
< will_transition = mac_execve_will_transition(oldcred, imgp->vp);
---
> will_transition = mac_execve_will_transition(oldcred, imgp->vp,
> interplabelvalid ? &interplabel : NULL, imgp);
489,490c510,513
< if (will_transition)
< mac_execve_transition(oldcred, newcred, imgp->vp);
---
> if (will_transition) {
> mac_execve_transition(oldcred, newcred, imgp->vp,
> interplabelvalid ? &interplabel : NULL, imgp);
> }
630a654,658
> #ifdef MAC
> mac_execve_exit(imgp);
> if (interplabelvalid)
> mac_destroy_vnode_label(&interplabel);
> #endif
635a664,668
> #ifdef MAC
> mac_execve_exit(imgp);
> if (interplabelvalid)
> mac_destroy_vnode_label(&interplabel);
> #endif
661c694,698
< return (kern_execve(td, uap->fname, uap->argv, uap->envv));
---
> #ifdef MAC
> return (kern_execve(td, uap->fname, uap->argv, uap->envv, NULL));
> #else
> return (ENOSYS);
> #endif
663a701,712
> #ifndef _SYS_SYSPROTO_H_
> struct __mac_execve_args {
> char *fname;
> char **argv;
> char **envv;
> struct mac *mac_p;
> };
> #endif
>
> /*
> * MPSAFE
> */
664a714,728
> __mac_execve(td, uap)
> struct thread *td;
> struct __mac_execve_args /* {
> syscallarg(char *) fname;
> syscallarg(char **) argv;
> syscallarg(char **) envv;
> syscallarg(struct mac *) mac_p;
> } */ *uap;
> {
>
> return (kern_execve(td, uap->fname, uap->argv, uap->envv,
> uap->mac_p));
> }
>
> int
1025c1089
< error = mac_check_vnode_exec(td->td_ucred, imgp->vp);
---
> error = mac_check_vnode_exec(td->td_ucred, imgp->vp, imgp);