tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Common chmod and chown routines



Hello,

Elad Efrat <elad%NetBSD.org@localhost> wrote:
>
> ...
> 
> Diff attached, please review. :)
>       
> ...
>
> +common_chmod(kauth_cred_t cred, struct vnode *vp, uid_t cur_uid, gid_t 
> cur_gid,
> +    mode_t new_mode)
> +{
> +     int error;
> +
> +     /* Superuser can always change mode. */
> +     error = kauth_authorize_generic(cred, KAUTH_GENERIC_ISSUSER, NULL);
> +     if (!error) {
> +             goto out;
> +     }

Can this and other "goto out" calls (including common_chown() function) be
replaced with returns? There is no point to use them here.

Thanks.

-- 
Best regards,
Mindaugas


Home | Main Index | Thread Index | Old Index