[LTP] [PATCH v5 1/2] cgroup_core01.c: Set system default umaks to 0

Li Wang liwang@redhat.com
Fri Mar 1 11:07:03 CET 2024


On Fri, Mar 1, 2024 at 4:43 PM Petr Vorel <pvorel@suse.cz> wrote:

> Hi Li,
>
> > Hi Wei, Petr,
>
> > Seems the problem Wei met is the default umask of 0077,
> > any new files or directories that are created will have their
> > permission bits modified by this umask.
>
> > After looking though what you both discussed, I think maybe
> > another better choice is to set the umask to '0000' temporarily
> > before creating the directory, and then restoring the previous
> > umask right after.
>
> > All these operations are just put into cgroup_dir_mk function.
>
> LGTM this approach, please send a patch.
>

Ok, sure.


> > +       mode_t old_umask = umask(0000);
> nit: umask(0) is the same right?
>

exactly.


-- 
Regards,
Li Wang


More information about the ltp mailing list