lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 16 Jul 2007 12:16:29 +0200 (CEST)
From:	Jan Engelhardt <jengelh@...putergmbh.de>
To:	"Z. Cliffe Schreuders" <c.schreuders@...doch.edu.au>
cc:	linux-kernel@...r.kernel.org
Subject: Re: Including STRTOK_R in a LSM


On Jul 16 2007 16:52, Z. Cliffe Schreuders wrote:
>
> I am aware strtok was removed from the kernel in 2002. However strtok_r is more
> desirable than strsep as I do not want to know about 'blank fields' (2
> consecutive delimiters). Is it acceptable to simply include the strtok_r code
> in my security module? or should I create a wrapper for strsep to ignore
> blanks?

12:16 ichi:/dev/shm > cat test.c 
#include <stdio.h>
#include <string.h>
int main(void)
{
        char x[] = "foo::bar";
        char *w = x;
        char *p;
        while ((p = strsep(&w, ":")) != NULL)
                printf("\"%s\"\n", p);
}
12:16 ichi:/dev/shm > ./a.out 
"foo"
""
"bar"


q.e.d.


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ