Re: [PATCH] securityfs

From: Greg KH
Date: Thu Jul 07 2005 - 12:54:08 EST


On Thu, Jul 07, 2005 at 12:30:35PM -0500, serge@xxxxxxxxxx wrote:
> Quoting Greg KH (greg@xxxxxxxxx):
> > On Wed, Jul 06, 2005 at 05:08:35PM -0500, serue@xxxxxxxxxx wrote:
> > > Quoting Greg KH (greg@xxxxxxxxx):
> > > > think it could be made even smaller if you use the default read and
> > > > write file type functions in libfs (look at the debugfs wrappers of them
> > > > for u8, u16, etc, for examples of how to use them.)
> > >
> > > The attached patch cleans up the securelevel code for the seclvl file.
> > > Is this a reasonable way to go about this?
> >
> > No.
> >
> > > Or is there a better way to do this?
> >
> > Look at how debugfs uses the libfs code. We should not need to add
> > these handlers to securityfs.
>
> Unfortunately the simple_attr code from libfs really doesn't seem to be
> usable for int args.

Why not? You want a negative number? Just cast the u64 to a signed int
then. Will that not work? If not we can tweak the libfs interface to
work properly for you.

> However the below patch follows some of the
> examples in debugfs and comes out cleaner than my original patch.

That is nicer. But I think you can get it smaller with the libfs stuff
:)

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/