Re: http(1) An alternate implementation for a subset of ftp(1)

2015-08-17 Thread Sebastien Marie
be 'a_filename' what ever the redirection is. Else, a evil server could arbitrary choose the filename (in the current directory), and as file creation is done with O_TRUNC (or O_APPEND in resume case), an evil server could override the file he wants. Regards. -- Sebastien Marie

swapctl: use fork+exec instead of system

2015-08-13 Thread Sebastien Marie
Hi, The following patch change the system(3) call in swapctl(8) to vfork(2)+exec(2). swapctl use it for invoking mount_nfs(8) when fstab contains option for swapping to NFS files. Comments ? OK ? -- Sebastien Marie Index: swapctl.c

Re: swapctl: use fork+exec instead of system

2015-08-13 Thread Sebastien Marie
On Thu, Aug 13, 2015 at 09:00:34AM -0600, Todd C. Miller wrote: On Thu, 13 Aug 2015 13:59:37 +0200, Sebastien Marie wrote: The following patch change the system(3) call in swapctl(8) to vfork(2)+exec(2). swapctl use it for invoking mount_nfs(8) when fstab contains option for swapping

ikectl: ikeca.c cleanup: err/errx usage

2015-08-12 Thread Sebastien Marie
Hi, Here a patch that corrects three err() to errx() calls. - a if condition don't set errno - strlcpy(3) don't set errno (no mention is man page) - ca_readpass() already manage errno error message with warn(3) Comments ? OKs ? -- Sebastien Marie Index: ikeca.c

ikectl: ikeca.c cleanup: invalid 644 mode

2015-08-12 Thread Sebastien Marie
Hi, The following patch corrects an invalid 644 mode to 0644. fcopy() set the mode using open(3). The previous mode requested was 1610 (644 in octal), but the value is modified by umask value. This file is the zip exported archive. -- Sebastien Marie Index: ikeca.c

Re: ikectl: ikeca.c cleanup: invalid 644 mode

2015-08-12 Thread Sebastien Marie
On Wed, Aug 12, 2015 at 09:17:35AM +0200, Sebastien Marie wrote: The previous mode requested was 1610 (644 in octal), but the value is modified by umask value. I need base 8 revision... it was 1204. -- Sebastien Marie

Re: Possible memory leak in sys/dev/ic/ti.c (was: Re: Brainy: User-Triggerable Kernel Memory Leak in execve())

2015-08-09 Thread Sebastien Marie
as it was just allocated with pool_get(9) (via MCLGETI or MGETHDR). m_freem() will return it with pool_put(9). I also keep to comments spelling correction. Comments or post-lock OK ? -- Sebastien Marie Index: dev/ic/ti.c === RCS file

ikectl: ikeca.c: ca_export() improvements

2015-07-30 Thread Sebastien Marie
) by xsnprintf()... - convert system(3) to vfork(2)/execv(2) The reason of the use of vfork(2) instead of fork(2) is that I follow how system(3) is implemented (with vfork the parent is suspended until the child makes a call to execve(2) or an exit). Comments ? OK ? -- Sebastien Marie Index

Re: ikectl: quote passwords passed to the shell

2015-07-24 Thread Sebastien Marie
@@ ca_revoke(struct ca *ca, char *keyname) snprintf(cmd, sizeof(cmd), env CADB='%s/index.txt' %s ca %s-config %s -keyfile %s/private/ca.key --key %s +-key '%s' -gencrl -cert %s/ca.crt -md sha1 -- Sebastien Marie

[patch v2] xlocale part 6: Switch _ctype_ from global variable to per-thread function

2015-07-14 Thread Sebastien Marie
On Sun, Jul 12, 2015 at 03:56:21PM +0200, Sebastien Marie wrote: _ctype_ is used in ctype.h header in order to define inline functions for determining character class: isalnum(3), isalpha(3), ... The character class comes from lc_ctype. Switch _ctype_ from global variable to function

[patch v2] xlocale part 12: add xlocale functions

2015-07-14 Thread Sebastien Marie
On Sun, Jul 12, 2015 at 05:51:13PM +0200, Sebastien Marie wrote: The patch add the following functions: - newlocale(3) - duplocale(3) - freelocale(3) - uselocale(3) Documentation is missing for now. A separate patch will be provided. Updated patch: - add stubs for xlocale

[patch v2] xlocale part 5: Switch __mb_cur_max from global variable to per-thread function

2015-07-14 Thread Sebastien Marie
On Sun, Jul 12, 2015 at 03:51:14PM +0200, Sebastien Marie wrote: ctype.h header define MB_CUR_MAX macro to be the maximum number of bytes in a character specified by the current locale (category LC_CTYPE). Switch the implementation from global variable to function, in order to get the value

Re: [patch] xlocale part 7: Switch _toupper_tab_ from global variable to per-thread function

2015-07-13 Thread Sebastien Marie
() implementation will need _toupper_tab(locale_t). Regards. -- Sebastien Marie

[patch] xlocale part 8: Switch _tolower_tab_ from global variable to per-thread function

2015-07-12 Thread Sebastien Marie
Same as before, but for _tolower_tab_ As _tolower_tab_ was the last initialized variable from __install_currentrunelocale_ctype(), remove the now empty function. -- Sebastien Marie Index: b/include/ctype.h === --- a/include

[patch] xlocale part 7: Switch _toupper_tab_ from global variable to per-thread function

2015-07-12 Thread Sebastien Marie
Same as previous, but for _toupper_tab_. -- Sebastien Marie Index: b/include/ctype.h === --- a/include/ctype.h 2015-06-30 12:19:07.342557440 +0200 +++ b/include/ctype.h 2015-06-30 12:19:31.892786432 +0200 @@ -55,7 +55,7

[patch] xlocale part 9: move others _Current*Locale variables to locale_t

2015-07-12 Thread Sebastien Marie
that will be addressed in following patch. -- Sebastien Marie Index: b/lib/libc/locale/_def_messages.c === --- a/lib/libc/locale/_def_messages.c 2015-07-08 11:38:48.371645285 +0200 +++ b/lib/libc/locale/_def_messages.c 2015-07-08 11:56

[patch] xlocale part 6: Switch _ctype_ from global variable to per-thread function

2015-07-12 Thread Sebastien Marie
). -- Sebastien Marie Index: b/include/ctype.h === --- a/include/ctype.h 2015-07-05 06:50:41.963279015 +0200 +++ b/include/ctype.h 2015-07-05 06:52:28.894297063 +0200 @@ -53,7 +53,7 @@ __BEGIN_DECLS -extern const char *_ctype_

[patch] xlocale part 5: Switch __mb_cur_max from global variable to per-thread function

2015-07-12 Thread Sebastien Marie
ctype.h header define MB_CUR_MAX macro to be the maximum number of bytes in a character specified by the current locale (category LC_CTYPE). Switch the implementation from global variable to function, in order to get the value from the current locale state (global or per-thread). -- Sebastien

[patch] xlocale part 11: make loadlocale() from setlocale.c reusable

2015-07-12 Thread Sebastien Marie
Change the loadlocale() prototype to be callable with specified locale_t parameter. It will permit to reuse the code path for uselocale(3). The current usage (with setlocale(3)) will just pass the global locale state to function call. -- Sebastien Marie Index: b/lib/libc/locale/setlocale.c

[patch] xlocale part 10: localeconv(3)

2015-07-12 Thread Sebastien Marie
them (as for __mlocale_changed and __nlocale_changed before). -- Sebastien Marie Index: b/lib/libc/locale/localeconv.c === --- a/lib/libc/locale/localeconv.c 2015-07-08 11:56:51.883919979 +0200 +++ b/lib/libc/locale

Re: tcpdump -A: really printable characters

2015-07-12 Thread Sebastien Marie
On Sun, Jul 12, 2015 at 01:53:54PM +0200, Christian Weisgerber wrote: Sebastien Marie: --- tcpdump.c 18 Apr 2015 18:28:38 - 1.70 +++ tcpdump.c 11 Jul 2015 20:35:11 - @@ -603,8 +603,10 @@ default_print_ascii(const u_char *cp, un printf(\n); for (i = 0; i

[patch] xlocale part 12: add xlocale functions

2015-07-12 Thread Sebastien Marie
() the locale state is enought. -- Sebastien Marie Index: b/include/locale.h === --- a/include/locale.h 2015-07-12 16:18:14.994338422 +0200 +++ b/include/locale.h 2015-07-12 16:21:38.775929858 +0200 @@ -95,6 +95,20 @@ extern struct

Re: tcpdump -A: really printable characters

2015-07-11 Thread Sebastien Marie
previously printed char on line ? $ echo 'bad thing\rgood thing' good thing + putchar(c); + else + putchar('.'); } } -- Sebastien Marie

Re: [patch] xlocale part 3: move _CurrentRuneLocale to locale_t (ctype)

2015-07-10 Thread Sebastien Marie
retrieve their values from the current locale. Thanks for you reviewing. -- Sebastien Marie

[patch] xlocale part 4: make localetable_head thread-safe

2015-07-09 Thread Sebastien Marie
in front of list), if it isn't already in the list. In order to prevent race that would result adding multiple times the same runelocale in the list (by multiple threads) I use a mutex in _newrunelocale() to protect all the adding code path. -- Sebastien Marie Index: b/lib/libc/locale

[patch] xlocale part 2: move current_categories from setlocale.c to locale_t

2015-07-08 Thread Sebastien Marie
state locale, as setlocale(1) function only operate on global state. Later patches will change slightly that to reuse code for creating new locale state. -- Sebastien Marie Index: b/lib/libc/locale/setlocale.c === --- a/lib/libc

[patch] xlocale part 3: move _CurrentRuneLocale to locale_t (ctype)

2015-07-08 Thread Sebastien Marie
) and co. - pass LC_GLOBAL_LOCALE to configure ctype with setlocale(3). Please note this patch is the bigger of the serie, as it combines removing the global _CurrentRuneLocale variable with use a dynamic locale state (_current_locale()). If need, I could split it. -- Sebastien Marie Index: b/lib/libc

[patch] xlocale part 1: minimal locale_t support

2015-07-08 Thread Sebastien Marie
. - _set_current_locale() is used to change the current state: restore global state in thread or change the per-thread state. Thanks for your comments. -- Sebastien Marie Index: b/lib/libc/locale/Makefile.inc === --- a/lib/libc

Re: [patch] unsync between ctype and wctype

2015-07-07 Thread Sebastien Marie
On Tue, Jul 07, 2015 at 10:37:34AM +0200, Stefan Sperling wrote: On Tue, Jul 07, 2015 at 09:25:30AM +0200, Sebastien Marie wrote: Hi, _C_ctype_ (ctype) and _DefaultRuneLocale.rl_runetype (wctype) are currently unsynced, resulting regress/lib/libc/locale/check_isw to failed. Yes

[patch] unsync between ctype and wctype

2015-07-07 Thread Sebastien Marie
: all have this construct (array of 256, initialisation with 128 elements). I also do several tests with MALLOC_OPTIONS and differents sizes of array, and all remainings elements are 0. Comments ? OK ? -- Sebastien Marie Index: locale/runetable.c

regress locale/check_isw

2015-07-07 Thread Sebastien Marie
Hi, While working on regress test for locale, I saw check_isw regress test have same message for isgraph/islower ('6'). Discriminate the both, and renumerate tests. Comments ? OK ? Please note the regress test is currently failing. I hope to fix it soon. -- Sebastien Marie Index

[patch] libc/locale Makefile.inc cleanup

2015-07-03 Thread Sebastien Marie
Hi, There are no ${LIBCSRCDIR}/arch/${MACHINE_CPU}/locale directories in cvs. Remove the unused search path from Makefile. OK ? Comments ? -- Sebastien Marie Index: locale/Makefile.inc === RCS file: /cvs/src/lib/libc/locale

Re: patch: libc/locale/setlocale.c new_categories variable (3 and last)

2015-07-02 Thread Sebastien Marie
to edit by hand the diff... Thanks for the review ! -- Sebastien Marie

Re: [Patch] New item to the Migrating to OpenBSD guide

2015-06-28 Thread Sebastien Marie
). As it is for -stable, it includes errata. - standard packages. As it is for -stable, it includes security updates for packages. Thanks. -- Sebastien Marie

Re: patterns: unused header and doubled % sign

2015-06-26 Thread Sebastien Marie
! -- Sebastien Marie

Re: Should the patterns(7) manual use C-style indexing of strings?

2015-06-26 Thread Sebastien Marie
. +there will be two captures: 2 and 4. .Sh SEE ALSO .Xr fnmatch 3 , .Xr re_format 7 , Committed, thanks. -- Sebastien Marie

Re: httpd rewrites with Lua's pattern matching

2015-06-23 Thread Sebastien Marie
() before expansion. if (strstr(val, $DOCUMENT_URI) != NULL) { if ((path = url_encode(desc-http_path)) == NULL) return (NULL); -- Sebastien Marie

[patch] httpd: escape matched substring

2015-06-23 Thread Sebastien Marie
On Tue, Jun 23, 2015 at 04:54:22PM +0200, Sebastien Marie wrote: the matched substrings should be escaped with url_encoded() before expansion. Here the patch to address the escaping problem. OK? -- Sebastien Marie Index: server_http.c

Re: roadmap for libc/locale

2015-06-13 Thread Sebastien Marie
On Sat, Jun 13, 2015 at 10:41:42PM +0200, Joerg Sonnenberger wrote: On Sat, Jun 13, 2015 at 10:04:55AM +0200, Sébastien Marie wrote: What is the relationship with libc/locale ? libc++ needs some POSIX functions in locale area that are missing in OpenBSD. These functions are uselocale(3),

Re: [patch] file(1) determine file type of stdin

2015-05-29 Thread Sebastien Marie
to do that. So I think we should only allow FIFOs for stdin where people presumably know what they're doing, not generally: that makes sens. your diff (the corrected one) is ok. thanks. -- Sebastien Marie On Fri, May 29, 2015 at 11:35:01PM +0100, Nicholas Marriott wrote: Oops

<    1   2   3   4