lkml.org 
[lkml]   [2007]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Including STRTOK_R in a LSM

--- "Z. Cliffe Schreuders" <c.schreuders@murdoch.edu.au> wrote:

> What I need is to ignore double delimiters such as (::). This can be
> done trivially with a string comparison to check for "\0". What I want
> to know is if it is ok to include the strtok_r code in my security
> module, or if strtok was removed for a very good reason. I am porting a
> lot of existing code which already uses strtok_r to a kernel security
> module.

All over the Linux world little red flags are popping up.

Text processing of the sort that requires token parsing is rare
in the kinds of things the kernel is usually called upon to do.
You did mention, and someone else demonstrated, that there are
existing alternatives that you could adopt. Cluttering the kernel
with duplicate functionality is strongly discouraged.

As far as porting existing code into the kernel goes, be sure to
have a look at the official coding style before you show what you've
done to anyone. If you're porting "a lot" of code (Use SELinux as a
benchmark for an LSM. If you're bigger than that you have "a lot"
of code) you may also be putting too much into the kernel. Some
application programmers use programming methods that are not suited
to the kernel environment, so be careful that what you're doing and
the way you're doing it are appropriate to the kernel.

Best of luck.



Casey Schaufler
casey@schaufler-ca.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-16 15:37    [W:0.036 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site