Re: httpd - POST request size problem

2016-05-02 Thread Romain
Dear all, 
 
For information, I solved my problem in downloading and compiling the last 
sources (which I got from 
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/httpd/ ). 
 
Thanks. 
 
Best, 
Romain

 

 
 







On Sat, 30 Apr 2016 00:46:23 +
Romain  wrote:

> Can you show your whole httpd.conf please?
 
Sure: 

server "default" { 
listen on * port 80 

connection max request body 8388608 


location "/cgi-bin/*" {
fastcgi

root "/"
}

location "*.php" {
fastcgi socket "/run/php-fpm.sock"
}

} 

 

> Are you using a subdomain like foo.example.com?

No. 
So far, directly with the IP address. 
 
 
 
> There is a known bug were this directive needs to be added earlier on the 
> main domain to be applied/passed through to the subdomain. 
 
I tried to put this directive 
connection max request body 8388608 
on top of httpd.conf, then I restarted httpd, and it did not change anything. 
 
 
 
Thank you very much for your help. 
 
 

 


On Fri, 29 Apr 2016 15:58:27 +0200
Joerg Jung  wrote:


> On 29 Apr 2016, at 15:29, Romain  wrote:
> 
> Dear All, 
> 
> I use OpenBSD 5.8, and the httpd & php & sqlite3 which are provided with. 
> ($ uname -a => OpenBSD xx.my.domain 5.8 GENERIC#1170 amd64) 
> 
> I have a problem with the length of a POST request with seems to be limited 
> to 6588 (more or less) characters. 
> (I use a simple html form with a hidden input which has many characters.) 
> 
> I tried with lighttpd + php + sqlite3 and it works without this problem. 
> 
> I tried to add this line to httpd.conf: 
>  connection max request body 8388608 

Can you show your whole httpd.conf please?
Are you using a subdomain like foo.example.com?
There is a known bug were this directive needs to be added 
earlier on the main domain to be applied/passed through to the subdomain.

> And then I restarted httpd. 
> But it did not solve to the problem. 
> 
> And now I do not know what to do. 
> 
> Thanks for your help. 
> 
> Best, 
> Romain 



Re: tmux vs UTF8

2016-05-02 Thread hans
On May 01 19:10:03, schwa...@usta.de wrote:
> > In the last snapshot, it seems, tmux does not do UTF8 input correctly,
> > while xterm is fine. This used to work with the ~/.xsession below.
> > 
> > When typing non-ascii in xterm or in a vim-in-an-xterm
> > ot a mutt-in-an-xterm, thay appear OK. When in a tmux window,
> > they look like garbage.
> > 
> > Interestingly, if I type some Czech text into /tmp/cz 
> > (using vim in an xterm, whre it works), and then open
> > the file with vim in tmux, the text there appears fine
> > - only _new_ text typed within tmux looks broken.
> > 
> > Has anything changed in the way tmux handles UTF8?
> 
> Such generic questions are always hard to answer.
> Yes, some things changed recently, but who knows whether
> that is related?
> 
> > Is anyone else seeing this?
> 
> Trying to reproduce and then fix is a good idea.
> However, i can't reproduce so far.
> 
> Here is what i did:
> 
>   $ cd /usr/src/usr.bin/tmux/
>   $ make cleandir
>   $ make obj
>   $ make cleandir
>   $ cvs up -dP
>   $ make depend
>   $ make
>   $ doas make install
>   $ tmux

I have rebuilt my tmux from HEAD too now.

> And now, inside the tmux window, typing in accented characters
> works fine for me, both on the ksh(1) command line and inside vim(1).
> 
> Obviously, i don't have a CZ keyboard; but this shouldn't make
> the difference, or should it?

I don't think it should.

>   schwarze@isnote $ setxkbmap -query
>   rules:  base
>   model:  pc105
>   layout: us
>   options:compose:ralt,altwin:left_meta_win

>   schwarze@isnote $ locale   
>   LANG=
>   LC_COLLATE="C"
>   LC_CTYPE=en_US.UTF-8
>   LC_MONETARY="C"
>   LC_NUMERIC="C"
>   LC_TIME="C"
>   LC_MESSAGES="C"
>   LC_ALL=

hans@biblio:~$ setxkbmap -query 
rules:  base
model:  pc105
layout: us,cz
options:grp:shifts_toggle,grp_led:scroll

hans@biblio:~$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE=cs_CZ.UTF-8
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES=C
LC_ALL=


> I don't have an ~/.xmodmaprc, i don't know what is in yours,
> and i have no idea whether that's related.

Sorry  for not including that:

$ cat .xmodmaprc  
keycode  29 = y Y y Y leftarrow yen
keycode  52 = z Z z Z degree less

The default cz variant has y/z switched, I switch it back.
This is most probably not related.


> > good line: ?? (vim in xterm)
> > bad line :  (vim in tmux in xterm)
> 
> That's double encoding.  Here is information regarding the first
> character from uniname(1):
> 
>   char byte UTF-32 encod name
>  00 00011B C4 9B LATIN SMALL LETTER E WITH CARON

> If you misinterpret that as U+00C4 U+009B and encode it again,
> you get:
> 
>   char byte UTF-32 encod name
>  00 C4 C3 84 LATIN CAPITAL LETTER A WITH DIAERESIS
>  12 9B C2 9B CONTROL SEQUENCE INTRODUCER

My bad again: I am not sure I typed the same keys in those two lines.

However, the first letter in the good line is the a with a caron;
and the first letter in the bad line is capital A with a diaeresis.
But capital A with a diaeresis is not what I wanted to type,
that's where the problem is. Could this misinterpretation
be what I am seeing?

Here is include a better test of the same:
the first line contains the input obtained with pressing the keys
2 to 0 using the cz keyboard in vim in an xterm. The second line
is the input obtained by pressing the same in vim in tmux in xterm):

ěščřžýáíé
ěščřžýáíé


Jan



Re: tmux vs UTF8 [solved]

2016-05-02 Thread hans
On May 01 18:14:33, nicholas.marri...@gmail.com wrote:
> Jan, please make sure you are running -current (build and install tmux
> from CVS HEAD) and if the problem still exists run this

I have the HEAD tmux now.

> tmux -vvvLtest -f/dev/null new

Strangely, with this line, I don't see the problem;
with just 'tmux', I do.

That's probably not due to -v; and I just moved my ~/.tmux/xonf away.
Here it is for completeness:

set -g status-interval 60
set -g status-right '#h | #(test `apm -b` -lt 4 && echo "`apm -l`%% | ")%H:%M'

That leaves -L, and indeed, 'tmux -Ltest' works fine!

And after I exited all the tmuxes that were running,
the freshly launched one works fine too 

(Was it a stale /tmp/tmux-1000/default socket of my less-than-current tmux?)


> Then type ONE of the broken characters with the keyboard, exit tmux and
> send me the tmux-server-*.log file from the current directory.

See below. I typed an a-caron, enter, then crtl-D to exit


Thank you

Jan



1462198970.960747 server started (93180): socket /tmp/tmux-1000/test, protocol 8
1462198970.960833 on OpenBSD 5.9 GENERIC.MP#1999; libevent 1.4.15-stable 
(kqueue)
1462198970.961099 continuing cmdq 0x55dfd3dd400: flags 0, client 0x0
1462198970.961171 cmdq 0x55dfd3dd400: bind-key C-b send-prefix
1462198970.961230 preparing state for bind-key C-b send-prefix (client 0x0)
1462198970.961241 cmd_find_client: no target, return 0x0
1462198970.961253 preparing -t state: target none
1462198970.961260 preparing -s state: target none
1462198970.961281 preparing state for bind-key C-b send-prefix (client 0x0)
1462198970.961289 cmd_find_client: no target, return 0x0
1462198970.961295 preparing -t state: target none
1462198970.961301 preparing -s state: target none
1462198970.961336 continuing cmdq 0x55dfd3dd400: flags 0, client 0x0
1462198970.961348 cmdq 0x55dfd3dd400: bind-key C-o rotate-window
1462198970.961362 preparing state for bind-key C-o rotate-window (client 0x0)
1462198970.961369 cmd_find_client: no target, return 0x0
1462198970.961375 preparing -t state: target none
1462198970.961381 preparing -s state: target none
1462198970.961394 preparing state for bind-key C-o rotate-window (client 0x0)
1462198970.961407 cmd_find_client: no target, return 0x0
1462198970.961414 preparing -t state: target none
1462198970.961420 preparing -s state: target none
1462198970.961456 continuing cmdq 0x55dfd3dd400: flags 0, client 0x0
1462198970.961469 cmdq 0x55dfd3dd400: bind-key C-z suspend-client
1462198970.961482 preparing state for bind-key C-z suspend-client (client 0x0)
1462198970.961489 cmd_find_client: no target, return 0x0
1462198970.961496 preparing -t state: target none
1462198970.961501 preparing -s state: target none
1462198970.961514 preparing state for bind-key C-z suspend-client (client 0x0)
1462198970.961521 cmd_find_client: no target, return 0x0
1462198970.961527 preparing -t state: target none
1462198970.961533 preparing -s state: target none
1462198970.961560 continuing cmdq 0x55dfd3dd400: flags 0, client 0x0
1462198970.961573 cmdq 0x55dfd3dd400: bind-key Space next-layout
1462198970.961614 preparing state for bind-key Space next-layout (client 0x0)
1462198970.961622 cmd_find_client: no target, return 0x0
1462198970.961628 preparing -t state: target none
1462198970.961634 preparing -s state: target none
1462198970.961647 preparing state for bind-key Space next-layout (client 0x0)
1462198970.961654 cmd_find_client: no target, return 0x0
1462198970.961660 preparing -t state: target none
1462198970.961666 preparing -s state: target none
1462198970.961700 continuing cmdq 0x55dfd3dd400: flags 0, client 0x0
1462198970.961721 cmdq 0x55dfd3dd400: bind-key ! break-pane
1462198970.961735 preparing state for bind-key ! break-pane (client 0x0)
1462198970.961742 cmd_find_client: no target, return 0x0
1462198970.961748 preparing -t state: target none
1462198970.961754 preparing -s state: target none
1462198970.961767 preparing state for bind-key ! break-pane (client 0x0)
1462198970.961773 cmd_find_client: no target, return 0x0
1462198970.961779 preparing -t state: target none
1462198970.961785 preparing -s state: target none
1462198970.961808 continuing cmdq 0x55dfd3dd400: flags 0, client 0x0
1462198970.961820 cmdq 0x55dfd3dd400: bind-key " split-window
1462198970.961833 preparing state for bind-key " split-window (client 0x0)
1462198970.961839 cmd_find_client: no target, return 0x0
1462198970.961845 preparing -t state: target none
1462198970.961851 preparing -s state: target none
1462198970.961864 preparing state for bind-key " split-window (client 0x0)
1462198970.961871 cmd_find_client: no target, return 0x0
1462198970.961877 preparing -t state: target none
1462198970.961882 preparing -s state: target none
1462198970.961907 continuing cmdq 0x55dfd3dd400: flags 0, client 0x0
1462198970.961919 cmdq 0x55dfd3dd400: bind-key # list-buffers
1462198970.961940 preparing state for bind-key # list-buffers (client 0x0)
1462198970.961947 

Re: Performance of Firefox and Chromium

2016-05-02 Thread Alan Corey
>> A language has nothing to do with speed of execution!

It seems like Javascript's gotten faster in the last 10 years or so.

I used to write little benchmarks to compare Turbo C and Turbo Pascal,
Pascal always won.

> (Point being once things reach a certain level of complexity, issues
> like available developer time and architectural decisions and so on
> can become rather significant.

For a one-time use program sure, but things like Python shouldn't be
unleashed on an unsuspecting public.  Gimp 2.8 is noticeably slower
than 2.6 I think it was in OpenBSD 5.2.  Move the cursor over the
image and it's like it's in la-la land.  Try to sign your name with
the mouse.  Of Inkscape and Libre Office Draw, surprisingly Libre
Office is the faster and works better for an SVG signature.  But not
as fast as this amazing little page:
http://mcc.id.au/2010/signature.html


-- 
Credit is the root of all evil.  - AB1JX



Re: Laptop not waking from suspend on opening lid

2016-05-02 Thread Mike Larkin
On Sun, May 01, 2016 at 04:08:28PM +0100, Anthony Campbell wrote:
> This is on a Thinkpad Z61m running amd64. Suspend on lid closure has
> worked without problems for many months with numerous snapshots. After
> upgrading on 30 April the machine no longer wakes on lid opening. The
> sleep symbol below the screen blinks repeatedly but nothing else
> happens.
> 
> If I suspend it with Fn+F4 the same thing happens; it is impossible to
> wake the machine.
> 
> Another Thinkpad running i386 is not affected.
> 

When did it last work? Eg, when before "30 April"?

-ml

> 
> My dmesg:
> 
> 
> 
> OpenBSD 5.9-current (GENERIC.MP) #2001: Sat Apr 30 17:20:25 MDT 2016
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> real mem = 3203203072 (3054MB)
> avail mem = 3101589504 (2957MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (68 entries)
> bios0: vendor LENOVO version "7FET91WW (2.09 )" date 11/01/2006
> bios0: LENOVO 9450HAG
> acpi0 at bios0: rev 2
> acpi0: sleep states S0 S3 S4 S5
> acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG HPET SLIC BOOT SSDT SSDT 
> SSDT SSDT
> acpi0: wakeup devices LID_(S3) SLPB(S3) UART(S3) EXP0(S4) EXP1(S4) EXP2(S4) 
> EXP3(S4) PCI1(S4) USB0(S3) USB1(S3) USB3(S3) USB7(S3) HDEF(S4)
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpiec0 at acpi0
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz, 1995.32 MHz
> cpu0: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF,SENSOR
> cpu0: 4MB 64b/line 16-way L2 cache
> cpu0: smt 0, core 0, package 0
> mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
> cpu0: apic clock running at 166MHz
> cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE
> cpu1 at mainbus0: apid 1 (application processor)
> cpu1: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz, 1995.00 MHz
> cpu1: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF,SENSOR
> cpu1: 4MB 64b/line 16-way L2 cache
> cpu1: smt 0, core 1, package 0
> ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins
> ioapic0: misconfigured as apic 2, remapped to apid 1
> acpimcfg0 at acpi0 addr 0xf000, bus 0-63
> acpihpet0 at acpi0: 14318179 Hz
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus 1 (AGP_)
> acpiprt2 at acpi0: bus 2 (EXP0)
> acpiprt3 at acpi0: bus 3 (EXP1)
> acpiprt4 at acpi0: bus 4 (EXP2)
> acpiprt5 at acpi0: bus 12 (EXP3)
> acpiprt6 at acpi0: bus 21 (PCI1)
> acpicpu0 at acpi0: !C3(250@17 mwait.3@0x20), !C2(500@1 mwait.1@0x10), 
> C1(1000@1 mwait.1), PSS
> acpicpu1 at acpi0: !C3(250@17 mwait.3@0x20), !C2(500@1 mwait.1@0x10), 
> C1(1000@1 mwait.1), PSS
> acpipwrres0 at acpi0: PUBS, resource for USB0, USB7
> acpitz0 at acpi0: critical temperature is 127 degC
> acpitz1 at acpi0: critical temperature is 99 degC
> acpibtn0 at acpi0: LID_
> acpibtn1 at acpi0: SLPB
> "PNP0303" at acpi0 not configured
> "IBM0057" at acpi0 not configured
> "IBM0071" at acpi0 not configured
> "ATM1200" at acpi0 not configured
> acpibat0 at acpi0: BAT0 model "92P1127" serial 14319 type LION oem "SANYO"
> acpiac0 at acpi0: AC unit online
> acpithinkpad0 at acpi0
> acpidock0 at acpi0: GDCK not docked (0)
> acpivideo0 at acpi0: VID_
> acpivout0 at acpivideo0: LCD0
> acpivideo1 at acpi0: VID_
> acpivout at acpivideo1 not configured
> cpu0: Enhanced SpeedStep 1995 MHz: speeds: 2000, 1667, 1333, 1000 MHz
> pci0 at mainbus0 bus 0
> pchb0 at pci0 dev 0 function 0 "Intel 82945GM Host" rev 0x03
> ppb0 at pci0 dev 1 function 0 "Intel 82945GM PCIE" rev 0x03: msi
> pci1 at ppb0 bus 1
> radeondrm0 at pci1 dev 0 function 0 "ATI Radeon Mobility X1400" rev 0x00
> drm0 at radeondrm0
> radeondrm0: apic 1 int 16
> azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02: msi
> azalia0: codecs: Analog Devices AD1981HD, Conexant/0x2bfa, using Analog 
> Devices AD1981HD
> audio0 at azalia0
> ppb1 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02: msi
> pci2 at ppb1 bus 2
> bge0 at pci2 dev 0 function 0 "Broadcom BCM5752M" rev 0x02, BCM5752 A2 
> (0x6002): msi, address 00:16:36:ca:5d:9c
> brgphy0 at bge0 phy 1: BCM5752 10/100/1000baseT PHY, rev. 0
> ppb2 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02: msi
> pci3 at ppb2 bus 3
> wpi0 at pci3 dev 0 function 0 "Intel PRO/Wireless 3945ABG" rev 0x02: msi, 
> MoW2, address 00:19:d2:0b:08:78
> ppb3 at pci0 dev 28 function 2 "Intel 82801GB PCIE" rev 0x02: msi
> pci4 at ppb3 bus 4
> ppb4 at pci0 dev 28 function 3 "Intel 82801GB PCIE" rev 0x02: msi
> pci5 at ppb4 bus 12
> uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: apic 1 int 16
> uhci1 at pci0 dev 29 function 1 "Intel 

Re: Performance of Firefox and Chromium

2016-05-02 Thread Kevin Chadwick
> >> A language has nothing to do with speed of execution!  
> 
> It seems like Javascript's gotten faster in the last 10 years or so.
> 

> I used to write little benchmarks to compare Turbo C and Turbo Pascal,
> Pascal always won.

Obviosuly C is generally faster than javascript and built in html5
routines should be, of course often javascript heavy sites send
javascript from many domains which is slow and insecure and probably
increases threading a lot by it's distributed nature.

-- 

KISSIS - Keep It Simple So It's Securable



rwhod

2016-05-02 Thread stan
Preparing to upgrade some 5.5 machines to 5.9

I seem to be missing /usr/sbin/rwhod on a freshly installed 5.9 machine.
Is there soemthing special I have to do to get this isnalled?


-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



Re: Performance of Firefox and Chromium

2016-05-02 Thread Gregor Best
On Mon, May 02, 2016 at 11:55:34AM -0400, Alan Corey wrote:
> [...]
> For a one-time use program sure, but things like Python shouldn't be
> unleashed on an unsuspecting public.  Gimp 2.8 is noticeably slower
> than 2.6 I think it was in OpenBSD 5.2.  Move the cursor over the
> image and it's like it's in la-la land.  Try to sign your name with
> the mouse.  Of Inkscape and Libre Office Draw, surprisingly Libre
> Office is the faster and works better for an SVG signature.  But not
> as fast as this amazing little page:
> http://mcc.id.au/2010/signature.html
> [...]

I just tried it out on my Thinkpad T400 running a snapshots that's about
3 weeks  old and  I can't  reproduce Gimps  "la-la land".  I tried  on a
640x480 canvas,  with both the  pen and  the brush. Instant  painting in
both cases. The  Javascript thingie is almost as instant  but has a very
very tiny lag.

I'm not  sure what  hardware you guys  run OpenBSD on,  but on  my (old,
crusty,  crummy, shitty)  laptop,  it  and a  lot  of Gui-requiring  and
rumored to be "heavy" by whatever metric programs work nicely. That
includes Chromium by the way.

-- 
Gregor



Pledging Python programs

2016-05-02 Thread Tobias Borgert
Hello misc,

I wanted to look into Python C extensions and as I also wanted to look
at pledge, the following was the result.

$ cat test_pypledge_success.py
import pypledge

pypledge.pledge("stdio", None)

print("Hello OpenBSD!")
$ python3.4 test_pypledge_success.py
Hello OpenBSD!

$ cat test_pypledge_AbortTrap.py
import pypledge

pypledge.pledge("", None)

print("Hello OpenBSD!")
$ python3.4 test_pypledge_AbortTrap.py
Abort trap (core dumped)

(ktrace shows the pledging and the aborting nicely)

$ cat test_pypledge_EPERM.py
import pypledge

pypledge.pledge("stdio rpath", None);
pypledge.pledge("stdio rpath dns", None);

print("Hello OpenBSD!")
$ python 3.4 test_pypledge_EPERM.py
Traceback (most recent call last):
  File "test_pypledge_EPERM.py", line 4, in 
pypledge.pledge("stdio rpath dns", None);
pypledge.PledgeError: EPERM

(please notice that throwing errors requires stdio and rpath for
python3.4, else throwing the error will get you an abort trap).

As Python isn't doing fancy forking and most of the heavy bytecode
generating and other maintenance has happened already when I reach the
pledge line, this appears to work (I'm actually more interested in the
nice whitepath feature for some scripts of mine when it's ready). I
don't know if this makes any sense (it probably won't for large
projects) or may be of use to anyone as a base for more elaborated
stuff, but in case anyone wants to do some experiments or do some test
what promises are needed for larger Python stuff (and if its feasible
there, you never know what the interpreter is doing in the background),
here's the highly experimental module code:

#include "/usr/local/include/python3.4m/Python.h"

#include 
#include 

/* Python PledgeError for a more pythonic behaviour. */
static PyObject *PledgeError;

/* Visible to the outside, wraps pledge(2). */
static PyObject *
pypledge_pledge(PyObject *self, PyObject *args)
{
PyObject *pyPaths;
PyObject *item;
PyObject *asciiItem;
int arrSize, idx;

const char *promises;
const char **paths;

int result;

if(!PyArg_ParseTuple(args, "sO", , ))
return NULL;

if(pyPaths == Py_None)
paths = NULL;
else {
if(!PySequence_Check(pyPaths)) {
   PyErr_SetString(PyExc_TypeError, "expected a list");
   return NULL;
}

arrSize = PyObject_Length(pyPaths);
if(arrSize == 0)
paths = NULL;
else {
paths = malloc(sizeof(const char*) * arrSize);
for(idx = 0; idx < arrSize; idx++) {
item = PySequence_GetItem(pyPaths, idx);
if(item == NULL)
paths[idx] = NULL;
else {
asciiItem = PyUnicode_AsASCIIString(item);
paths[idx] = PyBytes_AsString(asciiItem);
}
}
}
}

result = pledge(promises, paths);
if(result < 0) {
if(errno == EFAULT)
PyErr_SetString(PledgeError, "EFAULT");
else if(errno == EINVAL)
PyErr_SetString(PledgeError, "EINVAL");
else if(errno == ENAMETOOLONG)
PyErr_SetString(PledgeError, "ENAMETOOLONG");
else if(errno == EPERM)
PyErr_SetString(PledgeError, "EPERM");
else if(errno == E2BIG)
PyErr_SetString(PledgeError, "E2BIG");
else
PyErr_SetString(PledgeError, "unknown errno from pledge(2)");
free(paths);
return NULL;
}

free(paths);
Py_INCREF(Py_None);
return Py_None;
}

/* Methods exported to Python. */
static PyMethodDef PyPledgeMethods[] = {
   {"pledge", pypledge_pledge, METH_VARARGS, "Restrict system operations."},
   {NULL, NULL, 0, NULL}
};

/* Module definition */
static struct PyModuleDef pypledge = {
PyModuleDef_HEAD_INIT,
"pypledge",
NULL,
-1,
PyPledgeMethods
};

/* Entry point for Python. */
PyMODINIT_FUNC
PyInit_pypledge(void)
{
PyObject *module;

module = PyModule_Create();
if(module == NULL)
return NULL;

PledgeError = PyErr_NewException("pypledge.PledgeError", NULL, NULL);
Py_INCREF(PledgeError);
PyModule_AddObject(module, "PledgeError", PledgeError);

return module;
}

I didn't expect it to work even for basic examples, so I wanted to share
this as I was surprised that it was actually simple up to this point.

Best regards,

Tobias



Re: rwhod

2016-05-02 Thread Jeremie Courreges-Anglas
stan  writes:

> Preparing to upgrade some 5.5 machines to 5.9
>
> I seem to be missing /usr/sbin/rwhod on a freshly installed 5.9 machine.
> Is there soemthing special I have to do to get this isnalled?

Ahem... create a port for it, maybe?  rwhod has been removed since
2014/04/24.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: rwhod

2016-05-02 Thread Jan Vlach
Hi Stan,

On Mon, May 02, 2016 at 02:34:19PM -0400, stan wrote:
> Preparing to upgrade some 5.5 machines to 5.9
> 
> I seem to be missing /usr/sbin/rwhod on a freshly installed 5.9 machine.
> Is there soemthing special I have to do to get this isnalled?

rwhod and friends (rsh, rcp ...) got removed in 5.6

see:
http://www.openbsd.org/56.html

Jan



Re: Pledging Python programs

2016-05-02 Thread Kamil Cholewiński
On Mon, 02 May 2016, Tobias Borgert  wrote:
> Hello misc,
>
> I wanted to look into Python C extensions and as I also wanted to look
> at pledge, the following was the result.
>
> [...]
>
> I didn't expect it to work even for basic examples, so I wanted to share
> this as I was surprised that it was actually simple up to this point.
>
> Best regards,
>
> Tobias

This is extremely relevant to my interests. I will definitely test soon.
Thank you!



Re: panic: rw_enter:vmmaplk locking against myself

2016-05-02 Thread Peter N. M. Hansteen
On Sun, May 01, 2016 at 09:40:05AM -0700, bluesun08 wrote:
> During booting i get the following error messages and the computer is "dead":
> 
> 
> panic: rw_enter:vmmaplk locking against myself
> Stopped at Debugger +0x9: leave
> RUN AT LEAST trace AND ps AND INCLUDE OUTPUT WHEN REPORTING THIS PANIC1
> IF RUNNING SMP, USE mach ddbcpu <#> AND trace ON OTHER PROCESSORS, TOO.
> DO NOT EVEN BOTHER REPORTING THIS WITHOUT INCLUDING THAT INFROMATION
> DDB{0}>
> 
> What could be the problem here?

That's really hard to tell from what you're offering up. Panics are usually 
indications
of something bad, but there's simply not enough information here (missing are 
such tings
as OpenBSD version, hardware platform, steps leading up to the situation, and 
so forth)
to go on.

The message on your screen says 

"RUN AT LEAST trace AND ps AND INCLUDE OUTPUT WHEN REPORTING THIS PANIC!"

If you had done that and reported the contents, that would have been a lot more 
useful.

http://www.openbsd.org/report.html is a useful starting point. If you can get 
the system
to boot somehow, sendbug(1) is your friend.

-- 
Peter N. M. Hansteen, member of the first RFC 1149 implementation team
http://bsdly.blogspot.com/ http://www.bsdly.net/ http://www.nuug.no/
"Remember to set the evil bit on all malicious network traffic"
delilah spamd[29949]: 85.152.224.147: disconnected after 42673 seconds.



Re: tmux vs UTF8

2016-05-02 Thread Andreas Kusalananda Kähäri
Solved.

Summary: I started tmux in my ~/.profile before setting LANG and LC_ALL.
Changing to starting tmux from $ENV, after setting & exporting LANG and
LC_ALL solved the display issue with accented characters.

This, however made the panel layout go really wonky (bad line-drawing
characters).  I use iTerm on a Mac to connect to my OpenBSD machine, and
in iTerm there's a "Treat ambigous-width characters as double width"
setting.  Unsetting this solves the panel layout problem.

Thanks to Nick for pointing me in the right directions.

I don't know if any of this helps Jan (the original poster) though...

Cheers,
Andreas

On Sun, May 01, 2016 at 09:08:04PM +0200, Andreas Kusalananda K�h�ri wrote:
> On Sun, May 01, 2016 at 07:32:09PM +0100, Nicholas Marriott wrote:
> > Underscores means tmux does not know that your terminal supports UTF-8
> > which probably means LANG or LC_ALL are not exported correctly.
> 
> LANG and LC_ALL are exportded with value "en_US.UTF-8".  Exporting the
> other LC_* variables doesn't make any differece.  Setting TERM to
> screen, screen-256color or rxvt (or anything else) doesn't seem to make
> any differece either.
> 
> 
> > On 1 May 2016 7:24 p.m., "Andreas Kusalananda K??h??ri" <
> > andreas.kah...@icm.uu.se> wrote:
> >
> > > On Sun, May 01, 2016 at 07:10:03PM +0200, Ingo Schwarze wrote:
> > > > Hi Jan,
> > > >
> > > > hans wrote on Sat, Apr 30, 2016 at 01:08:12PM +0200:
> > > >
> > > > > In the last snapshot, it seems, tmux does not do UTF8 input
> correctly,
> > > > > while xterm is fine. This used to work with the ~/.xsession below.
> > > > >
> > > > > When typing non-ascii in xterm or in a vim-in-an-xterm
> > > > > ot a mutt-in-an-xterm, thay appear OK. When in a tmux window,
> > > > > they look like garbage.
> > > > >
> > > > > Interestingly, if I type some Czech text into /tmp/cz
> > > > > (using vim in an xterm, whre it works), and then open
> > > > > the file with vim in tmux, the text there appears fine
> > > > > - only _new_ text typed within tmux looks broken.
> > > > >
> > > > > Has anything changed in the way tmux handles UTF8?
> > > >
> > > > Such generic questions are always hard to answer.
> > > > Yes, some things changed recently, but who knows whether
> > > > that is related?
> > >
> > > I'm also having problems with accented characters in tmux, but in my
> > > case, I get underscores when I try to enter Swedish characters (??,
> > > hope that comes out right) or any accented characters, so I'm not
> > > sure it's the same issue as Jan had.  It's been like this for quite
> > > some time (months, possibly since all the non-UTF/POSIX locales were
> > > removed).  It's not just characters that I type, but mutt-in-tmux shows
> > > all accented characters in email as underscores too, as does less
> > > and cat.  Typing accented characters will actually insert the right
> > > character into the document (although in vim-in-tmux, again, it's all
> > > underscores), it's just the displaying of them that is wonky.
> > >
> > > I'm using tmux without X, over an SSH connection.
> > >
> > > $ locale
> > > LANG=en_US.UTF-8
> > > LC_COLLATE="C"
> > > LC_CTYPE="en_US.UTF-8"
> > > LC_MONETARY="C"
> > > LC_NUMERIC="C"
> > > LC_TIME="C"
> > > LC_MESSAGES="en_US.UTF-8"
> > > LC_ALL=en_US.UTF-8
> > >
> > > (using sv_SE.UTF-8 doesn't make any differece)
> > >
> > > Outside of tmux, it seems to work ok.  This is on amd64, recompiled from
> > > a checkout yesterday evening, running in an VM on VirtualBox.
> > >
> > > Cheers,
> > > Andreas
[cut]



Re: panic: rw_enter:vmmaplk locking against myself

2016-05-02 Thread bluesun08
How i said: The computer is "dead"

So i can't "RUN AT LEAST trace AND ps AND INCLUDE OUTPUT WHEN REPORTING THIS
PANIC!" 

It's OpenBSD 5.8 and a Shuttle DS57U3



--
View this message in context: 
http://openbsd-archive.7691.n7.nabble.com/panic-rw-enter-vmmaplk-locking-against-myself-tp295264p295354.html
Sent from the openbsd user - misc mailing list archive at Nabble.com.



drn_error after Chromium launching

2016-05-02 Thread dmitry.sensei
Hello.
error: [drm:pid73700:i915_context_is_banned] *ERROR* context hanging
too fast, declaring banned!
error: [drm:pid6437:i915_hangcheck_elapsed] *ERROR* Hangcheck timer
elapsed... render ring idle

As result: Openbox session exitting.


Dmesg:
OpenBSD 5.9-current (GENERIC.MP) #2002: Sun May  1 06:35:58 MDT 2016
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
RTC BIOS diagnostic error 80
real mem = 8483958784 (8090MB)
avail mem = 836672 (7841MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0x9c668000 (68 entries)
bios0: vendor LENOVO version "B0CN96WW" date 09/22/2015
bios0: LENOVO 80E5
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP UEFI ASF! BOOT LPIT MCFG SSDT UEFI ASPT HPET
WDAT SSDT POAT APIC SSDT SSDT DBGP SSDT DMAR CSRT FPDT BGRT
acpi0: wakeup devices PEGP(S4) PEG0(S4) PEGP(S4) PEG1(S4) PEGP(S4)
PEG2(S4) GLAN(S4) EHC1(S3) EHC2(S4) XHC_(S3) HDEF(S4) PXSX(S0)
RP01(S0) PXSX(S0) RP02(S0) PXSX(S0) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz, 2295.01 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX
,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEA
DLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FS
GSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,RDSEED,ADX,SMAP,PT,SENSOR,ARAT
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz, 2294.69 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX
,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEA
DLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FS
GSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,RDSEED,ADX,SMAP,PT,SENSOR,ARAT
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 1 (application processor)
cpu2: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz, 2294.69 MHz
cpu2:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX
,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEA
DLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FS
GSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,RDSEED,ADX,SMAP,PT,SENSOR,ARAT
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 1, core 0, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz, 2294.69 MHz
cpu3:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX
,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEA
DLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FS
GSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,RDSEED,ADX,SMAP,PT,SENSOR,ARAT
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 1, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 40 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEG0)
acpiprt2 at acpi0: bus -1 (PEG1)
acpiprt3 at acpi0: bus -1 (PEG2)
acpiprt4 at acpi0: bus 1 (RP01)
acpiprt5 at acpi0: bus -1 (RP02)
acpiprt6 at acpi0: bus 2 (RP03)
acpiprt7 at acpi0: bus 3 (RP04)
acpiprt8 at acpi0: bus 4 (RP05)
acpiprt9 at acpi0: bus -1 (RP06)
acpiprt10 at acpi0: bus -1 (RP07)
acpiprt11 at acpi0: bus -1 (RP08)
acpiec0 at acpi0
acpicpu0 at acpi0: C3(200@506 mwait.1@0x60), C2(200@148 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C3(200@506 mwait.1@0x60), C2(200@148 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpicpu2 at acpi0: C3(200@506 mwait.1@0x60), C2(200@148 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpicpu3 at acpi0: C3(200@506 mwait.1@0x60), C2(200@148 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: PC05, resource for RP05
acpibat0 at acpi0: BAT0 serial BAT20101001 oem "Lenovo IdeaPad"
"VPC2004" at acpi0 not configured
"INT3F0D" at acpi0 not configured
"IDEA0100" at acpi0 not configured
"SYN2B37" at acpi0 not configured
acpiac0 at acpi0: AC unit online
acpibtn0 at acpi0: LID0
acpibtn1 at acpi0: PWRB
"INT33A1" at acpi0 not configured
"INT340E" at acpi0 not configured
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
cpu0: Enhanced SpeedStep 2295 MHz: speeds: 2401, 2400, 2300, 2100,
2000,