jail.chflags_allowed

Michal Belczyk belczyk at bsd.krakow.pl
Sat Jul 23 10:15:18 PDT 2005


On Sat, Jul 23, 2005 at 06:58:36PM +0200, Deyan Dyankov wrote:
> @@ -2134,6 +2135,13 @@
>  		return (error);
>  
>  	/*
> +	 * If we are inside a jail and jail.chflags_allowed=0
> +	 * return "Operation not permitted"
> +	 */
> +	if (!jail_chflags_allowed && p->p_ucred->cr_prison)
> +		return (EPERM);	
> +
> +	/*
>  	 * note: vget is required for any operation that might mod the vnode
>  	 * so VINACTIVE is properly cleared.
>  	 */

Please use the jailed() inline from /sys/sys/jail.h, it does exactly the
same check:

+       if (!jail_chflags_allowed && jailed(p->p_ucred))
+               return (EPERM);


-- 
Michal Belczyk





More information about the Submit mailing list