patch: catopen(3), locale setting and getenv

2015-06-12 Thread Sébastien Marie
tion non autorisée If this change is desirable, I will propose patchs for programs in base in order to call setlocale(LC_ALL, "") at program initilisation. Comments, ideas ? -- Sébastien Marie Index: nls/catopen.c === RCS file: /c

Re: patch: catopen(3), locale setting and getenv

2015-06-12 Thread Sébastien Marie
On Fri, Jun 12, 2015 at 10:35:02AM +0200, Stefan Sperling wrote: > On Fri, Jun 12, 2015 at 08:59:14AM +0200, Sébastien Marie wrote: > > If this change is desirable, I will propose patchs for programs in base > > in order to call setlocale(LC_ALL, "") at program in

patch: libc/locale/setlocale.c new_categories variable (2)

2015-06-12 Thread Sébastien Marie
name (locname), and used it in loadlocate() body for: - check if the wanted value is already set - effectively load the locale (load_locale_sub call) - effectively assign the value in current_categories -- Sébastien Marie Index: locale/setlocale.c

patch: libc/locale/setlocale.c new_categories variable (1)

2015-06-12 Thread Sébastien Marie
called only at one place in loadlocale(): if (!load_locale_sub(category, new_categories[category])) { The second argument (locname) of load_locale_sub() is always defined with new_categories[category]. So we could replace new_categories[category] by locname in function body. -- Sébastien

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

2015-06-12 Thread Sébastien Marie
assed from global to local variable of setlocale(). -- Sébastien Marie Index: locale/setlocale.c === RCS file: /cvs/src/lib/libc/locale/setlocale.c,v retrieving revision 1.21 diff -u -p -r1.21 setlocale.c --- locale/setlocale.c

roadmap for libc/locale

2015-06-13 Thread Sébastien Marie
ostly the code of isalnum(). I hope my explanation is understandable enough. Thanks. -- Sébastien Marie

[patch] nm segfault

2015-06-17 Thread Sébastien Marie
aft object-file to generate out-of-bound read). Maybe a check for overflow would be needed too ? -- Sébastien Marie Index: elf.c === RCS file: /cvs/src/usr.bin/nm/elf.c,v retrieving revision 1.28 diff -u -p -r1.28 elf.c --- el

Re: [patch] nm segfault

2015-06-17 Thread Sébastien Marie
On Wed, Jun 17, 2015 at 02:43:41PM +0200, Sébastien Marie wrote: > Hi, > > I would like to report a SEGFAULT in nm(1) that occurs with object-file > with no section headers (e_shnum = 0). > > > Index: elf.c >

[patch] nm: read after bound

2015-06-17 Thread Sébastien Marie
Hi, This patch corrects a read after bound that occurs in strcmp (line just after the added bound check). Found with afl. -- Sébastien Marie Index: elf.c === RCS file: /cvs/src/usr.bin/nm/elf.c,v retrieving revision 1.28 diff -u

[patch] nm: minimal section header size

2015-06-18 Thread Sébastien Marie
ed as Elf_Shdr[] (array of Elf_Shdr: which is a fixed element size). While here, inverts calloc() arguments to be calloc(nmemb, size), according to fread() call after. This problem was found with afl, when e_shentsize was 1. -- Sébastien Marie Index: b/usr.bin/nm/

[patch] nm: on error, set globals to NULL

2015-06-18 Thread Sébastien Marie
Hi, This patch ensure that when an error is detected, the freed variables in elf_symloadx() are reinitialised. Else show_file() in nm.c will used these variables, even if they has just been freed. (nm.c +689). Problem found by afl. -- Sébastien Marie Index: elf.c

[patch] nm: some code cleanup

2015-06-18 Thread Sébastien Marie
this direction for now. - change some if(x) free(x) idioms to free(x) -- Sébastien Marie Index: elf.c === RCS file: /cvs/src/usr.bin/nm/elf.c,v retrieving revision 1.28 diff -u -p -r1.28 elf.c --- elf.c 17 May 2015 20:

PATCH: ftp: allow @ in username for Basic Auth

2014-06-23 Thread Sébastien Marie
is a valid character in user-id or password: user-pass = userid ":" password userid = * password= *TEXT Here a patch to search the last '@' in the string (which don't contains the path at thi

Re: PATCH: ftp: allow @ in username for Basic Auth

2014-06-24 Thread Sébastien Marie
d not contains '@' char, and user/pass may contains it, (as defined by rfc1738), this patch make ftp(1) to more respect standard. Thanks. -- Sébastien Marie On Mon, Jun 23, 2014 at 10:15:25AM +0200, Sébastien Marie wrote: > Hi, > > Using ftp(1) with HTTP(S) scheme and B

Re: PATCH: ftp: allow @ in username for Basic Auth

2014-06-25 Thread Sébastien Marie
On Tue, Jun 24, 2014 at 10:55:44AM -0700, Philip Guenther wrote: > On Tue, Jun 24, 2014 at 9:01 AM, Sébastien Marie < > semarie-open...@latrappe.fr> wrote: > > > As I see not activity or feedback for this one line patch, I think it > > need more explain ? > > &

Re: PATCH: ftp: allow @ in username for Basic Auth

2014-06-25 Thread Sébastien Marie
On Wed, Jun 25, 2014 at 07:07:30PM -0700, Philip Guenther wrote: > On Wed, 25 Jun 2014, S?bastien Marie wrote: > > On Tue, Jun 24, 2014 at 10:55:44AM -0700, Philip Guenther wrote: > > > On Tue, Jun 24, 2014 at 9:01 AM, S?bastien Marie < > > > semarie-open...@latrappe.fr> wrote: > ... > > So, I thin

Re: PATCH: ftp: allow @ in username for Basic Auth

2014-07-01 Thread Sébastien Marie
rlier version of my diff, > which had problems with some proxy setting, IIRC. Here's the diff that I > settled on after testing. > It works also for my use-case. Please note I haven't tested proxy setting (by lake of server to test). Thanks for your help. -- Sébastien Marie

man.cgi: clean exit when absent or empty manpath.conf

2014-07-17 Thread Sébastien Marie
is not NULL (req->q.manpath = req->p[0]). The diff use the same style that when MAN_DIR is invalid (cgi.c:917), but that could be improved using err(3) ? Thanks. -- Sébastien Marie Index: cgi.c === RCS file: /cvs/src/usr.b

patch: acpitz: active cooling and notify 0x81

2014-08-21 Thread Sébastien Marie
points. It always set sc_ac_stat=-1, but if no error in acpitz_setfan occurs, the call will set sc_ac_stat= _STA. Another possibility (not tested) should be to change active cooling code to permit call acpitz_setfan(OFF) when sc_ac_stat == -1. Thanks to comment. -- Sébastien Marie Index: s

Re: patch: acpitz: active cooling and notify 0x81 (patch v2)

2014-08-21 Thread Sébastien Marie
On Thu, Aug 21, 2014 at 10:44:36AM +0200, Sébastien Marie wrote: > Hi, > > Another possibility (not tested) should be to change active cooling code > to permit call acpitz_setfan(OFF) when sc_ac_stat == -1. > Next is the patch that implement the other possibility (the code is run

Re: patch: acpitz: active cooling and notify 0x81

2014-08-27 Thread Sébastien Marie
e impact of not use this cache is negligible, it is ok for me. I join a very conservative patch which just allow calling acpi_setfan(sc,i,"_OFF") if cache is unknown. Thanks. -- Sébastien Marie Index: dev/acpi/acpitz.c =

Re: patch: acpitz: active cooling and notify 0x81

2014-09-15 Thread Sébastien Marie
ping ? Tihs patch is very conservative: it just allow to switch fan OFF if state is unknown. Thanks. -- Sébastien Marie On Wed, Aug 27, 2014 at 02:51:20PM +0200, Sébastien Marie wrote: > Hi Jonathan, > > First, thanks for your feedback and for your patch. > > On Wed, Aug 27

Re: patch: acpitz: active cooling and notify 0x81

2014-09-19 Thread Sébastien Marie
st active_cooling. - on notify 0x82 (ACPITZ_DEVLIST): it seems to me it is valuable to set unknown state to sc_ac_stat when _ALx change, as sc_ac_stat reflect the _STA value of _ALx Thanks. -- Sébastien Marie Index: acpitz.c =

Re: tplink TL-WN722N (ath ar9271): athn0: could not load firmware (and firmware is there)

2014-09-25 Thread Sébastien Marie
thn-firmware-1.1p1 [...] $ dmesg | grep athn athn0 at uhub0 port 4 "ATHEROS USB2.0 WLAN" rev 2.00/1.08 addr 2 athn0: AR9271 rev 1 (1T1R), ROM rev 13, address c0:4a:00:1c:c0:aa -- Sébastien Marie

patch: correct double-free in dc(1)

2014-11-24 Thread Sébastien Marie
it free the value on stack, and the array A too (as != NULL) - it pops the array B - it will try to set B[1] = 1, so it free B[1], which is A, which is already freed: *boom*. The patch just ensure a push_number (or push_string) properly initialize the value, by set value.array to

Re: patch: correct double-free in dc(1)

2014-11-24 Thread Sébastien Marie
; Actually, with this, the init in stack_grow can be left out, I believe. As stack_grow is only used in stack_push{,number,string} and initialization is done everywhere, I think it is ok. Yours. -- Sébastien Marie

[patch] sed: segfault due to use of initialized variable

2014-12-10 Thread Sébastien Marie
y compiler warning too (with -Wall -O2). Thanks. -- Sébastien Marie Index: process.c === RCS file: /cvs/src/usr.bin/sed/process.c,v retrieving revision 1.20 diff -u -p -r1.20 process.c --- process.c 1 Dec 2014 06:37:25 -

[patch] sed: missing bound check resulting stack overflow

2014-12-10 Thread Sébastien Marie
(core dumped) Found also with afl-fuzz. Thanks. -- Sébastien Marie Index: compile.c === RCS file: /cvs/src/usr.bin/sed/compile.c,v retrieving revision 1.36 diff -u -p -r1.36 compile.c --- compile.c 8 Oct 2014 04:19:08 - 1

Re: [patch] sed: missing bound check resulting stack overflow

2014-12-10 Thread Sébastien Marie
On Wed, Dec 10, 2014 at 11:16:21AM +0100, Sébastien Marie wrote: > Hi, > > In compile_flags, the variable holding the filename ('w' flag of 's' > command) is an array with PATH_MAX length. > > We should check the size of wanted filename, before copying it

Re: [patch] sed: missing bound check resulting stack overflow

2014-12-10 Thread Sébastien Marie
On Wed, Dec 10, 2014 at 11:16:21AM +0100, Sébastien Marie wrote: > Hi, > > In compile_flags, the variable holding the filename ('w' flag of 's' > command) is an array with PATH_MAX length. > > We should check the size of wanted filename, before copying it

Re: [patch] sed: missing bound check resulting stack overflow

2014-12-10 Thread Sébastien Marie
ould never write to it (we stop): we keep two cells at end. As simple test, defining wfile to "char wfile[2]", don't permit to save to any filename, whereas one-char filename should be ok. $ echo | sed -e s/a//w_ sed: 1: "s/a//w_": wfile too long I think the test should be

Re: [patch] sed: segfault due to use of initialized variable

2014-12-10 Thread Sébastien Marie
On Wed, Dec 10, 2014 at 10:05:49PM +1100, Jonathan Gray wrote: > On Wed, Dec 10, 2014 at 10:39:37AM +0100, Sébastien Marie wrote: > > > > Hi, > > > > Fuzzing sed with afl, I found a crash due to use of uninitialized > > variable. > > > > In pro

Re: [patch] sed: missing bound check resulting stack overflow

2014-12-10 Thread Sébastien Marie
On Thu, Dec 11, 2014 at 04:38:50PM +1100, Jonathan Gray wrote: > > Yes, I agree. I plan to commit this version: > It is ok for me. Thanks. Sébastien Marie > Index: compile.c > === > RCS file: /cvs/src/usr.b

PATCH: ksh: parsing problem: quote in comment in command substitution

2015-03-08 Thread Sébastien Marie
On Sat, Mar 07, 2015 at 07:16:53AM +0100, Sébastien Marie wrote: > Hi, > > I encounter a problem of parsing in ksh(1): a quote in a comment in a > command substitution $(...) or `...` is parsed as quote and a closing quote > is expected. > > Here code snippet that expose th

file: crash with invalid magic file (+ patch)

2015-04-25 Thread Sébastien Marie
ine: the function magic_get_string, used for get the "JFIF\" string, miss the end-of-line due to '\' char, resulting processing outside the line variable. Problem found using afl-fuzz. The proposed diff ensure '\0' is correctly detected, and return an error ("can

Re: bug/inconsistency in OpenBSD sed(1) vs. FreeBSD sed(1) [patch]

2015-05-08 Thread Sébastien Marie
r 'text'. While here, remove 'len' field from 'struct s_appends'. It was just used for AP_STRING (used for 'a' command), and the switch from fwrite to printf permit to not use it. -- Sébastien Marie Index: defs.h =

Re: bug/inconsistency in OpenBSD sed(1) vs. FreeBSD sed(1) [patch]

2015-05-09 Thread Sébastien Marie
On Sat, May 09, 2015 at 06:47:05AM +0200, Sébastien Marie wrote: > > Hi, > > Here a small patch to sed to make 'i' and 'a' command to always append > "\n" after 'text'. > > While here, remove 'len' field from 'struct

[patch] correct file(1) printed usage

2015-05-28 Thread Sébastien Marie
Hi, I would report (and correct) an invalid usage statement of file(1). $ file usage: file [-bchiLsW] [file ...] $ man file | grep -A1 'SY' SYNOPSIS file [-bchiLsW] file ... As at least one argument is mandatory, removing the [] would make sens. Thanks. -- Sébastien Mar

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

2015-05-28 Thread Sébastien Marie
STDIN_FILENO for O_NONBLOCK. Remaining interrogations: - should '-' implies '-s' (as before) ? - should I rename "-" to "/dev/stdin" in order to have similar output than before ? - why "file -s /dev/stdin" returns "data" instead

[patch] file(1) adjust size in fill_buffer

2015-05-29 Thread Sébastien Marie
ffer than expected, considering garbage as potential data. before: --- $ echo foobar | file -s /dev/stdin /dev/stdin: data after: -- $ echo foobar | file -s /dev/stdin /dev/stdin: ASCII text Thanks. -- Sébastien Marie Index: file.c ==

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

2015-05-29 Thread Sébastien Marie
gt; > $ echo foobar | file -s /dev/stdin > > /dev/stdin: data > > > > > > > > after patching: > > --- > > $ echo foobar | file - /dev/stdin: ASCII text $ file - < file.c /dev/stdin: ASCII C program text $ file ./- # pro

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

2015-05-29 Thread Sébastien Marie
p; (errno == ENFILE || errno == EMFILE)) Because of open is used with O_NONBLOCK ? But, if it isn't need it could be removed from my patch. -- Sébastien Marie

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

2015-05-29 Thread Sébastien Marie
pe) I think fifo (S_IFIFO) should be attempted to be read too. 5.5$ mkfifo test 5.5$ (echo 123 > test) & [1] 18981 5.5$ file -s test test: ASCII text Next a slightly modified patch. -- Sébastien Marie Index: file.1 ===

[patch] libc/locale/setlocale.c: remove unused arg

2015-06-09 Thread Sébastien Marie
Hi, I start reading libc/locale code in order to understanding it. Here a patch to remove an unused argument "isspecial" from static function "load_locale_sub". The function is called once, with isspecial=0, and the argument isn't used in function's body. Any

Remove unused variable in arch/i386/i386/lapic.c

2013-10-26 Thread Sébastien Marie
Hi I have noted that "scaled_pentium_mhz" variable in i386/lapic.c is defined and initialized, but never used anywhere (grep -R scaled_pentium_mhz /usr/src say nothing [after patch applied]). Remove it ? -- Sébastien Marie Index: arch/i386/i3

pkg_add (pkg.conf): option to require signed packages

2014-01-15 Thread Sébastien Marie
Hi, Does it make sens to have an option to require package to be signed ? Currently, a package without signature is gracefully installed without warning. The patch introduce an option "require-signature" in pkg.conf, and it respects -Dnosig in comand-line, if present. Thanks. --

Re: pkg_add (pkg.conf): option to require signed packages

2014-01-17 Thread Sébastien Marie
On Thu, Jan 16, 2014 at 10:02:22AM +, Stuart Henderson wrote: > On 2014/01/16 08:53, Sébastien Marie wrote: > > Hi, > > > > Does it make sens to have an option to require package to be signed ? > > It makes more sense to just enable that by default, w