5.2 : ssd support!

2012-12-17 Thread Mayuresh Kathe

hello,

i'm running 5.2 (amd64) on my existing machine (dmesg below mail).
works great, except for heating problems and lowered battery life.
have experimented and run tests (windows 7, ubuntu 12.04.1 and memtest).

the heating and battery life problems only surface under openbsd.

wondered if replacing my regular hdd with a ssd might solve both problems 
in one shot.


hence my question, how good or bad is the ssd support under 5.2?.
most of my usage would be software development using either lisp, c and 
c++ (at the console, no x).


best.

~mayuresh

-- dmesg --
OpenBSD 5.2 (GENERIC) #309: Wed Aug  1 09:58:55 MDT 2012
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
real mem = 4024238080 (3837MB)
avail mem = 3894771712 (3714MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xf0900 (43 entries)
bios0: vendor LENOVO version 6XET50WW (1.33 ) date 03/14/2012
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP TCPA SSDT APIC MCFG HPET SLIC
acpi0: wakeup devices PB5_(S5) OHC0(S3) OHC1(S3) OHC2(S3) OHC3(S3) OHC4(S3) 
P2P_(S5) LID_(S3)
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD Athlon(tm) Neo Processor MV-40, 1597.29 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3,CX16,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW,LAHF,SVM,EAPICSP,AMCR8,3DNOWP
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu0: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu0: DTLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu0: apic clock running at 199MHz
ioapic0 at mainbus0: apid 1 pa 0xfec0, version 21, 24 pins
acpimcfg0 at acpi0 addr 0xe000, bus 0-3
acpihpet0 at acpi0: 14318180 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (PB5_)
acpiprt2 at acpi0: bus 4 (P2P_)
acpiprt3 at acpi0: bus 1 (AGP_)
acpiec0 at acpi0
acpicpu0 at acpi0: C3, C2, PSS
acpitz0 at acpi0: critical temperature is 92 degC
acpibtn0 at acpi0: PWRB
acpibtn1 at acpi0: SLPB
acpithinkpad0 at acpi0
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT1 model 42T4789 serial 10259 type LION oem LGC 11
acpibtn2 at acpi0: LID_
cpu0: PowerNow! K8 1597 MHz: speeds: 1600 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 AMD RS780 Host rev 0x00
ppb0 at pci0 dev 1 function 0 AMD RS780 PCIE rev 0x00
pci1 at ppb0 bus 1
vga1 at pci1 dev 5 function 0 ATI Radeon HD 3200 rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
radeondrm0 at vga1: apic 1 int 18
drm0 at radeondrm0
ppb1 at pci0 dev 5 function 0 AMD RS780 PCIE rev 0x00: msi
pci2 at ppb1 bus 2
re0 at pci2 dev 0 function 0 Realtek 8168 rev 0x03: RTL8168D/8111D (0x2800), 
apic 1 int 17, address 00:26:9e:b2:c9:58
rgephy0 at re0 phy 7: RTL8169S/8110S PHY, rev. 2
ppb2 at pci0 dev 6 function 0 AMD RS780 PCIE rev 0x00: msi
pci3 at ppb2 bus 3
Realtek 8192SE rev 0x10 at pci3 dev 0 function 0 not configured
ahci0 at pci0 dev 17 function 0 ATI SBx00 SATA rev 0x00: apic 1 int 22, AHCI 
1.1
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: ATA, ST9320325AS, 0020 SCSI3 0/direct fixed 
naa.5000c5001eeca42f
sd0: 305245MB, 512 bytes/sector, 625142448 sectors
ohci0 at pci0 dev 18 function 0 ATI SB700 USB rev 0x00: apic 1 int 16, 
version 1.0, legacy support
ohci1 at pci0 dev 18 function 1 ATI SB700 USB rev 0x00: apic 1 int 16, 
version 1.0, legacy support
ehci0 at pci0 dev 18 function 2 ATI SB700 USB2 rev 0x00: apic 1 int 17
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 ATI EHCI root hub rev 2.00/1.00 addr 1
ohci2 at pci0 dev 19 function 0 ATI SB700 USB rev 0x00: apic 1 int 18, 
version 1.0, legacy support
ehci1 at pci0 dev 19 function 2 ATI SB700 USB2 rev 0x00: apic 1 int 19
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 ATI EHCI root hub rev 2.00/1.00 addr 1
piixpm0 at pci0 dev 20 function 0 ATI SBx00 SMBus rev 0x3c: SMI
iic0 at piixpm0
spdmem0 at iic0 addr 0x50: 2GB DDR2 SDRAM non-parity PC2-5300CL5 SO-DIMM
spdmem1 at iic0 addr 0x51: 2GB DDR2 SDRAM non-parity PC2-5300CL5 SO-DIMM
azalia0 at pci0 dev 20 function 2 ATI SBx00 HD Audio rev 0x00: apic 1 int 16
azalia0: codecs: Conexant/0x5066
audio0 at azalia0
pcib0 at pci0 dev 20 function 3 ATI SB700 ISA rev 0x00
ppb3 at pci0 dev 20 function 4 ATI SB600 PCI rev 0x00
pci4 at ppb3 bus 4
pchb1 at pci0 dev 24 function 0 AMD AMD64 0Fh HyperTransport rev 0x00
pchb2 at pci0 dev 24 function 1 AMD AMD64 0Fh Address Map rev 0x00
pchb3 at pci0 dev 24 function 2 AMD AMD64 0Fh DRAM Cfg rev 0x00
kate0 at pci0 dev 24 function 3 AMD AMD64 0Fh Misc Cfg rev 0x00: core rev 
DH-G2
usb2 at ohci0: USB revision 1.0
uhub2 at usb2 ATI OHCI root hub rev 1.00/1.00 addr 1
usb3 at ohci1: USB revision 1.0
uhub3 at usb3 ATI OHCI root hub rev 1.00/1.00 addr 1
usb4 at ohci2: USB revision 1.0
uhub4 at usb4 ATI OHCI root hub 

Re: 5.2 : ssd support!

2012-12-17 Thread mxb
It's just a disk.

sd0 at scsibus0 targ 0 lun 0: ATA, INTEL SSDSA2CT04, 4PC1 SCSI3 0/direct 
fixed naa.500151795956a9d6
sd0: 38166MB, 512 bytes/sector, 78165360 sectors, thin


On 17 dec 2012, at 09:32, Mayuresh Kathe mayur...@wolfman.devio.us wrote:

 hello,
 
 i'm running 5.2 (amd64) on my existing machine (dmesg below mail).
 works great, except for heating problems and lowered battery life.
 have experimented and run tests (windows 7, ubuntu 12.04.1 and memtest).
 
 the heating and battery life problems only surface under openbsd.
 
 wondered if replacing my regular hdd with a ssd might solve both problems in 
 one shot.
 
 hence my question, how good or bad is the ssd support under 5.2?.
 most of my usage would be software development using either lisp, c and c++ 
 (at the console, no x).
 
 best.
 
 ~mayuresh
 
 -- dmesg --
 OpenBSD 5.2 (GENERIC) #309: Wed Aug  1 09:58:55 MDT 2012
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
 real mem = 4024238080 (3837MB)
 avail mem = 3894771712 (3714MB)
 mainbus0 at root
 bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xf0900 (43 entries)
 bios0: vendor LENOVO version 6XET50WW (1.33 ) date 03/14/2012
 acpi0 at bios0: rev 2
 acpi0: sleep states S0 S3 S4 S5
 acpi0: tables DSDT FACP TCPA SSDT APIC MCFG HPET SLIC
 acpi0: wakeup devices PB5_(S5) OHC0(S3) OHC1(S3) OHC2(S3) OHC3(S3) OHC4(S3) 
 P2P_(S5) LID_(S3)
 acpitimer0 at acpi0: 3579545 Hz, 32 bits
 acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
 cpu0 at mainbus0: apid 0 (boot processor)
 cpu0: AMD Athlon(tm) Neo Processor MV-40, 1597.29 MHz
 cpu0: 
 FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3,CX16,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW,LAHF,SVM,EAPICSP,AMCR8,3DNOWP
 cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 
 64b/line 16-way L2 cache
 cpu0: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative
 cpu0: DTLB 32 4KB entries fully associative, 8 4MB entries fully associative
 cpu0: apic clock running at 199MHz
 ioapic0 at mainbus0: apid 1 pa 0xfec0, version 21, 24 pins
 acpimcfg0 at acpi0 addr 0xe000, bus 0-3
 acpihpet0 at acpi0: 14318180 Hz
 acpiprt0 at acpi0: bus 0 (PCI0)
 acpiprt1 at acpi0: bus 2 (PB5_)
 acpiprt2 at acpi0: bus 4 (P2P_)
 acpiprt3 at acpi0: bus 1 (AGP_)
 acpiec0 at acpi0
 acpicpu0 at acpi0: C3, C2, PSS
 acpitz0 at acpi0: critical temperature is 92 degC
 acpibtn0 at acpi0: PWRB
 acpibtn1 at acpi0: SLPB
 acpithinkpad0 at acpi0
 acpiac0 at acpi0: AC unit online
 acpibat0 at acpi0: BAT1 model 42T4789 serial 10259 type LION oem LGC 11
 acpibtn2 at acpi0: LID_
 cpu0: PowerNow! K8 1597 MHz: speeds: 1600 800 MHz
 pci0 at mainbus0 bus 0
 pchb0 at pci0 dev 0 function 0 AMD RS780 Host rev 0x00
 ppb0 at pci0 dev 1 function 0 AMD RS780 PCIE rev 0x00
 pci1 at ppb0 bus 1
 vga1 at pci1 dev 5 function 0 ATI Radeon HD 3200 rev 0x00
 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
 wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
 radeondrm0 at vga1: apic 1 int 18
 drm0 at radeondrm0
 ppb1 at pci0 dev 5 function 0 AMD RS780 PCIE rev 0x00: msi
 pci2 at ppb1 bus 2
 re0 at pci2 dev 0 function 0 Realtek 8168 rev 0x03: RTL8168D/8111D 
 (0x2800), apic 1 int 17, address 00:26:9e:b2:c9:58
 rgephy0 at re0 phy 7: RTL8169S/8110S PHY, rev. 2
 ppb2 at pci0 dev 6 function 0 AMD RS780 PCIE rev 0x00: msi
 pci3 at ppb2 bus 3
 Realtek 8192SE rev 0x10 at pci3 dev 0 function 0 not configured
 ahci0 at pci0 dev 17 function 0 ATI SBx00 SATA rev 0x00: apic 1 int 22, 
 AHCI 1.1
 scsibus0 at ahci0: 32 targets
 sd0 at scsibus0 targ 0 lun 0: ATA, ST9320325AS, 0020 SCSI3 0/direct fixed 
 naa.5000c5001eeca42f
 sd0: 305245MB, 512 bytes/sector, 625142448 sectors
 ohci0 at pci0 dev 18 function 0 ATI SB700 USB rev 0x00: apic 1 int 16, 
 version 1.0, legacy support
 ohci1 at pci0 dev 18 function 1 ATI SB700 USB rev 0x00: apic 1 int 16, 
 version 1.0, legacy support
 ehci0 at pci0 dev 18 function 2 ATI SB700 USB2 rev 0x00: apic 1 int 17
 usb0 at ehci0: USB revision 2.0
 uhub0 at usb0 ATI EHCI root hub rev 2.00/1.00 addr 1
 ohci2 at pci0 dev 19 function 0 ATI SB700 USB rev 0x00: apic 1 int 18, 
 version 1.0, legacy support
 ehci1 at pci0 dev 19 function 2 ATI SB700 USB2 rev 0x00: apic 1 int 19
 usb1 at ehci1: USB revision 2.0
 uhub1 at usb1 ATI EHCI root hub rev 2.00/1.00 addr 1
 piixpm0 at pci0 dev 20 function 0 ATI SBx00 SMBus rev 0x3c: SMI
 iic0 at piixpm0
 spdmem0 at iic0 addr 0x50: 2GB DDR2 SDRAM non-parity PC2-5300CL5 SO-DIMM
 spdmem1 at iic0 addr 0x51: 2GB DDR2 SDRAM non-parity PC2-5300CL5 SO-DIMM
 azalia0 at pci0 dev 20 function 2 ATI SBx00 HD Audio rev 0x00: apic 1 int 16
 azalia0: codecs: Conexant/0x5066
 audio0 at azalia0
 pcib0 at pci0 dev 20 function 3 ATI SB700 ISA rev 0x00
 ppb3 at pci0 dev 20 function 4 ATI SB600 PCI rev 0x00
 pci4 at ppb3 bus 4
 pchb1 at pci0 dev 24 function 0 AMD AMD64 0Fh HyperTransport rev 0x00
 pchb2 at pci0 dev 24 function 1 AMD AMD64 0Fh Address Map rev 0x00
 pchb3 at pci0 dev 24 

Re: OpenBSD desktop

2012-12-17 Thread Janne Johansson
2012/12/17 Robert Connolly rob...@secondfloor.ca:
 Hello.

 I have heard on IRC that I am running a vulnerable version of Firefox,
 despite running 'pkg_add -a -u', on my OpenBSD 5.2 system. The advice I got
 was to run snapshots, because OpenBSD does not have the human resources to
 maintain packages. I understand this is a problem, but I want to understand
 the best way of dealing with this problem.

 Am I expected to run 'pkg_add -a -u -n' daily, and then decide when to
 update to a -current snapshot and package tree? I am not being sarcastic...
 I have every intention of continuing to run OpenBSD, and I would like to
 know the best way of doing it.

http://www.openbsd.org/faq/faq15.html#NoFun
That one pretty much describes the expectations.
Either go with release, or go with the flow. Doing just-update-ports
and keeping an old installation of the OS will not work for long.

-- 
 To our sweethearts and wives.  May they never meet. -- 19th century toast



Re: OpenBSD desktop

2012-12-17 Thread Tomas Bodzar
On Mon, Dec 17, 2012 at 7:13 AM, Robert Connolly rob...@secondfloor.ca wrote:
 Hello.

 I have heard on IRC that I am running a vulnerable version of Firefox,
 despite running 'pkg_add -a -u', on my OpenBSD 5.2 system. The advice I got
 was to run snapshots, because OpenBSD does not have the human resources to
 maintain packages. I understand this is a problem, but I want to understand
 the best way of dealing with this problem.

 Am I expected to run 'pkg_add -a -u -n' daily, and then decide when to
 update to a -current snapshot and package tree? I am not being sarcastic...
 I have every intention of continuing to run OpenBSD, and I would like to
 know the best way of doing it.

On snapshots it's more easy. You do just upgrade from bsd.rd (like
regular install), after reboot sysmerge -s -x is your friend, check of
current.html in FAQ and pkg_add -ui. Completely binary process which
takes about 15 minutes or so. It depends on you how often you will do
that if every week, every day, once a month or so. Of course if you
will see during install of package some weird messages about libraries
or something else then it's good sign of need for update :-)


 Thank you.



Re: ifOperStatus of em(4) devices always unknown when link is up

2012-12-17 Thread InterNetX - Carsten Schoene
Hello Reyk,

do you have an update for me?

Carsten

Am 04.12.2012 10:26, schrieb InterNetX - Carsten Schoene:
 Am 04.12.2012 00:57, schrieb Reyk Floeter:
 Am Montag, 3. Dezember 2012 schrieb InterNetX - Carsten Schoene :

 Hello,

 i've setup a OpenBSD 5.2 (amd64) system using flashrd on a DELL R610
 server,
 with an Intel PRO/1000 PF (82571EB) dualport fibre optics adapter.
 The system also have four broadcom BCM5709 copper interfaces.

 I try to monitor the linkstate of these interface using the default
 snmpd. The linkstate for the bnx interfaces are always correct (up), only
 the em interfaces report unknown when the link is in state up


 Some drivers/chipsets don't report their link state correctly and unknown
 is actually a valid fallback in this case. I will have a look at this.

 Can you show me the output of route -n monitor while toggling the link?
 Hello Reyk,
 
 sure, the relevant output is:
 
 got message of size 248 on Tue Dec  4 10:17:24 2012
 RTM_IFINFO: iface status change: len 248, if# 1, name: em0, link: no carrier,
 flags:UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST
 
 got message of size 248 on Tue Dec  4 10:18:29 2012
 RTM_IFINFO: iface status change: len 248, if# 1, name: em0, link: active,
 flags:UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST
 
 Carsten

 Reyk


 # ifconfig em0
 em0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
 lladdr xx:xx:xx:xx:xx:xx
 description: Uplink
 priority: 0
 media: Ethernet 1000baseSX full-duplex
 status: active
 inet xxx:xxx:xxx:xxx netmask 0xfff8 broadcast xxx:xxx:xxx:xxx
 inet6 :::::%em0 pre

 # snmpwalk -v 1 -c public localhost IF | grep -i -E '(ifoper|ifdescr)'
 IF-MIB::ifDescr.1 = STRING: em0
 IF-MIB::ifDescr.2 = STRING: em1
 IF-MIB::ifDescr.3 = STRING: enc0
 IF-MIB::ifDescr.4 = STRING: lo0
 IF-MIB::ifDescr.5 = STRING: bnx0
 IF-MIB::ifDescr.6 = STRING: bnx1
 IF-MIB::ifDescr.7 = STRING: bnx2
 IF-MIB::ifDescr.8 = STRING: bnx3
 IF-MIB::ifOperStatus.1 = INTEGER: unknown(4)
 IF-MIB::ifOperStatus.2 = INTEGER: down(2)
 IF-MIB::ifOperStatus.3 = INTEGER: down(2)
 IF-MIB::ifOperStatus.4 = INTEGER: unknown(4)
 IF-MIB::ifOperStatus.5 = INTEGER: down(2)
 IF-MIB::ifOperStatus.6 = INTEGER: down(2)
 IF-MIB::ifOperStatus.7 = INTEGER: up(1)
 IF-MIB::ifOperStatus.8 = INTEGER: up(1)

 If i shutdown the interface ifconfig em0 down, it's state is correctly
 reported as down.

 I can reproduce this on a vmware virtual machine running a plain OpenBSD
 5.2 ( no flashrd setup).
 The used intel based adapter is reported as Intel PRO/1000MT (82545EM)
 and behaves the same
 like on my physical server. I also disabled the connected state from
 vmware side and the
 interface reports it's state correctly as lowerLayerDown(7) within snmp.

 I also tested with 5.1 release on vmware, with the same results.

 It looks like a kernel/driver problem for me.

 Any help would be appreciated.


 Regards,
 --
 Carsten Schöne
 

-- 
Carsten Schöne
Leiter Rechenzentrum

InterNetX GmbH
Maximilianstr. 6
93047 Regensburg

Tel.   +49 941 59559-480
Fax   +49 941 59579-051

www.internetx.com
www.facebook.com/InterNetX
www.twitter.com/InterNetX

Geschäftsführer/CEO: Thomas Mörz
Amtsgericht Regensburg, HRB 7142



Re: login_radius support for encrypted authentication type?

2012-12-17 Thread Aleš Golob
Hi.

The problem is not storing the passwords in the clear as the RADIUS server is 
actually a Windows 2008 R2 NPS server, it is however that PAP sends ASCII 
charecters unencrypted over the wire as opposed to other EAP solutions or even 
CHAP.
So as the password with PAP may or may not be encrypted on the wire it most 
certainly is with CHAP. The NTLM hashes have no influence here as the only task 
of login_radius is to send the username and password to a RADIUS server and 
wait for it's Granted/Denied response.
But the method i uses to send and recieve that information could be cruical. So 
the real question is does login_radius hash or encrypt the password it sends 
and is there an option to use CHAP or did someone think that PAP is good enough?
Like I said this is not really a show-stopper but I am baffled somewhat by the 
fact that OpenBSD is touted to be security centric to the point of code audits 
and yet it supports only PAP.

Aleš Golob

 -Original Message-
 From: owner-m...@openbsd.org [mailto:owner-m...@openbsd.org] On
 Behalf Of Stephen Spencer
 Sent: Thursday, December 13, 2012 3:32 PM
 To: misc@openbsd.org
 Subject: Re: login_radius support for encrypted authentication type?
 
 I haven't worked with OpenBSD in this context,  but I've setup 802.1X auth
 for layer-2 wireless.  It's LDAP backed.   We happen to also run a samba3
 domain,  so LDAP also stores NTLM hashes.  I'm not a radius expert,  but the
 only mechanism that seems to be able to deal with non clear passwords
 seem to have to deal with NTLM hashes.   If there isn't a way to pass the
 auth request through some kind of layer that will give you a pass/fail
 response,  I'm pretty sure you're stuck with having to store your radius
 passwords in the clear.
 
 -Stephen



Re: KSH command logged to syslog

2012-12-17 Thread Stuart Henderson
On 2012-12-16, David Coppa dco...@gmail.com wrote:
 .profile can be interrupted with ctrl+c.

 Because it is under controle or the user and he/she can disable
 such funcionality.

 the safer way imho is patching ksh

Wouldn't it be better to use an ssh forced command, which then looks
up the users desired shell (or other command called directly from ssh)
and wraps it in a logger?



Re: Wireless WPA and crypto hardware

2012-12-17 Thread Stuart Henderson
On 2012-12-15, Martin Kjær Jørgensen m...@gotu.dk wrote:
 On Sat, Dec 15, 2012 at 11:03:00AM +0100, Tobias Ulmer wrote:
 On Sat, Dec 15, 2012 at 09:52:28AM +0100, Martin Kjær Jørgensen wrote:
  Hi misc
  
  Can a wireless interface (say, athn) make use of a hardware crypto card
  like hifn when using WPA/WPA2 as encryption?
 
 From a quick look through the kernel:
 
 No, net80211 does not use the crypto framework, therefore it can not use
 any hardware crypto devices.
 
 Usually the chip itself can do the necessary operations, but that seems
 disabled. It's all done in software, I think.
 
 More generally, modern CPUs hardly break a sweat doing a few crypto
 ops.  The overhead to talk to accelerator cards is usually large and
 only makes sense on (really) slow hardware. Then there is the whole
 issue of bus bandwidth and transferring the same data n times.

 Do you think an AMD Elan 133 Mhz is modern enough for at 54/mbit
 wireless WPA2 throughput?

No but neither will it be quick enough that pumping the data to
a PCI-based crypto accelerator is going to work well.



Re: AR9485WB-EG libre port

2012-12-17 Thread Stuart Henderson
On 2012-12-15, System Administrator ad...@bitwise.net wrote:
 On 14 Dec 2012 at 16:43, Sha'ul wrote:

 The driver for AR9485 seems to be fully function in libre Linux from
 what I've tried, don't need the vanilla Linux version for at least the
 wifi to work. Would it not be possible to thereby port over the libre
 linux driver version to get some kind of code going to start hacking on
 to support wifi?
 

 Your code is welcome, but remember you must re-develop, you cannot 
 port -- your driver must be independently developed and free of the 
 GPL code (mandatory for libre linux and not compatible with BSD 
 kernel).

Why? The ath9k driver in Linux is ISC licensed.



Re: login_radius support for encrypted authentication type?

2012-12-17 Thread Stuart Henderson
On 2012-12-13, Aleš Golob ales.go...@gora.si wrote:
 Hi!

 I have an OpenBSD 5.2 installation on a Soekris net4801 used as
 a router, DNS server and a SSH tunnel proxy.

 I have configured the login_radius service in my login.conf and
 all works reasonably well but from what I can tell login_radius
 only supports the clear-text PAP authentication type.

Normally PAP is used as part of PPP and then the PPP server can use
RADIUS to check this password. In this case the cleartext part is where
the password is sent from the PPP client to server. If RADIUS is then
used to authenticate that password, it does *not* use a clear-text
password protocol, the protocol is explained here:

http://tools.ietf.org/html/rfc2865#page-27

Note: while not clear-text, PAP is not a modern high-security protocol.
You probably want to protect it at a lower layer, either with IPsec or
similar, or via physically secured networks.

Note 2: while not clear-text, CHAP is not a modern high-security protocol.
You probably want to protect it at a lower layer, either with IPsec or
similar, or via physically secured networks.

Additionally CHAP requires that the authentication server have access
to a plaintext copy of the user's password. If the auth server is
successfully attacked *all* user passwords can be obtained.

 So my question is am I missing something and it's possible to use
 CHAP or any other encrypted auth types with login_radius

You're not missing anything, login_radius doesn't support CHAP.

 I would normaly not make a fuss about it but OpenBSD being as
 security centric as it is I find it a bit awkward it would support
 only a plain-text method in such an important auth mechanism.

IMHO adding CHAP support to login_radius would be useless. The case
it is trying to protect is where the user's password is sent over a
clear channel as with PPP/PPPoE/L2TP; login_radius isn't used for these.
EAP might be of more interest but only a couple of mechanisms are valid
for what login_radius does; EAP-TTLS + password authentication (which
can functionally be replaced with IPsec + password auth), or possibly
EAP-PSK using the password as the key (in which case, as with CHAP,
the auth server would require unencrypted access to the key).



Re: KSH command logged to syslog

2012-12-17 Thread Jiri B
On Mon, Dec 17, 2012 at 02:03:03PM +, Stuart Henderson wrote:
 Wouldn't it be better to use an ssh forced command, which then looks
 up the users desired shell (or other command called directly from ssh)
 and wraps it in a logger?

ForceCommand runs under destination user permissions so if you
won't make your ForceCommand app setuid the user could delete
the log file.

jirib



Re: KSH command logged to syslog

2012-12-17 Thread Stuart Henderson
On 2012/12/17 10:42, Jiri B wrote:
 On Mon, Dec 17, 2012 at 02:03:03PM +, Stuart Henderson wrote:
  Wouldn't it be better to use an ssh forced command, which then looks
  up the users desired shell (or other command called directly from ssh)
  and wraps it in a logger?
 
 ForceCommand runs under destination user permissions so if you
 won't make your ForceCommand app setuid the user could delete
 the log file.

you probably don't want it on the same machine anyway..



Re: Wireless WPA and crypto hardware

2012-12-17 Thread Christian Weisgerber
Stuart Henderson s...@spacehopper.org wrote:

  Do you think an AMD Elan 133 Mhz is modern enough for at 54/mbit
  wireless WPA2 throughput?
 
 No but neither will it be quick enough that pumping the data to
 a PCI-based crypto accelerator is going to work well.

Indeed.  Also, we don't support any PCI-based crypto accelerators
that would handle AES-CCM in the first place.

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: 5.2 : ssd support!

2012-12-17 Thread Chris Cappuccio
Mayuresh Kathe [mayur...@wolfman.devio.us] wrote:
 
 hence my question, how good or bad is the ssd support under 5.2?.
 most of my usage would be software development using either lisp, c
 and c++ (at the console, no x).
 

There is some TRIM command support, not sure how extensive it is, but if I 
recall properly, there is some, or someone is thinking about it.

There is also a problem with some SSDs and the AHCI driver. They don't work in 
AHCI mode, you have to move down to the older IDE interface to use them (which 
isn't an option with some newer systems!) This isn't tracked down and fixed 
yet. I have a device that displays the problem and I am going to investigate it 
further.

Chris



Re: 5.2 : ssd support!

2012-12-17 Thread Mayuresh Kathe

On Mon, 17 Dec 2012, Chris Cappuccio wrote:


There is also a problem with some SSDs and the AHCI driver.


any way to find out which ssd drives don't work with the ahci driver?

as far as the real problem of excessive heating and power drain goes;
i've been using the apmd with '-C' flag (on micha's advice),
there's some scaling down of temperatures, but, not much.
any other suggestions?

thanks.



Re: 5.2 : ssd support!

2012-12-17 Thread Dustin Fechner
On 12/17/2012 09:32 AM, Mayuresh Kathe wrote:
 hence my question, how good or bad is the ssd support under 5.2?. 

Like mxb pointed out, it's just a normal disk to OpenBSD. So don't
expect any special SSD support (for example TRIM command).
I own a netbook with an Intel 320 SSD which runs 5.1 (will soon upgrade)
and so far I didn't experienced any problems.

 the heating and battery life problems only surface under openbsd.
 wondered if replacing my regular hdd with a ssd might solve both
 problems in one shot.

I don't think that this will solve your problems.
Have you tried 'apmd -C'? Your dmesg says:
 cpu0: PowerNow! K8 1597 MHz: speeds: 1600 800 MHz
So it should be at least worth a try.

If you are running Xorg, you could also set some options for the radeon
driver in your xorg.conf, for example:
Option ClockGating on
Option ForceLowPowerMode on
Option DynamicPM on

See radeon(4) for more information.



Re: Kernel panic with Asus U36S on 5.2 and current amd64

2012-12-17 Thread Tomas Bodzar
On Sat, Dec 15, 2012 at 11:01 PM, Mike Larkin mlar...@azathoth.net wrote:
 On Sat, Dec 15, 2012 at 05:46:39PM +0100, Tomas Bodzar wrote:
 Hi all,

 my friend tested OpenBSD amd64 (5.2 and current) with Asus U36S, but
 install goes always fine. However first reboot always result in a
 kernel panic related to aml and acpi. BIOS is 203, there's newer one
 206 with updates to VGA bios and 205 was with updates to BIOS (Asus
 doesn't describe those well). I have three pictures taken by him of
 trace and ps if anyone interested (in ps is only swapper anyway).

 It boots once 'disable acpi' done in UKC. In terminal it looks fine
 (asking for dmesg), just doing startx hangs PC. He will try to update
 BIOS today.


 dmesg and panic text with trace, please. An acpidump would also be
 useful.

I will be able to collect those during this week. However this is
nVidia Optimus platform for VGA and even in latest BIOS there's not
switch to use only integrated Intel VGA so let's see what will happen.
On AC adapter it runs nVidia, without AC adapter it runs Intel.


 -ml



Re: OpenBSD hangs when i unplug USB disk

2012-12-17 Thread Marcos Ariel Laufer

On 11/20/2012 1:32 PM, Marcos Laufer wrote:

Peter Hessler wrote:

On 2012 Nov 20 (Tue) at 12:45:09 -0300 (-0300), Marcos Laufer wrote:
:Ok , i've just tried it on a OpenBSD 5.1 and unplugging the USB works
:just fine, no crash, no freeze.
:
:The weird thing and i don't understand why, is that you guys had good
:results with old OpenBSD versions and i didn't.
:

No, nobody bothered with older versions.  We run -current, or 5.1 at the
latest.



I'm sorry, but some people bothered, even asked me to send info 
because this worked with old versions of the OS to them and not to me. 
So i guess it has something to do with the firmware on the disk, i 
don't really know. But if it works on 5.1 then that's enough for me.





I'm sorry the problem is not solved. I installed OpenBSD 5.2 , attempted 
to format the disk and it ends with an error (i can only see it on 
console and didn't write it down) , and after that the device is 
detached and the port disabled. I am not in the datacenter right now so 
i can't unplug it and plug it in again (although now it does not hang 
the OS when doing this) to try again:


umass0 at uhub0 port 3 configuration 1 interface 0 Western Digital My 
Passport 0748 rev 2.10/10.15 addr 2

umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: WD, My Passport 0748, 1015 SCSI4 
0/direct fixed

sd1: 953837MB, 512 bytes/sector, 1953458176 sectors
ses0 at scsibus2 targ 1 lun 1: WD, SES Device, 1015 SCSI4 13/enclosure 
services fixed

ses0: unable to read enclosure configuration
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd0a (dbca6b23415fa5d6.a) swap on sd0b dump on sd0b
WARNING: R/W mount of /mnt denied.  Filesystem is not clean - run fsck
sd1 detached
ses0 detached
scsibus2 detached
umass0 detached
umass0 at uhub0 port 3 configuration 1 interface 0 Western Digital My 
Passport 0748 rev 2.10/10.15 addr 2

umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: WD, My Passport 0748, 1015 SCSI4 
0/direct fixed

sd1: 953837MB, 512 bytes/sector, 1953458176 sectors
ses0 at scsibus2 targ 1 lun 1: WD, SES Device, 1015 SCSI4 13/enclosure 
services fixed

ses0: unable to read enclosure configuration
sd1 detached
ses0 detached
scsibus2 detached
umass0 detached
uhub0: device problem, disabling port 3
umass0 at uhub0 port 4 configuration 1 interface 0 Western Digital My 
Passport 0748 rev 2.10/10.15 addr 2

umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: WD, My Passport 0748, 1015 SCSI4 
0/direct fixed

sd1: 953837MB, 512 bytes/sector, 1953458176 sectors
ses0 at scsibus2 targ 1 lun 1: WD, SES Device, 1015 SCSI4 13/enclosure 
services fixed

ses0: unable to read enclosure configuration
sd1 detached
ses0 detached
scsibus2 detached
umass0 detached
umass0 at uhub0 port 4 configuration 1 interface 0 Western Digital My 
Passport 0748 rev 2.10/10.15 addr 2

umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: WD, My Passport 0748, 1015 SCSI4 
0/direct fixed

sd1: 953837MB, 512 bytes/sector, 1953458176 sectors
ses0 at scsibus2 targ 1 lun 1: WD, SES Device, 1015 SCSI4 13/enclosure 
services fixed

ses0: unable to read enclosure configuration
sd1 detached
ses0 detached
scsibus2 detached
umass0 detached
uhub0: device problem, disabling port 4



Re: net6501 and hw.ncpufound

2012-12-17 Thread Mihai Popescu
 The Atom E6xx CPUs used in the Soekris net6501 ... but judging from people's 
 inability to realize that the 1.0 and 1.6  GHz models they had bought were 
 only running at 0.6 GHz by default  ...

Could you tell a little bit more about this, please? The heatsink for
CPU shown on soekris site was very questionable. I have an embedded
computer at work based on Atom and it has a bigger heatsink and the
temperature is like 50 C.

Is the speed reduced from BIOS? Can it be unlocked and put to the maximum ?

Thanks.



trivial with echo command

2012-12-17 Thread sven falempin
Hello misc readers,

First, openBSD threads are awesome for debugging.
The trivial topic,
echo -ne \x00 | nc  port
send a null byte with a GNU echo.

Echo in openbsd does not have -e (and does not warn whan i try it ..)

Noob question:
How to send a null byte over netcat ? am i forced to use perl ?

+Peace and prosperity+

-- 
-
() ascii ribbon campaign - against html e-mail
/\



Re: trivial with echo command

2012-12-17 Thread Andres Perera
echo expands nil from C backslash sequences just fine:
andres@pote:~/tmp $ alias vis
vis='vis -cl -F$COLUMNS'
andres@pote:~/tmp $ echo '\0a' | vis
\0a\$
andres@pote:~/tmp $ perl -e 'print \0a\n' | vis
\0a\$


what's most likely happening is that the protocol that you're
targeting treats '\0' as some kind of delimiter:
andres@pote:~/tmp $ echo '\0a' | nc localhost 587
220 pote.my.domain ESMTP Sendmail 8.14.5/8.14.5; Mon, 17 Dec 2012
16:13:51 -0430 (VET)
500 5.5.1 Command unrecognized: 



carp both master

2012-12-17 Thread Michel Blais

Hi,

I'm testing carp for the first time on 5.2 (both) and no mather
what I try, both are master. I see the traffic from carp with
tcpdump on both device. Must be a RTMF error but I already
readed all official doc and some unofficial and still can't find
what wrong.

The config of both device is following.

Thanks

Michel

# tcpdump -i em0
tcpdump: listening on em0, link-type EN10MB
tcpdump: WARNING: compensating for unaligned libpcap packets
00:51:45.455370 CARPv2-advertise 36: vhid=1 advbase=1 advskew=0 demote=0 
(DF) [tos 0x10]
00:51:45.530004 CARPv2-advertise 36: vhid=2 advbase=1 advskew=10 
demote=32 (DF) [tos 0x10]
00:51:46.460226 CARPv2-advertise 36: vhid=1 advbase=1 advskew=0 demote=0 
(DF) [tos 0x10]
00:51:46.574755 CARPv2-advertise 36: vhid=2 advbase=1 advskew=10 
demote=32 (DF) [tos 0x10]
00:51:47.465083 CARPv2-advertise 36: vhid=1 advbase=1 advskew=0 demote=0 
(DF) [tos 0x10]
00:51:47.619506 CARPv2-advertise 36: vhid=2 advbase=1 advskew=10 
demote=32 (DF) [tos 0x10]


Device 1 :
# cat /etc/hostname.em0
inet 10.0.0.101 255.255.255.0
# cat /etc/hostname.em1
inet 10.0.1.101 255.255.255.0
# cat /etc/hostname.em2
inet 10.0.2.1 255.255.255.0

# cat /etc/hostname.carp0
inet W.X.Y.B 255.255.255.248 W.X.Y.D vhid 1 carpdev em0 \
pass fdhnap483745y -inet6

# cat /etc/hostname.carp1
inet 10.0.1.1 255.255.255.0 10.0.1.255 vhid 3 carpdev em1 \
pass 3orohasfv73 -inet6

# cat /etc/hostname.pfsync0
up syncdev em2

# ifconfig -g carp
carp: carp demote count 0

# pfctl -sr
pass all flags S/SA
block drop in on ! lo0 proto tcp from any to any port 6000:6010

# sysctl | grep carp
net.inet.carp.allow=1
net.inet.carp.preempt=1
net.inet.carp.log=2

from ifconfig :
carp0: flags=28843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,NOINET6 mtu 1500
lladdr 00:00:5e:00:01:01
priority: 0
carp: MASTER carpdev em0 vhid 1 advbase 1 advskew 0
groups: carp
status: master
inet X.X.X.X netmask 0xfff8 broadcast X.X.X.X
carp1: flags=28843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,NOINET6 mtu 1500
lladdr 00:00:5e:00:01:03
priority: 0
carp: MASTER carpdev em1 vhid 3 advbase 1 advskew 0
groups: carp
status: master
inet 10.0.1.1 netmask 0xff00 broadcast 10.0.1.255

Device 2:
# cat /etc/hostname.em0
inet 10.0.0.102 255.255.255.0
# cat /etc/hostname.em1
inet 10.0.1.102 255.255.255.0
# cat /etc/hostname.em2
inet 10.0.2.2 255.255.255.0

# cat /etc/hostname.carp0
inet X.W.Z.B 255.255.255.248 X.Y.Z.D vhid 2 carpdev em0 \
advskew 10 pass fdhnap483745y -inet6

# cat /etc/hostname.carp1
inet 10.0.1.1 255.255.255.0 10.0.1.255 vhid 4 carpdev em1 \
advskew 10 pass -inet6

# cat /etc/hostname.pfsync0
up syncdev em2

# ifconfig -g carp
carp: carp demote count 32

# pfctl -sr
pass all flags S/SA
block drop in on ! lo0 proto tcp from any to any port 6000:6010

# sysctl | grep carp
net.inet.carp.allow=1
net.inet.carp.preempt=1
net.inet.carp.log=2

from ifconfig :
carp0: flags=28843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,NOINET6 mtu 1500
lladdr 00:00:5e:00:01:02
priority: 0
carp: MASTER carpdev em0 vhid 2 advbase 1 advskew 10
groups: carp
status: master
inet X.X.X.X netmask 0xfff8 broadcast X.X.X.X
carp1: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
lladdr 00:00:5e:00:01:04
priority: 0
carp: MASTER carpdev em1 vhid 4 advbase 1 advskew 10
groups: carp
status: master
inet6 fe80::200:5eff:fe00:104%carp1 prefixlen 64 scopeid 0xc
inet 10.0.1.1 netmask 0xff00 broadcast 10.0.1.255



Re: Kernel panic with Asus U36S on 5.2 and current amd64

2012-12-17 Thread Mike Larkin
On Mon, Dec 17, 2012 at 06:16:29PM +0100, Tomas Bodzar wrote:
 On Sat, Dec 15, 2012 at 11:01 PM, Mike Larkin mlar...@azathoth.net wrote:
  On Sat, Dec 15, 2012 at 05:46:39PM +0100, Tomas Bodzar wrote:
  Hi all,
 
  my friend tested OpenBSD amd64 (5.2 and current) with Asus U36S, but
  install goes always fine. However first reboot always result in a
  kernel panic related to aml and acpi. BIOS is 203, there's newer one
  206 with updates to VGA bios and 205 was with updates to BIOS (Asus
  doesn't describe those well). I have three pictures taken by him of
  trace and ps if anyone interested (in ps is only swapper anyway).
 
  It boots once 'disable acpi' done in UKC. In terminal it looks fine
  (asking for dmesg), just doing startx hangs PC. He will try to update
  BIOS today.
 
 
  dmesg and panic text with trace, please. An acpidump would also be
  useful.
 
 I will be able to collect those during this week. However this is
 nVidia Optimus platform for VGA and even in latest BIOS there's not
 switch to use only integrated Intel VGA so let's see what will happen.
 On AC adapter it runs nVidia, without AC adapter it runs Intel.
 
 
  -ml

This probably has nothing to do with nVidia.

-ml



Re: carp both master

2012-12-17 Thread Stuart Henderson
On 2012-12-17, Michel Blais mic...@targointernet.com wrote:

 # cat /etc/hostname.carp0
 inet W.X.Y.B 255.255.255.248 W.X.Y.D vhid 1 carpdev em0 \
^
  pass fdhnap483745y -inet6

 # cat /etc/hostname.carp0
 inet X.W.Z.B 255.255.255.248 X.Y.Z.D vhid 2 carpdev em0 \
^
  advskew 10 pass fdhnap483745y -inet6

here, your vhids don't match


 # cat /etc/hostname.carp1
 inet 10.0.1.1 255.255.255.0 10.0.1.255 vhid 3 carpdev em1 \
  pass 3orohasfv73 -inet6

 # cat /etc/hostname.carp1
 inet 10.0.1.1 255.255.255.0 10.0.1.255 vhid 4 carpdev em1 \
  advskew 10 pass -inet6
  ^^^

and here, same problem with vhids, plus you have set the
password on the second router to -inet6.



Re: carp both master

2012-12-17 Thread Loïc BLOT
You need one common VHID for each virtual IP, Stuart said all fixes you
need. CARP protocol identify nodes by VHID.

-- 
Cordialement,
Loïc BLOT, UNIX systems, security and network expert
http://www.unix-experience.fr 

Le lundi 17 décembre 2012 à 22:36 +, Stuart Henderson a écrit :

 On 2012-12-17, Michel Blais mic...@targointernet.com wrote:
 
  # cat /etc/hostname.carp0
  inet W.X.Y.B 255.255.255.248 W.X.Y.D vhid 1 carpdev em0 \
 ^
   pass fdhnap483745y -inet6
 
  # cat /etc/hostname.carp0
  inet X.W.Z.B 255.255.255.248 X.Y.Z.D vhid 2 carpdev em0 \
 ^
   advskew 10 pass fdhnap483745y -inet6
 
 here, your vhids don't match
 
 
  # cat /etc/hostname.carp1
  inet 10.0.1.1 255.255.255.0 10.0.1.255 vhid 3 carpdev em1 \
   pass 3orohasfv73 -inet6
 
  # cat /etc/hostname.carp1
  inet 10.0.1.1 255.255.255.0 10.0.1.255 vhid 4 carpdev em1 \
   advskew 10 pass -inet6
   ^^^
 
 and here, same problem with vhids, plus you have set the
 password on the second router to -inet6.



Re: trivial with echo command

2012-12-17 Thread Stuart Henderson
On 2012-12-17, sven falempin sven.falem...@gmail.com wrote:
 Hello misc readers,

 First, openBSD threads are awesome for debugging.
 The trivial topic,
 echo -ne \x00 | nc  port
 send a null byte with a GNU echo.

 Echo in openbsd does not have -e (and does not warn whan i try it ..)

 Noob question:
 How to send a null byte over netcat ? am i forced to use perl ?

you can use octal with echo(1) or printf(1).

$ echo -n '\000' | hexdump -C
  00|.|
0001

$ printf '\000' | hexdump -C
  00|.|
0001



Re: net6501 and hw.ncpufound

2012-12-17 Thread Stuart Henderson
On 2012-12-17, Mihai Popescu mih...@gmail.com wrote:
 The Atom E6xx CPUs used in the Soekris net6501 ... but judging from people's 
 inability to realize that the 1.0 and 1.6  GHz models they had bought were 
 only running at 0.6 GHz by default  ...

 Could you tell a little bit more about this, please?

http://lists.soekris.com/pipermail/soekris-tech/2012-November/018721.html

 The heatsink for
 CPU shown on soekris site was very questionable. I have an embedded
 computer at work based on Atom and it has a bigger heatsink and the
 temperature is like 50 C.

It might help that soekris don't use the integrated graphics..



Re: trivial with echo command

2012-12-17 Thread Andres Perera
On Mon, Dec 17, 2012 at 6:13 PM, Stuart Henderson s...@spacehopper.org wrote:
 On 2012-12-17, sven falempin sven.falem...@gmail.com wrote:
 Hello misc readers,

 First, openBSD threads are awesome for debugging.
 The trivial topic,
 echo -ne \x00 | nc  port
 send a null byte with a GNU echo.

 Echo in openbsd does not have -e (and does not warn whan i try it ..)

 Noob question:
 How to send a null byte over netcat ? am i forced to use perl ?

 you can use octal with echo(1) or printf(1).

echo(1) is BSD echo (no backslash sequences)

ksh echo is XSI + BSD


 $ echo -n '\000' | hexdump -C
   00|.|
 0001

 $ printf '\000' | hexdump -C
   00|.|
 0001



Re: VPN route failover

2012-12-17 Thread Stuart Henderson
On 2012-12-15, Henry Stilmack h.stilm...@jach.hawaii.edu wrote:
 On 12/14/2012 03:27 PM, Beto wrote:
 Hi, SiteB and Sitec have OpenBSD Firewall ?

 The vpn is firewall to firewall, the manage of network is only route add
 xxx xx


 I'm not sure what SiteB and SiteC are running - I think either Juniper
 or Cisco somethings.

 What works for now is to bring up only one of the tunnels and set up
 flows for each of the remote subnets through it. We'd like to be able to
 do this dynamically, but if we bring up both tunnels, how can we set the
 routing priorities for the flows?

OpenBSD IPsec uses a flow database which doesn't support multiple
priorities. (OpenBSD doesn't support interface-based IPsec as some
some router vendors do, only flow-based).

What should work would be to use a standard tunnel interface for 
your actual lan-to-lan tunnel e.g. gre(4) - in this case you would
only setup IPsec to protect the GRE packets between the endpoints
(IPsec would have no knowledge of the lan subnets). Then you can
use either a dynamic routing protocol e.g. OSPF, or you can use
multiple route table entries with different priorities - OpenBSD
4.8 added support for the cisco style loopback method of doing
GRE keepalives which is likely to be simpler than a full dynamic
routing protocol; if the primary tunnel fails, keepalives stop
being returned, after a timeout this brings down the interface
and thus invalidates the associated route, allowing the lower
priority backup route to be used instead.



Re: trivial with echo command

2012-12-17 Thread Stuart Henderson
On 2012/12/17 18:26, Andres Perera wrote:
 On Mon, Dec 17, 2012 at 6:13 PM, Stuart Henderson s...@spacehopper.org 
 wrote:
  On 2012-12-17, sven falempin sven.falem...@gmail.com wrote:
  Hello misc readers,
 
  First, openBSD threads are awesome for debugging.
  The trivial topic,
  echo -ne \x00 | nc  port
  send a null byte with a GNU echo.
 
  Echo in openbsd does not have -e (and does not warn whan i try it ..)
 
  Noob question:
  How to send a null byte over netcat ? am i forced to use perl ?
 
  you can use octal with echo(1) or printf(1).
 
 echo(1) is BSD echo (no backslash sequences)
 
 ksh echo is XSI + BSD

ah, right.

$ echo -n '\000' | hexdump -C  
  00|.|
0001
$ env echo -n '\000' | hexdump -C  
  5c 30 30 30   |\000|
0004

in which case printf is probably a better idea.



Re: trivial with echo command

2012-12-17 Thread Alexander Hall

On 12/18/12 00:20, Stuart Henderson wrote:

On 2012/12/17 18:26, Andres Perera wrote:

On Mon, Dec 17, 2012 at 6:13 PM, Stuart Henderson s...@spacehopper.org wrote:

On 2012-12-17, sven falempin sven.falem...@gmail.com wrote:

Hello misc readers,

First, openBSD threads are awesome for debugging.
The trivial topic,
echo -ne \x00 | nc  port
send a null byte with a GNU echo.

Echo in openbsd does not have -e (and does not warn whan i try it ..)

Noob question:
How to send a null byte over netcat ? am i forced to use perl ?


you can use octal with echo(1) or printf(1).


echo(1) is BSD echo (no backslash sequences)

ksh echo is XSI + BSD


ah, right.

$ echo -n '\000' | hexdump -C
  00|.|
0001
$ env echo -n '\000' | hexdump -C
  5c 30 30 30   |\000|
0004

in which case printf is probably a better idea.


For scripting, echo is one of the commands I tend to avoid unless I know 
the data is safe, because of it's horrific argument parsing.


I've yet to find a way to echo a single '-n' using the sh/ksh builtin. 
When printing unknown data, I usually end up using 'print -r -- $var' 
(or 'printf %s $var' if I care about portability).


/Alexander



Re: OpenBSD hangs when i unplug USB disk

2012-12-17 Thread Marcos Ariel Laufer

On 12/17/2012 2:23 PM, Marcos Ariel Laufer wrote:

On 11/20/2012 1:32 PM, Marcos Laufer wrote:

Peter Hessler wrote:

On 2012 Nov 20 (Tue) at 12:45:09 -0300 (-0300), Marcos Laufer wrote:
:Ok , i've just tried it on a OpenBSD 5.1 and unplugging the USB works
:just fine, no crash, no freeze.
:
:The weird thing and i don't understand why, is that you guys had good
:results with old OpenBSD versions and i didn't.
:

No, nobody bothered with older versions.  We run -current, or 5.1 at 
the

latest.



I'm sorry, but some people bothered, even asked me to send info 
because this worked with old versions of the OS to them and not to 
me. So i guess it has something to do with the firmware on the disk, 
i don't really know. But if it works on 5.1 then that's enough for me.





I'm sorry the problem is not solved. I installed OpenBSD 5.2 , 
attempted to format the disk and it ends with an error (i can only see 
it on console and didn't write it down) , and after that the device is 
detached and the port disabled. I am not in the datacenter right now 
so i can't unplug it and plug it in again (although now it does not 
hang the OS when doing this) to try again:


umass0 at uhub0 port 3 configuration 1 interface 0 Western Digital My 
Passport 0748 rev 2.10/10.15 addr 2

umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: WD, My Passport 0748, 1015 SCSI4 
0/direct fixed

sd1: 953837MB, 512 bytes/sector, 1953458176 sectors
ses0 at scsibus2 targ 1 lun 1: WD, SES Device, 1015 SCSI4 
13/enclosure services fixed

ses0: unable to read enclosure configuration
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd0a (dbca6b23415fa5d6.a) swap on sd0b dump on sd0b
WARNING: R/W mount of /mnt denied.  Filesystem is not clean - run fsck
sd1 detached
ses0 detached
scsibus2 detached
umass0 detached
umass0 at uhub0 port 3 configuration 1 interface 0 Western Digital My 
Passport 0748 rev 2.10/10.15 addr 2

umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: WD, My Passport 0748, 1015 SCSI4 
0/direct fixed

sd1: 953837MB, 512 bytes/sector, 1953458176 sectors
ses0 at scsibus2 targ 1 lun 1: WD, SES Device, 1015 SCSI4 
13/enclosure services fixed

ses0: unable to read enclosure configuration
sd1 detached
ses0 detached
scsibus2 detached
umass0 detached
uhub0: device problem, disabling port 3
umass0 at uhub0 port 4 configuration 1 interface 0 Western Digital My 
Passport 0748 rev 2.10/10.15 addr 2

umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: WD, My Passport 0748, 1015 SCSI4 
0/direct fixed

sd1: 953837MB, 512 bytes/sector, 1953458176 sectors
ses0 at scsibus2 targ 1 lun 1: WD, SES Device, 1015 SCSI4 
13/enclosure services fixed

ses0: unable to read enclosure configuration
sd1 detached
ses0 detached
scsibus2 detached
umass0 detached
umass0 at uhub0 port 4 configuration 1 interface 0 Western Digital My 
Passport 0748 rev 2.10/10.15 addr 2

umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: WD, My Passport 0748, 1015 SCSI4 
0/direct fixed

sd1: 953837MB, 512 bytes/sector, 1953458176 sectors
ses0 at scsibus2 targ 1 lun 1: WD, SES Device, 1015 SCSI4 
13/enclosure services fixed

ses0: unable to read enclosure configuration
sd1 detached
ses0 detached
scsibus2 detached
umass0 detached
uhub0: device problem, disabling port 4




Here's full dmesg when rebooting and tried to mount the sd1a partition 
afterwards.



OpenBSD 5.2 (GENERIC) #0: Fri Dec 14 23:58:18 ART 2012
r...@un8.huxley.com.ar:/u/system/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Xeon(TM) CPU 3.06GHz (GenuineIntel 686-class) 3.07 GHz
cpu0: 
FPU,V86,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,SBF,CNXT-ID,xTPR

real mem  = 3220738048 (3071MB)
avail mem = 3157274624 (3011MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 12/31/99, BIOS32 rev. 0 @ 0xf, 
SMBIOS rev. 2.3 @ 0xec000 (42 entries)

bios0: vendor HP version P31 date 01/28/2004
bios0: HP ProLiant DL360 G3
acpi0 at bios0: rev 0
acpi0: sleep states S0 S4 S5
acpi0: tables DSDT FACP APIC SPCR
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 133MHz
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 11, 16 pins
ioapic1 at mainbus0: apid 3 pa 0xfec01000, version 11, 16 pins
ioapic2 at mainbus0: apid 4 pa 0xfec02000, version 11, 16 pins
ioapic3 at mainbus0: apid 5 pa 0xfec03000, version 11, 16 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (PCI1)
acpiprt2 at acpi0: bus 4 (PCI2)
acpicpu0 at acpi0
acpitz0 at acpi0: critical temperature is 

Re: trivial with echo command

2012-12-17 Thread sven falempin
On Mon, Dec 17, 2012 at 6:37 PM, Alexander Hall alexan...@beard.se wrote:

 On 12/18/12 00:20, Stuart Henderson wrote:

 On 2012/12/17 18:26, Andres Perera wrote:

 On Mon, Dec 17, 2012 at 6:13 PM, Stuart Henderson s...@spacehopper.org
 wrote:

 On 2012-12-17, sven falempin sven.falem...@gmail.com wrote:

 Hello misc readers,

 First, openBSD threads are awesome for debugging.
 The trivial topic,
 echo -ne \x00 | nc  port
 send a null byte with a GNU echo.

 Echo in openbsd does not have -e (and does not warn whan i try it ..)

 Noob question:
 How to send a null byte over netcat ? am i forced to use perl ?


 you can use octal with echo(1) or printf(1).


 echo(1) is BSD echo (no backslash sequences)

 ksh echo is XSI + BSD


 ah, right.

 $ echo -n '\000' | hexdump -C
   00|.|
 0001
 $ env echo -n '\000' | hexdump -C
   5c 30 30 30   |\000|
 0004

 in which case printf is probably a better idea.


 For scripting, echo is one of the commands I tend to avoid unless I know
 the data is safe, because of it's horrific argument parsing.

 I've yet to find a way to echo a single '-n' using the sh/ksh builtin.
 When printing unknown data, I usually end up using 'print -r -- $var' (or
 'printf %s $var' if I care about portability).

 /Alexander

  Wow.

So much to just print ...

so:
1 echo is crap (not portable, not very usefull)
2 print is doing echo job in ksh  print [-nprsu[n] | -R [-en]] [argument
...] (but this is completly different on pengouinOS)
3 printf is everywhere and works fine

why do echo exist , now i wonder ...

Thanks a lots.

-- 
-
() ascii ribbon campaign - against html e-mail
/\



Re: trivial with echo command

2012-12-17 Thread Andres Perera
On Mon, Dec 17, 2012 at 7:07 PM, Alexander Hall alexan...@beard.se wrote:

 For scripting, echo is one of the commands I tend to avoid unless I know the
 data is safe, because of it's horrific argument parsing.

 I've yet to find a way to echo a single '-n' using the sh/ksh builtin. When
 printing unknown data, I usually end up using 'print -r -- $var' (or
 'printf %s $var' if I care about portability).

 /Alexander


the worrysome part is what happens with make:

andres@pote:~ $ echo '/nonexsistent:;@echo -e hello' | make -f- | vis
-e hello\$
andres@pote:~ $ echo '/nonexsistent:;@echo -e hello;' | make -f- | vis
hello\$

this is due to the optimization to fork+exec instead of shell when
there are no meta characters. the second makefile has `;', so the
optimization doesn't get triggered

what is the problem? 2 echos that disagree or the optimization itself?
are the calls coming from *INSIDE* the house?



Re: trivial with echo command

2012-12-17 Thread Mayuresh Kathe

On Mon, 17 Dec 2012, sven falempin wrote:


So much to just print ...

so:
1 echo is crap (not portable, not very usefull)
2 print is doing echo job in ksh  print [-nprsu[n] | -R [-en]] [argument
...] (but this is completly different on pengouinOS)
3 printf is everywhere and works fine

why do echo exist , now i wonder ...


it's because under unix it's a different philosophy for software 
development.


instead of building one huge application, build small tools and chain them 
together using pipes and output redirection using pure text as the 
exchange format.

it's a lot more flexible and easier to debug.

also, under unix, one first prototypes using various existing tools like 
awk, sed and the shell itself and then implements the final solution.



Thanks a lots.


you're quite welcome. :)

~mayuresh



Re: trivial with echo command

2012-12-17 Thread Philip Guenther
On Mon, Dec 17, 2012 at 5:14 PM, sven falempin sven.falem...@gmail.com wrote:
 So much to just print ...

 so:
 1 echo is crap (not portable, not very usefull)
 2 print is doing echo job in ksh  print [-nprsu[n] | -R [-en]] [argument
 ...] (but this is completly different on pengouinOS)
 3 printf is everywhere and works fine

Ah, misc@, how I miss you...

echo is perfectly safe and portable for printing, followed by a
newline, a literal string that doesn't start with a minus sign.

That happens to be
a) a *really* common need, and
b) a task solved by the historical echo command.


If that's not what you need, you should be considering printf instead
of writing a non-portable echo.


 why do echo exist , now i wonder ...

Is that a serious question?  If so, the cost of converting all 5
trillions uses of 'echo' to printf, 99+% of which would not benefit
from the conversion, didn't make you say wow, converting them would
be a fucking waste of time!?  Really?


Philip Guenther