On Fri 27-05-11 14:29:45, Jan Safranek wrote:
> On 05/20/2011 04:31 PM, Michal Hocko wrote:
[...]
> > index 61f18a0..ebad462 100644
> > --- a/include/libcgroup/groups.h
> > +++ b/include/libcgroup/groups.h
> > @@ -536,6 +536,28 @@ int cg_chmod_recursive(struct cgroup *cgroup, mode_t 
> > dir_mode,
> >     int dirm_change, mode_t file_mode, int filem_change);
> >  
> >  /**
> > + * Change permission of files and directories of given group and uses
> > + * owner permissions as a mask for group and others permissions
> > + * @param cgroup The cgroup which permissions should be changed
> > + * @param dir_mode The permission mode of group directory
> > + * @param dirm_change Denotes whether the directory change should be done
> > + * @param file_mode The permission mode of group files
> > + * @param filem_change Denotes whether the directory change should be done
> > + */
> > +int cg_owner_mask_chmod_recursive(struct cgroup *cgroup, mode_t dir_mode,
> > +       int dirm_change, mode_t file_mode, int filem_change);
> 
> Now that cgroup_create_cgroup can set file/directory permissions when
> creating a group, I think it's better to add new public function
> cgroup_set_permissions() to set fields in struct cgroup and let
> cgroup_create_cgroup() to actually set them on filesystem - just like we
> do with cgroup_set_uid_gid(). I have already got bitten enough by
> specific functions like cg_chmod_recursive.

Makes sense.

> 
> > +
> > +/** Changes permissions for given path. If owner_is_umask is specified
> > + * then it uses owner permissions as a mask for group and others 
> > permissions.
> > + *
> > + * @param path Patch to chmod.
> > + * @param mode File permissions to set.
> > + * @param owner_is_umask Flag whether path owner permissions should be used
> > + * as a mask for group and others permissions.
> > + */
> > +int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
> 
> This function is not published in libcgroup.map and we do not have
> external user of it, please put it to libcgroup-internal.h

OK.

Thanks!
-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to