Re: Rust programming language

2015-05-19 Thread Dmitrij D. Czarkoff
Lampshade said:
 Do you think that learning Rust can be good for educational purposes?

Learning anything is good for educational purposes.

-- 
Dmitrij D. Czarkoff



Wake up on key press?

2015-05-19 Thread Bryan Pimmler
Hi,

In order to wake up my machine from zzz, I have to reach under the
desk and press the power button. Is there a way of having the machine
wake up when any key is pressed? I couldn't find any relevant settings
in the BIOS setup.

$ cat /etc/rc.conf.local
ntpd_flags=
xdm_flags=
apmd_flags=-A
sndiod=-mplay
pkg_scripts=dbus_daemon avahi_daemon
dbus_enable=YES

Full dmesg below.

Thanks

Bryan


OpenBSD 5.7 (GENERIC.MP) #881: Sun Mar  8 11:04:17 MDT 2015
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8471965696 (8079MB)
avail mem = 8242524160 (7860MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xec3b0 (78 entries)
bios0: vendor American Megatrends Inc. version F5 date 06/23/2014
bios0: GIGABYTE M4HM87P-00
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT LPIT SSDT SSDT SSDT SSDT MCFG HPET
SSDT SSDT ASF! DMAR
acpi0: wakeup devices PXSX(S4) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4)
RP03(S4) PXSX(S4) RP04(S4) PXSX(S4) RP05(S4) PXSX(S4) RP06(S4)
PXSX(S4) RP07(S4) PXSX(S4) RP08(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-4770R CPU @ 3.20GHz, 3591.96 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,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xT
PR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
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.0, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-4770R CPU @ 3.20GHz, 3588.64 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,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xT
PR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i7-4770R CPU @ 3.20GHz, 3536.38 MHz
cpu2: 
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,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xT
PR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Core(TM) i7-4770R CPU @ 3.20GHz, 3526.16 MHz
cpu3: 
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,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xT
PR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 0, core 3, package 0
cpu4 at mainbus0: apid 1 (application processor)
cpu4: Intel(R) Core(TM) i7-4770R CPU @ 3.20GHz, 3546.63 MHz
cpu4: 
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,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xT
PR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
cpu4: 256KB 64b/line 8-way L2 cache
cpu4: smt 1, core 0, package 0
cpu5 at mainbus0: apid 3 (application processor)
cpu5: Intel(R) Core(TM) i7-4770R CPU @ 3.20GHz, 3523.86 MHz
cpu5: 
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,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xT
PR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
cpu5: 256KB 64b/line 8-way L2 cache
cpu5: smt 1, core 1, package 0
cpu6 at mainbus0: apid 5 (application processor)
cpu6: Intel(R) Core(TM) i7-4770R CPU @ 3.20GHz, 3528.25 MHz
cpu6: 
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,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xT
PR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
cpu6: 256KB 64b/line 8-way L2 

Rust programming language

2015-05-19 Thread Lampshade
Hello
May 15 2015 have been a release date for Rust 1.0. What is your opinion on Rust?
Does it have any chances to be some day popular programming language? 
Do you think that learning Rust can be good for educational purposes?



Re: Rust programming language

2015-05-19 Thread Karsten König

Hey,

I follow the development of Rust since last fall and I'm really 
impressed by it. It has interesting features, e.g. memory leak safety or 
the match idiom. It was difficult to wrap my mind around many concepts 
of the language but in my opinion learning Rust is worth the effort.


About popularity: This is of course difficult to say but there are 
already popular projects, e.g. Servo which will be the new rendering 
engine for Firefox.


Greets,

Karsten

On 19.05.2015 08:36, Lampshade wrote:

Hello
May 15 2015 have been a release date for Rust 1.0. What is your opinion on Rust?
Does it have any chances to be some day popular programming language?
Do you think that learning Rust can be good for educational purposes?




Re: swap on encrypted softraid, performance penalty?

2015-05-19 Thread Jonathan Thornburg
In message http://marc.info/?l=openbsd-miscm=143181492518064w=1,
Fredrik Alm fred () fredrikalm ! com asked about how to handle the
swap partition when using whole-disk softraid crypto:
 I've seen a few 'whole disk encryption' tutorials which puts the
 swap outside of the partition used for the softraid encryption,
 since openbsd already encrypts the swap partition anyway. I assume
 that by putting the swap inside the encrypte d partition, there
 will be performance penalties because encryption is done twice?
 could someone shed a little light on this issue?

In message http://marc.info/?l=openbsd-miscm=143185210923894w=1
dan mclaughlin thevoid () openmailbox ! org replied
| where did you see those tutorials? i attempted this some months ago
| (6-7) and it was not possible to have swap outside of the softraid.
| i forget what the exact problem was (i should have taken better
| notes...). i believe the system wouldn't boot properly, and i think
| it was because the swap partition was on a different device.
and later in the thread
| honestly though, i don't know how the guy who wrote that tutorial got it to
| work (if in fact he did...), i remember it being completely unworkable. i
| think the only option was to rebuild the kernel, as you said, which really
| isn't an option.

In message http://marc.info/?l=openbsd-miscm=143185991125110w=1
Stefan Sperling stsp () stsp ! name replied
# Keeping swap on the same disk as the root filesystem has some advantages.
# For historical reasons the system expects this in various places.
# More things (such as hibernate) will work out of the box this way.

I can report that as of 5.6-stable/amd64, it *is* possible to have
swap outside the softraid.  I currently have this configuration running
on a pair of Thinkpad T60 laptops, and I'm fully satisfied with it.
Suspend-to-RAM works fine; I haven't tried hibernate.



For this configuration, I wanted separate softraid-crypto partitions
for the OS and for /home.

After a few false starts, I settled on the following layout:

  sd0
  ---   
   |  a-+- (sd1) softraid crypt, size = 44.5G
   || a = root   256M
   || d = root2  256M
   || e = var2G
   || f = var2   2G
   || g = usr20G
   || h = usr2   20G
   |   -+-
   |  b   swap   6G
   |  j-+- (sd2) softraid crypt, size = all remaining space
   || j = home
  ---  -+-

sd0 is the physical disk
It has 3 openbsd-partitions: a, b, and j

sd1 is a softraid-crypto disk living inside sd0a.  sd1 stores all the
OS partitions, currently 5.6-stable in my case.
[In my case there are actually two sets of OS partitions,
but at present I'm only using the a,e,g root,var,usr ones.
The others are for future use as backups, in the same manner
as I described (for an older OpenBSD system) in message
http://marc.info/?l=openbsd-miscm=125989140407974w=1.]

sd0b is the swap partition

sd2 is a softraid-crypto disk living inside sd0j.  sd2 stores /home.



Setting this up took a little bit of tinkering, but with a bit of guru
help on misc@, everything eventually came out fine.  Here's the procedure
that eventually worked, starting from a new-from-the-factory disk just
installed into the laptop:

boot from 5.6 CD
Install, Upgrade, Autoinstall, or Shell -- Shell

maybe type some commands so the kernel can accumulate some of entropy
in the random-number subsystem

fill the entire disk with random data:
(-- later steps won't leak which blocks have been written)
(for a big disk this may take a day or so)

   # dd if=/dev/arandom bs=1m of=/dev/sd0c

I want to use the entire physical disk for OpenBSD:

   # fdisk -i sd0

   # disklabel -E sd0
   add partitions
   a @  offset 128, size 93323264 sectors, type RAID
   bsize 6G, type swap
   jsize everything-left, type RAID

now create softraid-crypto sd1

   # cd /dev
   # sh MAKEDEV sd1
   # dd if=/dev/zero bs=1m count=1 of=/dev/rsd0a
   # bioctl -c C -r 10 -l /dev/sd0a softraid0
   (enter sd1 passphrase)
   (enter sd1 passphrase again)

This passphrase will be the boot passphrase.

Now install OpenBSD from the CD into sd1,

   # install

creating whatever OS partitions you like (in my case a,d,e,f,g,h,
as noted above).  Two notes about this:  First, put the root partition
(a) at offset 256 as per Christian Weisgerber naddy () mips ! inka ! de's
super-helpful comments in message
http://marc.info/?l=openbsd-miscm=141519757707447w=1.
And second, don't create either a swap partition (b)
or a /home partition at this point -- those will come later.

Now boot the newly-installed system (this will require entering the
boot passphrase, of course).  Once it's up and running, edit /etc/fstab
to add sd0b as a swap partition:

   /dev/sd0b   none  swap  sw  0 0

Now setup up softraid-crypto sd2 to hold /home

   # dd if=/dev/zero bs=1m count=1 of=/dev/rsd0j
   # bioctl -c C -r 10 -l 

Re: df(1) shows strange Avail and Capacity info

2015-05-19 Thread Josh Grosse

On 2015-05-19 14:25, Alex Greif wrote:

Hi,

I experienced a strange output of df(1) for the root partition.
The Size is greater than Used but Avail and Capacity are miscalculated

/root/snaps # df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/sd0a  494M488M  -18.4M   104%/
/dev/sd0k 27.6G4.7G   21.5G18%/home
/dev/sd0d  492M   86.0K467M 0%/tmp
/dev/sd0f  2.0G367M1.5G19%/usr
/dev/sd0g 1001M200M751M21%/usr/X11R6
/dev/sd0h  2.0G215M1.7G11%/usr/local
/dev/sd0j 1001M2.0K951M 0%/usr/obj
/dev/sd0i 1001M2.0K951M 0%/usr/src
/dev/sd0e  2.9G9.9M2.8G 0%/var


I believe FAQ 14.14 may clarify df(1) reporting.  Here's a link for
convenience: http://www.openbsd.org/faq/faq14.html#NegSpace



5.7 bootloader hang on Toshiba Portege M400

2015-05-19 Thread Adam Thompson
Trying to install OpenBSD 5.7-RELEASE amd64 onto a Toshiba Portege M400, 
with no success - the bootloader hangs right after printing out fd0 
hd0+.  A (very) quick perusal of boot-related manpages doesn't suggest 
anything I can do to debug this, so I'm looking for suggestions.  Do I 
need to recompile the bootloader with some debug flag set?  Did I just 
zone out while reading the relevant part of a manpage?


(FWIW, WinXP, Ubuntu 15.04 and current Sysresccd all boot OK, so I'm 
pretty sure the hardware is fine.)


--
-Adam Thompson
 athom...@athompso.net



fiber optic NIC

2015-05-19 Thread Marek Czubenko
Hi,

I'm looking for a fiber optic NIC - PCI Express, LX/LC supported by OpenBSD 4.8 
or newer.
Could someone recommend me any?

Cheers,

Marek Czubenko

Uczelniane Centrum  Information  Communication
Informatyczne   Technology Centre
Uniwersytet Mikołaja Kopernika  Nicolaus Copernicus University
Pl. Rapackiego 1,  87-100 Toruń Pl. Rapackiego 1,  87-100 Torun
tel: +48 56 611-27-38   phone: +48 56 611-27-38

  PGP: http://www.umk.pl/~mc10/pgp_public_key



Re: ifconfig alias fails

2015-05-19 Thread Otto Moerbeek
On Tue, May 19, 2015 at 03:29:20PM +0200, Heiko Zimmermann wrote:

 Hello OpenBSD Team,
 
 I try to add an ipv4 alias 176.9.157.yyy to re0
 (current from today).
 
 ifconfig re0 alias 176.9.157.yyy/27
 -- ifconfig: SIOCAIFADDR: File exists
 
 When I try: ifconfig re0 176.9.157.yyy 255.255.255.224
 -- no output
 
 But I don't see the alias ip with ifconfig -a
 
 Output is:
 re0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
 lladdr xx:xx:x:xx:xx:xx
 priority: 0
 groups: egress
 media: Ethernet autoselect (1000baseT full-duplex)
 status: active
 inet 176.9.175.xxx netmask 0xffe0 broadcast 176.9.157.zzz
 
 
 ping 176.9.157.yyy -- ping: unknown host: 176.9.157.9.yyy
 ping 176.9.157.xxx -- ok
 
 What I'm doing wrong?
 
 Thank you in advance.
 Heiko

ifconfig -a != ifconfig -A != ifconfig re0 

Also, an alias in the same net should get the mask 255.255.255.255

-Otto



Fwd: OpenTech Conference - Saturday 13th June 2015, London

2015-05-19 Thread Craig Skinner
 Forwarded Message 
Subject: OpenTech Conference - Saturday 13th June 2015, London
Sent: 18 May 2015 22:16
From: Alasdair G Kergon

Hi everyone,

With less than a month until OpenTech 2015, we're really excited by this
year's schedule. As you'll see it's a fantastic, diverse line up of
talks by a whole range of people working on issues and projects that
really matter. Go take a look at: http://www.opentech.org.uk/2015/schedule

Highlights include:
- Privacy: RIPA2 and Snowdenia
- The State of the Network Address
- Digital toilets: For your convenience
- Selling ideas
- Information Infrastructures: How do we show the thing?
- The Open Rights Group at 10 years old
- Open Health Care
- Privacy: health (Do you know where you medical records go?)
- 3 Digital Services
- I cracked 1,000 UK Government websites. Stop me!
- Data and policy
- The national election: What happened?  What's next?
- The Cult of Equity

All this and much, much more.

Tickets are GB?5 on the door, but to make sure you get in on the day,
you can pre-register here: http://www.opentech.org.uk/2015/

We're already about half booked and tickets are selling fast, so don't
miss out. And don't forget to remind your friends - OpenTech is as much
about the people attending, as the speakers.

For those who've not been before... OpenTech is an informal, low cost
(thanks Open Data Institute for sponsoring us again!), one-day
conference on slightly different approaches to technology, problems and
democracy. You are guaranteed a day of thoughtful, thought-provoking
talks leading to lively conversations with friends. Besides the
sessions, there'll be plenty of time to talk in the bar which will be
open until 10pm.


_Switch off, sit back and enjoy the show_

As ever, while there is technically some wifi in the building, as soon
as we all show up, there will no longer be any working wifi in the
building. So listen to the speakers (or your mates in the bar) rather
than compulsively refreshing twitter errors, wondering if you should
have gone to a different session based on the tweets sent over 3G.


__Wish you'd offered a talk?___

As always, we have kept a couple of talk slots in reserve, so if there
are any hot new or breaking issues you'd like to offer, that you
wouldn't have offered last month, email opent...@opentech.org.uk and we
can chat.

If you would like to help make the day as successful as previous
OpenTechs, we're also looking for a few more volunteers to help out,
email opent...@opentech.org.uk.

Oh, and did we mention? You can pre-register your tickets here:
http://www.opentech.org.uk/2015/registration


More soon,
Your friendly opentech organisers
http://www.opentech.org.uk/2015/

- End forwarded message -



ifconfig alias fails

2015-05-19 Thread Heiko Zimmermann
Hello OpenBSD Team,

I try to add an ipv4 alias 176.9.157.yyy to re0
(current from today).

ifconfig re0 alias 176.9.157.yyy/27
-- ifconfig: SIOCAIFADDR: File exists

When I try: ifconfig re0 176.9.157.yyy 255.255.255.224
-- no output

But I don't see the alias ip with ifconfig -a

Output is:
re0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
lladdr xx:xx:x:xx:xx:xx
priority: 0
groups: egress
media: Ethernet autoselect (1000baseT full-duplex)
status: active
inet 176.9.175.xxx netmask 0xffe0 broadcast 176.9.157.zzz


ping 176.9.157.yyy -- ping: unknown host: 176.9.157.9.yyy
ping 176.9.157.xxx -- ok

What I'm doing wrong?

Thank you in advance.
Heiko



Re: possible httpd Content-Length overflow

2015-05-19 Thread lists
The problem seems to be either low-memory or i386 related.  I tested on
an amd64 machine with 3GB RAM, and the problem goes away with 2+ GB
files.

The initial machine is i386 with 512MB RAM.  1GB files work fine, but
when they get stepped up to somewhere around 2GB, I start seeing the
negative Content-Length.

I'm not sure if this well help, but I'm using this as an excuse to
upgrade the problem machine to amd64.  I'll debug further or report back
if the issue goes away.



Re: possible httpd Content-Length overflow

2015-05-19 Thread lists
That does indeed fix the content length in the header.  Thanks!


On Tue, May 19, 2015 at 06:08:37PM +0200, Mark Kettenis wrote:
  The problem seems to be either low-memory or i386 related.  I tested on
  an amd64 machine with 3GB RAM, and the problem goes away with 2+ GB
  files.
 
 Does the diff below fix the issue?
 
 Index: httpd.h
 ===
 RCS file: /cvs/src/usr.sbin/httpd/httpd.h,v
 retrieving revision 1.82
 diff -u -p -r1.82 httpd.h
 --- httpd.h   15 Mar 2015 22:08:45 -  1.82
 +++ httpd.h   19 May 2015 15:58:12 -
 @@ -557,7 +557,7 @@ intserver_headers(struct client *, voi
   int (*)(struct client *, struct kv *, void *), void *);
  int   server_writeresponse_http(struct client *);
  int   server_response_http(struct client *, u_int, struct media_type *,
 - size_t, time_t);
 + off_t, time_t);
  void  server_reset_http(struct client *);
  void  server_close_http(struct client *);
  int   server_response(struct httpd *, struct client *);
 Index: server_http.c
 ===
 RCS file: /cvs/src/usr.sbin/httpd/server_http.c,v
 retrieving revision 1.79
 diff -u -p -r1.79 server_http.c
 --- server_http.c 3 May 2015 18:39:58 -   1.79
 +++ server_http.c 19 May 2015 15:58:12 -
 @@ -1133,7 +1133,7 @@ server_getlocation(struct client *clt, c
  
  int
  server_response_http(struct client *clt, u_int code,
 -struct media_type *media, size_t size, time_t mtime)
 +struct media_type *media, off_t size, time_t mtime)
  {
   struct http_descriptor  *desc = clt-clt_descreq;
   struct http_descriptor  *resp = clt-clt_descresp;
 @@ -1174,7 +1174,7 @@ server_response_http(struct client *clt,
   /* Set content length, if specified */
   if ((cl =
   kv_add(resp-http_headers, Content-Length, NULL)) == NULL ||
 - kv_set(cl, %ld, size) == -1)
 + kv_set(cl, %lld, size) == -1)
   return (-1);
  
   /* Set last modification time */



Re: df(1) shows strange Avail and Capacity info

2015-05-19 Thread Theo de Raadt
 I experienced a strange output of df(1) for the root partition.
 The Size is greater than Used but Avail and Capacity are miscalculated

That is an incorrect assessment.

There is spare space in the filesystem, only available for root, and
this is how it is handled.



df(1) shows strange Avail and Capacity info

2015-05-19 Thread Alex Greif
Hi,

I experienced a strange output of df(1) for the root partition.
The Size is greater than Used but Avail and Capacity are miscalculated

/root/snaps # df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/sd0a  494M488M  -18.4M   104%/
/dev/sd0k 27.6G4.7G   21.5G18%/home
/dev/sd0d  492M   86.0K467M 0%/tmp
/dev/sd0f  2.0G367M1.5G19%/usr
/dev/sd0g 1001M200M751M21%/usr/X11R6
/dev/sd0h  2.0G215M1.7G11%/usr/local
/dev/sd0j 1001M2.0K951M 0%/usr/obj
/dev/sd0i 1001M2.0K951M 0%/usr/src
/dev/sd0e  2.9G9.9M2.8G 0%/var

I am running a snapshot from 18. Mai 2015 on amd64 in a VM.
Please tell me if more log or other output is needed.

Thanks,
Alex.

dmesg output:

OpenBSD 5.7-current (GENERIC) #926: Mon May 18 09:52:25 MDT 2015
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
real mem = 520085504 (495MB)
avail mem = 500588544 (477MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xfd9c0 (10 entries)
bios0: vendor Bochs version Bochs date 01/01/2007
bios0: Bochs Bochs
acpi0 at bios0: rev 0
acpi0: sleep states S3 S4 S5
acpi0: tables DSDT FACP SSDT APIC HPET SSDT
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz, 2394.22 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AES,HV,NXE,PAGE1GB,LONG,LAHF
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu0: ITLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
cpu0: DTLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 1000MHz
ioapic0 at mainbus0: apid 1 pa 0xfec0, version 11, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 1
acpihpet0 at acpi0: 1 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel 82441FX rev 0x02
pcib0 at pci0 dev 1 function 0 Intel 82371SB ISA rev 0x00
pciide0 at pci0 dev 1 function 1 Intel 82371SB IDE rev 0x00: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
pciide0: channel 0 disabled (no drives)
atapiscsi0 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: QEMU, QEMU DVD-ROM, 1.1. ATAPI 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
uhci0 at pci0 dev 1 function 2 Intel 82371SB USB rev 0x01: apic 1 int 11
piixpm0 at pci0 dev 1 function 3 Intel 82371AB Power rev 0x03: apic 1 int 10
iic0 at piixpm0
iic0: addr 0x18 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
iic0: addr 0x1a 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
iic0: addr 0x29 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
iic0: addr 0x2b 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
iic0: addr 0x4c 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
iic0: addr 0x4e 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
vga1 at pci0 dev 2 function 0 Cirrus Logic CL-GD5446 rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
virtio0 at pci0 dev 3 function 0 Qumranet Virtio Network rev 0x00: Virtio 
Network Device
vio0 at virtio0: address 52:54:c1:10:f2:79
virtio0: apic 1 int 11
virtio1 at pci0 dev 4 function 0 Qumranet Virtio Storage rev 0x00: Virtio 
Block Device
vioblk0 at virtio1
scsibus2 at vioblk0: 2 targets
sd0 at scsibus2 targ 0 lun 0: VirtIO, Block Device,  SCSI3 0/direct fixed
sd0: 40960MB, 512 bytes/sector, 83886080 sectors
virtio1: apic 1 int 11
virtio2 at pci0 dev 5 function 0 Qumranet Virtio Memory rev 0x00: Virtio 
Memory Balloon Device
viomb0 at virtio2
virtio2: apic 1 int 10
isa0 at pcib0
isadma0 at isa0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: density unknown
fd1 at fdc0 drive 1: density unknown
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot): using irq 1
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot): using irq 12
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
usb0 at uhci0: USB 

Re: swap on encrypted softraid, performance penalty?

2015-05-19 Thread Ted Unangst
dan mclaughlin wrote:
 in the end i found it easier to just leave it all in the softraid for other
 reasons in addition to that issue. as to swap encryption, i disabled it. no
 need to encrypt twice.
 

to the contrary, uvm swap encrypt does a better job of expiring keys and
making old data unrecoverable.



Re: df(1) shows strange Avail and Capacity info

2015-05-19 Thread John Merriam
On Tue, 19 May 2015, Theo de Raadt wrote:

  I experienced a strange output of df(1) for the root partition.
  The Size is greater than Used but Avail and Capacity are miscalculated
 
 That is an incorrect assessment.
 
 There is spare space in the filesystem, only available for root, and
 this is how it is handled.
 

Yes, df is functioning correctly.  It looks like you have 5% of the space 
on your / partition reserved for the root user.  You have less than 5% of 
the space on / available.  When you have less than the reserved amount of 
space available on a partition df will show greater than 100% capacity 
used and a negative amount of space available.  It's sort of a warning.  
If any process that is not owned by root tries to write something to your 
/ partition, it will fail.  You can see the percentage of reserved space 
on your / partition with:

tunefs -N /

You can also see a description of this feature in the notes for the -m 
option in the tunefs(8) man page.

-- 

John Merriam



Re: Update OpenBSD Remotely

2015-05-19 Thread Raf Czlonka
On Tue, May 19, 2015 at 06:47:59AM BST, Doug Hogan wrote:
 On Sun, May 17, 2015 at 11:52:19PM +0100, Raf Czlonka wrote:
  There are several things which this script does not check for - some
  of those are on my TODO list:
 
 I didn't review your script, but I did ctrl+s...
 
 TODO item #0 should be to use signify with SHA256.sig rather than
 checking SHA256 directly.  There's an example in the man page. :)
 
 SHA-256 checks if the files were downloaded properly, but it does not
 check if the files are from us.  signify with SHA256.sig provides both
 integrity and authentication.

Hi Doug,

Well, I relied on the fact that the installer does that anyway... but
you are right, given the fact that we now have signify, it is the right
approach - it is also cleaner than what I had before.

Thanks for the tip!

Raf



netstat doubles packet count on output

2015-05-19 Thread Hrvoje Popovski
Hi all,

today i have update test box from cvs and it seems that netstat doubles
packet count on output. anyone else sees the same thing?

pf disabled
box on ix1 generate traffic
box on ix0 receive same amount of traffic as in total in packets

kern.pool_debug=0
net.inet.ip.forwarding=1
net.inet.ip.ifq.maxlen=8192

net.inet.ip.ifq.drops=0
kern.netlivelocks=3


# netstat -iw1
  em0 inem0 out  total in  total out
 packets  errs  packets  errs colls   packets  errs  packets  errs colls
2055 0 2017 0 0  481662247 0 963243956 0 0
   1 03 0 0660962 0  1328389 0 0
   1 02 0 0671915 0  1344282 0 0
   1 02 0 0673261 0  1345778 0 0
   3 02 0 0669016 0  1338812 0 0

# netstat -I ix0 -w1
  ix0 inix0 out  total in  total out
 packets  errs  packets  errs colls   packets  errs  packets  errs colls
  104032 0 977478094 0 0  488847789 0 977618583 0 0
  51 0  1326270 0 0661349 0  1326376 0 0
  39 0  1340976 0 0670325 0  1341054 0 0
  62 0  1341340 0 0670730 0  1341466 0 0
  44 0  1340355 0 0670254 0  1340445 0 0

# netstat -I ix1 -w1
  ix1 inix1 out  total in  total out
 packets  errs  packets  errs colls   packets  errs  packets  errs colls
493318725 0   139536 0 0  493425441 0 986766963 0 0
  665502 0  176 0 0665595 0  1338842 0 0
  663956 0  122 0 0664015 0  1331334 0 0
  672944 0  126 0 0673008 0  1343214 0 0
  668028 0  106 0 0668082 0  1338952 0 0



Re: possible httpd Content-Length overflow

2015-05-19 Thread Mark Kettenis
 The problem seems to be either low-memory or i386 related.  I tested on
 an amd64 machine with 3GB RAM, and the problem goes away with 2+ GB
 files.

Does the diff below fix the issue?

Index: httpd.h
===
RCS file: /cvs/src/usr.sbin/httpd/httpd.h,v
retrieving revision 1.82
diff -u -p -r1.82 httpd.h
--- httpd.h 15 Mar 2015 22:08:45 -  1.82
+++ httpd.h 19 May 2015 15:58:12 -
@@ -557,7 +557,7 @@ int  server_headers(struct client *, voi
int (*)(struct client *, struct kv *, void *), void *);
 int server_writeresponse_http(struct client *);
 int server_response_http(struct client *, u_int, struct media_type *,
-   size_t, time_t);
+   off_t, time_t);
 voidserver_reset_http(struct client *);
 voidserver_close_http(struct client *);
 int server_response(struct httpd *, struct client *);
Index: server_http.c
===
RCS file: /cvs/src/usr.sbin/httpd/server_http.c,v
retrieving revision 1.79
diff -u -p -r1.79 server_http.c
--- server_http.c   3 May 2015 18:39:58 -   1.79
+++ server_http.c   19 May 2015 15:58:12 -
@@ -1133,7 +1133,7 @@ server_getlocation(struct client *clt, c
 
 int
 server_response_http(struct client *clt, u_int code,
-struct media_type *media, size_t size, time_t mtime)
+struct media_type *media, off_t size, time_t mtime)
 {
struct http_descriptor  *desc = clt-clt_descreq;
struct http_descriptor  *resp = clt-clt_descresp;
@@ -1174,7 +1174,7 @@ server_response_http(struct client *clt,
/* Set content length, if specified */
if ((cl =
kv_add(resp-http_headers, Content-Length, NULL)) == NULL ||
-   kv_set(cl, %ld, size) == -1)
+   kv_set(cl, %lld, size) == -1)
return (-1);
 
/* Set last modification time */



Re: Robustness in ports fetch program?

2015-05-19 Thread Stuart Henderson
On 2015-05-17, Alan Corey alan01...@gmail.com wrote:
 I didn't look at what FETCH_CMD was defined as by default, I just assumed
 defining something non-null changed it.  I did notice that when it retries
 it's wrongly assumed there's a problem with the first source and gone to
 another.

That's a reasonable supposition because in the majority of cases, it's correct
and you do want to move on to another host. It's common to see files which
are no longer present return an error page with a 200 OK response; when
that happens you *have* to move on.

 Does every developer have perfect internet?  That's very frustrating, maybe
 counterproductive in testing.  Try a modem, you can probably find a free
 one.  Connection interruptions and resets happen many times a day.

Modem, yeah easy. Dialup ISP not so much. Per-minute connection charges in
many cases too. But then back when I was on dialup I didn't get that many
interruptions/resets, and when they did happen TCP sessions generally
recovered. People tended to use specialist download programs for anything
large though, maybe you should too?