packages on ftp.openbsd.org

2014-02-24 Thread Stefan Wollny
Hi list,

does anybody know why at present the packages on ftp.openbsd.org (and
others sync'd as well) ends with qt3-sqlite2 being the last entry? All
other packages following this entry are missing.

Just curious. Things happen ...

Cheers,
STEFAN



Re: Trouble with rtorrent

2014-02-24 Thread David Coppa
On Mon, Feb 24, 2014 at 8:48 AM, Brett Mahar br...@coiloptic.org wrote:
 On Sun, 23 Feb 2014 19:22:36 +0400
 Kirill nightl...@nightbbs.ru wrote:

 | Hello!
 | There is my trouble with rtorrent:
 | after couple of seconds downloading it stops and begin write to disk (no
 | writing while download). And again and again and again...
 | Any ideas, please?
 |

 I found ditching it and instead using transmission-daemon to be a good idea.

+1

-david



Re: packages on ftp.openbsd.org

2014-02-24 Thread Antoine Jacoutot
On Mon, Feb 24, 2014 at 09:10:39AM +0100, Stefan Wollny wrote:
 Hi list,
 
 does anybody know why at present the packages on ftp.openbsd.org (and
 others sync'd as well) ends with qt3-sqlite2 being the last entry? All
 other packages following this entry are missing.
 
 Just curious. Things happen ...

That is not the case for me. On my mirror the last vax package is: 
zzuf-0.13p2.tgz

-- 
Antoine



Re: NAT reliability in light of recent checksum changes

2014-02-24 Thread Henning Brauer
* Richard Procter richard.n.proc...@gmail.com [2014-01-25 20:41]:
 On 22/01/2014, at 7:19 PM, Henning Brauer wrote:
  * Richard Procter richard.n.proc...@gmail.com [2014-01-22 06:44]:
  This fundamentally weakens its usefulness, though: a correct
  checksum now implies only that the payload likely matches
  what the last NAT router happened to have in its memory
  huh?
  we receive a packet with correct cksum - NAT - packet goes out with
  correct cksum.
  we receive a packet with broken cksum - NAT - we leave the cksum
  alone, i. e. leave it broken.
 Christian said it better than me: routers may corrupt data
 and regenerating the checksum will hide it.

if that happened we had much bigger problems than NAT.

-- 
Henning Brauer, h...@bsws.de, henn...@openbsd.org
BS Web Services GmbH, http://bsws.de, Full-Service ISP
Secure Hosting, Mail and DNS Services. Dedicated Servers, Root to Fully Managed
Henning Brauer Consulting, http://henningbrauer.com/



Re: NAT reliability in light of recent checksum changes

2014-02-24 Thread Henning Brauer
* Geoff Steckel g...@oat.com [2014-01-28 03:20]:
It would be good if when data protected by a checksum is modified,
 the current checksum is validated and some appropriate?

guess what: that is exactly what happens.

-- 
Henning Brauer, h...@bsws.de, henn...@openbsd.org
BS Web Services GmbH, http://bsws.de, Full-Service ISP
Secure Hosting, Mail and DNS Services. Dedicated Servers, Root to Fully Managed
Henning Brauer Consulting, http://henningbrauer.com/



Re: packages on ftp.openbsd.org

2014-02-24 Thread Stefan Wollny
On Mon, 24 Feb 2014 09:20:27 +0100
Antoine Jacoutot ajacou...@bsdfrog.org wrote:

 On Mon, Feb 24, 2014 at 09:10:39AM +0100, Stefan Wollny wrote:
  Hi list,
  
  does anybody know why at present the packages on ftp.openbsd.org
  (and others sync'd as well) ends with qt3-sqlite2 being the last
  entry? All other packages following this entry are missing.
  
  Just curious. Things happen ...
 
 That is not the case for me. On my mirror the last vax package is:
 zzuf-0.13p2.tgz
 

Hi Antoine,

your are right - my bad for being short on providing the correct system:
The packages are missing for i386-current.
ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/i386/  or
ftp://openbsd.cs.fau.de/pub/OpenBSD/snapshots/packages/i386/ alike.
(Feb. 24th, 2014 / 09:37h German time)

STEFAN



Re: packages on ftp.openbsd.org

2014-02-24 Thread Stuart Henderson
On 2014-02-24, Stefan Wollny stefan.wol...@web.de wrote:
 On Mon, 24 Feb 2014 09:20:27 +0100
 Antoine Jacoutot ajacou...@bsdfrog.org wrote:

 On Mon, Feb 24, 2014 at 09:10:39AM +0100, Stefan Wollny wrote:
  Hi list,
  
  does anybody know why at present the packages on ftp.openbsd.org
  (and others sync'd as well) ends with qt3-sqlite2 being the last
  entry? All other packages following this entry are missing.
  
  Just curious. Things happen ...
 
 That is not the case for me. On my mirror the last vax package is:
 zzuf-0.13p2.tgz
 

 Hi Antoine,

 your are right - my bad for being short on providing the correct system:
 The packages are missing for i386-current.
 ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/i386/  or
 ftp://openbsd.cs.fau.de/pub/OpenBSD/snapshots/packages/i386/ alike.
 (Feb. 24th, 2014 / 09:37h German time)

 STEFAN



My mistake, they will be fixed ASAP (but it will be at least 12 hours).



Re: packages on ftp.openbsd.org

2014-02-24 Thread Stefan Wollny
On Mon, 24 Feb 2014 09:19:27 + (UTC)
Stuart Henderson s...@spacehopper.org wrote:

 On 2014-02-24, Stefan Wollny stefan.wol...@web.de wrote:
  On Mon, 24 Feb 2014 09:20:27 +0100
  Antoine Jacoutot ajacou...@bsdfrog.org wrote:
 
  On Mon, Feb 24, 2014 at 09:10:39AM +0100, Stefan Wollny wrote:
   Hi list,
   
   does anybody know why at present the packages on ftp.openbsd.org
   (and others sync'd as well) ends with qt3-sqlite2 being the last
   entry? All other packages following this entry are missing.
   
   Just curious. Things happen ...
  
  That is not the case for me. On my mirror the last vax package is:
  zzuf-0.13p2.tgz
  
 
  Hi Antoine,
 
  your are right - my bad for being short on providing the correct
  system: The packages are missing for i386-current.
  ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/i386/  or
  ftp://openbsd.cs.fau.de/pub/OpenBSD/snapshots/packages/i386/ alike.
  (Feb. 24th, 2014 / 09:37h German time)
 
  STEFAN
 
 
 
 My mistake, they will be fixed ASAP (but it will be at least 12
 hours).
 

Hi Stuart,

thank you for taking care of it and the time estimation.

STEFAN



Re: No audio

2014-02-24 Thread Zé Loff
 Playing music (e.g., via mpg123) and notice the audio goes
 silent after a short while. stopping and restarting audio player
 does not help. Restarting sndiod does not help either.
 
 However, in another tmux window, if cause an audible bell,
 e.g., pressing tab at the start of a ksh prompt, with each bell
 sounds i hear the audio bits.

That's different. Keyboard bell is handled by wscons, not the audio device.



sysmerge trouble

2014-02-24 Thread Ed Ahlsen-Girard
Took a while to submit this, but for the past ~ six weeks of snapshots
sysmerge fails thus:

ERROR: failed to populate from /usr/src and create checksum file

dmesg below.

-- 

Edward Ahlsen-Girard
Ft Walton Beach, FL

OpenBSD 5.5-beta (GENERIC.MP) #294: Fri Feb 21 13:57:47 MST 2014
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 2094530560 (1997MB)
avail mem = 2030223360 (1936MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xf06d0 (43 entries)
bios0: vendor American Megatrends Inc. version 0504 date 10/05/2009
bios0: ASUSTeK Computer INC. P-P5G41
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP APIC MCFG OEMB HPET GSCI SSDT
acpi0: wakeup devices P0P2(S4) P0P3(S4) P0P1(S4) UAR1(S4) PS2K(S4) PS2M(S4) 
USB0(S4) USB1(S4) USB2(S4) USB3(S4) EUSB(S4) MC97(S4) P0P4(S4) P0P5(S4) 
P0P6(S4) P0P7(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)2 Duo CPU E7500 @ 2.93GHz, 2933.73 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,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF
cpu0: 3MB 64b/line 8-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 277MHz
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 Duo CPU E7500 @ 2.93GHz, 3050.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,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF
cpu1: 3MB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xf000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P2)
acpiprt2 at acpi0: bus -1 (P0P3)
acpiprt3 at acpi0: bus 3 (P0P4)
acpiprt4 at acpi0: bus -1 (P0P5)
acpiprt5 at acpi0: bus 2 (P0P6)
acpiprt6 at acpi0: bus 1 (P0P7)
acpicpu0 at acpi0: C2, C1, PSS
acpicpu1 at acpi0: C2, C1, PSS
aibs0 at acpi0 RTMP RVLT RFAN GGRP GITM SITM
aibs0: FSIF: invalid package
acpibtn0 at acpi0: PWRB
cpu0: Enhanced SpeedStep 2933 MHz: speeds: 2936, 2670, 2403, 2136, 1870, 1603 
MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel G41 Host rev 0x03
vga1 at pci0 dev 2 function 0 Intel G41 Video rev 0x03
intagp0 at vga1
agp0 at intagp0: aperture at 0xe000, size 0x1000
inteldrm0 at vga1
drm0 at inteldrm0
inteldrm0: 1280x768
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
Intel G41 Video rev 0x03 at pci0 dev 2 function 1 not configured
azalia0 at pci0 dev 27 function 0 Intel 82801GB HD Audio rev 0x01: msi
azalia0: codecs: Realtek ALC888
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 Intel 82801GB PCIE rev 0x01: msi
pci1 at ppb0 bus 3
ppb1 at pci0 dev 28 function 2 Intel 82801GB PCIE rev 0x01: msi
pci2 at ppb1 bus 2
re0 at pci2 dev 0 function 0 Realtek 8168 rev 0x02: RTL8168C/8111C (0x3c00), 
msi, address 48:5b:39:c5:63:95
rgephy0 at re0 phy 7: RTL8169S/8110S PHY, rev. 2
ppb2 at pci0 dev 28 function 3 Intel 82801GB PCIE rev 0x01: msi
pci3 at ppb2 bus 1
vendor VIA, unknown product 0x3401 (class serial bus subclass Firewire, rev 
0x00) at pci3 dev 0 function 0 not configured
vendor VIA, unknown product 0x401a (class mass storage subclass 
miscellaneous, rev 0x00) at pci3 dev 0 function 1 not configured
sdhc0 at pci3 dev 0 function 2 vendor VIA, unknown product 0x401b rev 0x00: 
apic 2 int 19
sdhc0 at 0x10: can't map registers
uhci0 at pci0 dev 29 function 0 Intel 82801GB USB rev 0x01: apic 2 int 23
uhci1 at pci0 dev 29 function 1 Intel 82801GB USB rev 0x01: apic 2 int 19
uhci2 at pci0 dev 29 function 2 Intel 82801GB USB rev 0x01: apic 2 int 18
uhci3 at pci0 dev 29 function 3 Intel 82801GB USB rev 0x01: apic 2 int 16
ehci0 at pci0 dev 29 function 7 Intel 82801GB USB rev 0x01: apic 2 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 Intel EHCI root hub rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 Intel 82801BA Hub-to-PCI rev 0xe1
pci4 at ppb3 bus 4
pcib0 at pci0 dev 31 function 0 Intel 82801GB LPC rev 0x01
pciide0 at pci0 dev 31 function 1 Intel 82801GB IDE rev 0x01: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
pciide0: channel 0 disabled (no drives)
pciide0: channel 1 disabled (no drives)
pciide1 at pci0 dev 31 function 2 Intel 82801GB SATA rev 0x01: DMA, channel 0 
configured to native-PCI, channel 1 configured to native-PCI
pciide1: using apic 2 int 19 for native-PCI interrupt
wd0 at pciide1 channel 0 drive 0: SAMSUNG HM641JI
wd0: 16-sector PIO, LBA48, 610480MB, 1250263728 sectors
atapiscsi0 at 

Re: sysmerge trouble

2014-02-24 Thread Shawn K. Quinn
On Sun, Feb 23, 2014, at 03:45 PM, Ed Ahlsen-Girard wrote:
 Took a while to submit this, but for the past ~ six weeks of snapshots
 sysmerge fails thus:
 
 ERROR: failed to populate from /usr/src and create checksum file

sysmerge works fine for me on amd64 sans the occasional incident of
operator error.

What's under your /usr/src? What's your sysmerge command line?

-- 
  Shawn K. Quinn
  skqu...@rushpost.com



Re: More OpenBSD on Hacker News -- RBAC and jails anyone?

2014-02-24 Thread opendaddy
Thank you so much for the explanation guys.

It makes perfect sense now.

O.D.

On 24. februar 2014 at 3:50 AM, Nick Holland  wrote:On 02/23/14
21:09, openda...@hushmail.com wrote:
 Hello,
 
 Got some more layman's questions here after reading
 [url snipped]
 
  OpenBSD for security

 I dunno, I hear this a lot. Sure OpenBSD has created and
implemented
 some (often very bleeding edge) hardening features, but nothing
that
 hasn't seen the light of day in something like GRSecuriy.

 But the lack of other security layers and constructs seem puzzling 
 to me. No RBAC-based system like selinux? No attempt to secure the 
 supply chain until very recently with package signing? Chroot 
 functionality inferior to something like FreeBSD's jails?

 Not to mention that many services you would deploy an OpenBSD
server
 for are provided by ports and not the base system, forgoing the 
 strict auditing that OpenBSD provides.

 [... snip ...]
 
 
 1. Why doesn't OpenBSD have something like RBAC?

Security means a lot of different things to different people.  If you
are running an old-style multi-user system (i.e., lots of people have
terminals on their desk, all logging into the Big Computer In Another
Room), where most of the users are of very limited access rights, and
you need to carefully manage what they are getting to, yes RBAC (Role
Based Access Control) is a great help.  And maybe OpenBSD isn't your
first choice.

However, OpenBSD systems are often deployed for web services or
network
services (or single-user systems like desktops).  The only people with
access to the OpenBSD command prompt are usually either moderately
trusted or have administrative rights through sudo anyway.  For this,
RBAC is just extra baggage, something that's more likely to be
exploited
than to be useful.

OpenBSD's security model is more about -- as I phrase it -- keeping
the
bastards out, not controlling them (or hoping to control them) after
they are in.  Making life difficult for attackers once they get into
your system is usually not going to be overly productive, and usually
makes administration of the system much more difficult, which often
creates NEW security problems of their own.  While people like to talk
about Defense in depth -- and it is not a bad idea -- your best goal
is to keep the bastards on the outside of your systems, as once they
are
in, they can utilize anything you don't have perfectly bolted down to
accomplish their goals (and yes, that statement puts me opposite a lot
of people making a lot of money chasing down bad guys AFTER they
inflitrate systems).

In the Real World: First thing most people do on an SElinux system is
disable SELinux.  At that point, all the RBAC features are now just
pure glossy advertising -- worthless.  For fear of breaking things,
the
Linux people have chosen to put a big on-off switch on SELinux...and
so
given a choice between fixing applications and turning off the
switch...people just turn off the switch.  ANY claimed benefits of
SELinux are ONLY there if it is enabled and used properly.
 2. Is chroot really inferior to FreeBSD jails?

define inferior.
Properly implemented, a chroot is pretty close to doing exactly what
it
claims to do.  Combined with good coding, like privilge separation, it
can make apps pretty darned secure.  But, it is hard to retrofit onto
poorly designed apps.

Stuffing a poorly designed app into a FreeBSD jail may be better than
running it as it was intended, but history has shown that poorly
designed applications are usually security problems, and a jail may
not
prevent that at all.  At best, a jail will prevent Application A from
messing with Application B or the underlying OS, but it won't help one
bit in keeping Application A from being exploited, and if the exploit
is
useful, mission accomplished.

Jails look like a maintenance nightmare...  created by building from
source? oh my...  Haven't done this myself, but it doesn't look like
fun
on a large number of machines.  Or a machine I have 30 minutes to do
an
upgrade on.  or 90% of the machines here in my house.
As for GRSecurity...well, looking at their website, it is still a
bunch
of patches for Linux to be applied by the user; it still doesn't seem
to
be incorporated into any mainline Linux distros.  I suspect this says
far more about the Linux mindset than the merits of GRSecurity (even
if
the GRSecurity implementation sucked horribly...FIX IT and then
incorporate it!  Sheesh!)

What's different about OpenBSD is that the features like stack smash
protection and W^X are in the base system, on all possible platforms
(and a few that didn't seem possible at first!), always on, and
there's
no easy off-switch, so crapplications HAVE to be improved in order
to
work.  I can't prove this (and I doubt anyone could), but I suspect
that
OpenBSD has resulted in more improvements to programs commonly used on
Linux than GRSecurity has.

A lot of people like to say OpenBSD doesn't matter because few uses
it, if that's 

bge IPv6 TCP checksum broken

2014-02-24 Thread Martin Brandenburg
Hello,

I have this chip:

bge0 at pci8 dev 0 function 0 Broadcom BCM57765 rev 0x10, BCM57765 B0 
(0x57785100): msi, address a8:20:66:47:1f:8b
brgphy0 at bge0 phy 1: BCM57765 10/100/1000baseT PHY, rev. 4

TCP over IPv6 does not work under -current, but it does work if I
comment out the line in if_bge.c that enables hardware checksumming.

I tried looking at the Linux driver, but I don't know enough about the
hardware to say anything intelligent about what could be happening.

- Martin



Re: bge IPv6 TCP checksum broken

2014-02-24 Thread Brynet
On Mon, Feb 24, 2014 at 04:57:23PM +, Martin Brandenburg wrote:
 Hello,
 
 I have this chip:
 
   bge0 at pci8 dev 0 function 0 Broadcom BCM57765 rev 0x10, BCM57765 B0 
 (0x57785100): msi, address a8:20:66:47:1f:8b
   brgphy0 at bge0 phy 1: BCM57765 10/100/1000baseT PHY, rev. 4
 
 TCP over IPv6 does not work under -current, but it does work if I
 comment out the line in if_bge.c that enables hardware checksumming.
 
 I tried looking at the Linux driver, but I don't know enough about the
 hardware to say anything intelligent about what could be happening.
 
 - Martin

This also affects at least:

bge0 at pci2 dev 0 function 0 Broadcom BCM57780 rev 0x01, BCM57780 A1 
(0x57780001): msi, address 88:ae:1d:0e:3a:76
brgphy0 at bge0 phy 1: BCM57780 10/100/1000baseT PHY, rev. 

Brad has been looking into the issue and has contacted Broadcom to see
if it's hardware bug.

-Bryan.



Re: while trying to compile gettext 0.18.3.2 I see questionable messages

2014-02-24 Thread Lorenzo Beretta

On 02/23/2014 11:29 PM, Ingo Schwarze wrote:

Hi Lorenzo,

Lorenzo Beretta wrote on Sun, Feb 23, 2014 at 05:29:54PM +0100:

d...@genunix.com wrote on Sun, Feb 23, 2014 at 08:54:34AM -0500:



../gnulib-lib/.libs/libgettextlib.so: warning:
stpcpy() is dangerous GNU crap; don't use it



Yet stpcpy(3) on linux says:
CONFORMING TO
This function was added to POSIX.1-2008.  Before that, it was
not part of the C or POSIX.1 standards, nor customary on UNIX
systems, but was not a GNU invention either.  Perhaps it came
from MS-DOS.  It is also present on the BSDs.


I checked the following without finding any references to stpcpy:
  - ATT UNIX v3 to v7 including PWB and 32v
  - System III ATT Unix
  - all versions of CSRG BSD from 1BSD to 4.4BSD-Lite2 including SCCS

The earliest occurrence of stpcpy() i was able to find was in
the Lattice C AmigaDOS Compiler Version 3 Programmers Reference
Guide (1986-09-12)(Lattice Inc.), which explicitly classifies the
function as TYPE: LATTICE, see
https://archive.org/details/Lattice_C_AmigaDOS_Compiler_Version_3_Programmers_Reference_Guide_1986-09-12_Lattice_Inc.

So the claim by Terry Lambert that it originated in Borland Turbo C
is definitely untrue.  The first release of Borland Turbo C
happened in May 1987.  I can confirm it was in Borland Turbo C 2.0
in 1989, though.

The 386BSD 0.1 release contains GNU textutils-1.3 and GNU fileutils-3.2
which both contain a file lib/stpcpy.c with a 1989 FSF Copyright.
This is confirmed by looking at the initial commits of the git
history of the GNU coreutils package.

The function stpcpy() was contained in the initial git import of
glibc on Feb 18, 1995.  The file string.texi says @comment Unknown
origin at this point in time.  The file sysdeps/generic/stpcpy.c
says Copyright (C) 1992 Free Software Foundation, Inc. at this
point in time.  The ChangeLog reports a bugfix to the function on
Jan 7, 1992 by Roland McGrath.

In the BSDs, here is when it appeared:
  - FreeBSD: Oct 3, 2002 by obrien@, written himself
  - DragonFly: Apr 7, 2009 ported by pavalos@ from FreeBSD
  - NetBSD: May 1, 2009 ported by perry@ from FreeBSD
  - OpenBSD: Jan 17, 2012 by kettenis@, reluctantly written himself

The function stpncpy first appears in glibc with a 1993 FSF Copyright;
according to the ChangeLog, it was introduced on Oct 29, 1993 by
Roland McGrath, and according to the NEWS file, it was first released
with Version 1.07.

So, to summarize, the Linux manual is rather misleading.  Even
though stpcpy() indeed wasn't a GNU invention, it was first introduced
into the UNIX world by extensive use in the GNU coreutils (then
called fileutils and textutils) in 1989, only very few years after
its original appearance.  The glibc was the first UNIX-like C library
to include it only three years later, nearly a decade before FreeBSD,
about 15 years before POSIX, and more than two decades before OpenBSD
reluctantly followed, forced by POSIX.  That said,

   stpcpy() is dangerous DOS crap; don't use it

would be slightly more accurate, but given who pushed it during the
early years,

   stpcpy() is dangerous GNU crap; don't use it

isn't that far off the mark, either.

Anyway, we should update our manual, see below.

Yours,
   Ingo


Index: stpcpy.3
===
RCS file: /cvs/src/lib/libc/string/stpcpy.3,v
retrieving revision 1.5
diff -u -p -r1.5 stpcpy.3
--- stpcpy.325 Sep 2013 21:50:18 -  1.5
+++ stpcpy.323 Feb 2014 22:06:06 -
@@ -174,9 +174,11 @@ and
  functions conform to
  .St -p1003.1-2008 .
  .Sh HISTORY
-The
+The function
  .Fn stpcpy
-and
+first appeared in the Lattice C AmigaDOS compiler (1986 or earlier).
+The function
  .Fn stpncpy
-functions first appeared in
+first appeared in the GNU C library version 1.07 (1993).
+Both functions have been available since
  .Ox 5.1 .



Wow.
Next time someone asks me what I like about OpenBSD, I'll point (also) 
to this reply.
Funny thing is that according to 
http://permalink.gmane.org/gmane.comp.lib.glibc.bugs/6277 the bug was 
reported in 2003, but neither stpcpy(3) nor the info pages seem to 
mention it -- one more reason to keep a copy of the openbsd manpages 
around all the time :)




Re: sysmerge trouble

2014-02-24 Thread Ed Ahlsen-Girard
On 2014-02-24 Shawn K. Quinn skquinn () rushpost ! com wrote:
Date:   2014-02-24 10:49:03

 On Sun, Feb 23, 2014, at 03:45 PM, Ed Ahlsen-Girard wrote:
  Took a while to submit this, but for the past ~ six weeks of
  snapshots sysmerge fails thus:
  
  ERROR: failed to populate from /usr/src and create checksum file
 
 sysmerge works fine for me on amd64 sans the occasional incident of
 operator error.
 
 What's under your /usr/src? What's your sysmerge command line?
 
 -- 
   Shawn K. Quinn
   skqu...@rushpost.com

My /usr/src appears to contain a source tree. I would post the results
of find /usr/src if asked, but that'd be a long message.

sysmerge command line is:

sysmerge

which I have been using for a few years.

-- 

Edward Ahlsen-Girard
Ft Walton Beach, FL



Re: sysmerge trouble

2014-02-24 Thread Kenneth Westerback
On 24 February 2014 07:56, Ed Ahlsen-Girard eagir...@cox.net wrote:
 On 2014-02-24 Shawn K. Quinn skquinn () rushpost ! com wrote:
 Date:   2014-02-24 10:49:03

 On Sun, Feb 23, 2014, at 03:45 PM, Ed Ahlsen-Girard wrote:
  Took a while to submit this, but for the past ~ six weeks of
  snapshots sysmerge fails thus:
 
  ERROR: failed to populate from /usr/src and create checksum file

 sysmerge works fine for me on amd64 sans the occasional incident of
 operator error.

 What's under your /usr/src? What's your sysmerge command line?

 --
   Shawn K. Quinn
   skqu...@rushpost.com

 My /usr/src appears to contain a source tree. I would post the results
 of find /usr/src if asked, but that'd be a long message.

 sysmerge command line is:

 sysmerge

 which I have been using for a few years.

 --

 Edward Ahlsen-Girard
 Ft Walton Beach, FL


Do you perhaps have to switch to 'sysmerge -S'?

 Ken



Re: sysmerge trouble

2014-02-24 Thread Philip Guenther
On Sun, Feb 23, 2014 at 1:45 PM, Ed Ahlsen-Girard eagir...@cox.net wrote:
 Took a while to submit this, but for the past ~ six weeks of snapshots
 sysmerge fails thus:

 ERROR: failed to populate from /usr/src and create checksum file

Six weeks ago was approximately when the /etc/signify/ directory was
added.  My guess is that you missed the bit in the FAQ about using the
-d and -P options when doing cvs updates and thus have no
/usr/src/etc/signify/ directory.


Philip Guenther



Re: sysmerge trouble

2014-02-24 Thread Peter N. M. Hansteen
Ed Ahlsen-Girard eagir...@cox.net writes:

 sysmerge command line is:

 sysmerge

 which I have been using for a few years.

As long as you have all the install sets in place, you can easily run
sysmerge on a system with no source tree installed. For quite a while
now I've tended to run something like this on boxes I upgrade, from
the directory with the updated sets:

$ sudo sysmerge -s etcNM.tgz -x xetcNM.tgz

where 'NM' would have been '55' for the last few weeks on boxes
running snapshots.

- Peter
-- 
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.



Call for Participation, EuroBSDcon 2014: September 25-28 in Sofia, Bulgaria

2014-02-24 Thread Peter N. M. Hansteen
EuroBSDcon 2014: September 25-28 in Sofia, Bulgaria

EuroBSDcon is the European technical conference for users and developers of 
BSD-based systems. The conference will take place September 25 to 28 at 
InterExpo Congress Center in Sofia (see http://iec.bg/en/).  Tutorials will be 
held on thursday and friday, while the shorter talks and papers program is on 
saturday and sunday.


Call for Talk and Presentation Proposals (CFP)

The EuroBSDcon program committee is inviting BSD developers and users to submit 
innovative and original talk proposals not previously presented at other 
European conferences. Topics of interest to the conference include, but are not 
limited to applications, architecture, implementation, performance and security 
of BSD-based operating systems, as well as topics concerning the economic or 
organizational aspects of BSD use. Presentations are expected to be 45 minutes 
and are to be delivered in English.


Call for Tutorial Proposals

The EuroBSDcon program committee is also inviting qualified practitioners in 
their field to submit proposals for half or full day tutorials on topics 
relevant to development, implementation and use of BSD-based systems.

Half-day tutorials are expected to be 2.5 to 3 hours and full-day tutorials 5 
to 6 hours. Tutorials are to be held in English.

Submissions

Proposals should be sent by email to submission at eurobsdcon.org.

They should contain a short and concise text description in about 100 words. 
The submission should also include a short CV of the speaker and an estimate of 
the expected travel expenses. Please submit each proposal as a separate email. 

Important dates

The EuroBSDcon program committee is accepting talk and tutorial proposals until 
May 19th, 2014. Speakers will be informed of acceptance status by June 10th, 
2014. Other important dates will be announced soon at the conference website 
http://2014.EuroBSDcon.org/ .

Program Committee

This year's program committee is

Peter Hansteen (Chair, representing OpenBSD, peter at bsdly dot net)
Janne Johansson (representing OpenBSD, jj at OpenBSD dot org)
Vasil Dimov (representing FreeBSD, vd at FreeBSD dot org)
Ollivier Robert (representing FreeBSD, roberto at FreeBSD dot net)
Martin Husemann (representing NetBSD, martin at NetBSD dot org)
Marc Balmer (representing NetBSD, mbalmer at NetBSD dot org)
Shteryana Shopova (OC liaison, syrinx at FreeBSD dot org)



Re: OpenBSD on T61/T500

2014-02-24 Thread Jonathan Thornburg
Dennis den Brok asked:
 I am considering getting a ThinkPad T61 or T500 to run OpenBSD on.
 My main concern is the noise level:  I'd prefer the fan not to run
 at all during text editing and web browsing.  Can anyone comment
 on that?  Are there other caveats?

I have a T60 and a T60p (both 15.4 widescreens with ATI graphics);
currently both run 5.4/amd64.

For both, the fan *does* run at a low speed even when the system is idle.
I'm ok with the (relatively low) noise, but your tastes/tolerances may
differ.

Other things of note:
* X autoconfigures fine, and the 1680x1050 pixel 15.4 display is great
* the T60-series keyboard is (IMHO) fantastic -- it was (is) my key
  reason for staying with the T60 generation and not a newer machine
* wifi (wpi or athn) works ok
* with the disable-ATI-video-repost kernel patch,
http://marc.info/?l=openbsd-miscm=131458407113428w=1
  suspend-to-ram worked ok for OpenBSD 4.9 and 5.1, but it's been broken
  (either for GENERIC or for GENERIC + disable-ATI-video-repost)
  since I moved to 5.4. :( :(
* apmd doesn't seem to grok multi-core processors, so 'apmd -C' will
  keep the clock rate at minimum even when 1 core is at 100% cpu
  (I think this is a software problem, not specific to thinkpads)
* both the T60 and the T60p have an irritating touchpad problem which
  I described in detail in
http://marc.info/?l=openbsd-miscm=138735540520268w=1
  I'm unsure whether this is a hardware, firmware, or software problem.

Overall I'm happy, and would get another T60-series as a replacement
if one of my current pair died.  As always with laptops, YMMV..

-- 
-- Jonathan Thornburg [remove -animal to reply] 
jth...@astro.indiana-zebra.edu
   Dept of Astronomy  IUCSS, Indiana University, Bloomington, Indiana, USA
   There was of course no way of knowing whether you were being watched
at any given moment.  How often, or on what system, the Thought Police
plugged in on any individual wire was guesswork.  It was even conceivable
that they watched everybody all the time.  -- George Orwell, 1984



Re: OpenBSD on T61/T500

2014-02-24 Thread Jiri B
On Sun, Feb 23, 2014 at 07:27:31PM +, Dennis den Brok wrote:
 Hello misc@,
 
 I am considering getting a ThinkPad T61 or T500 to run OpenBSD on.
 My main concern is the noise level:  I'd prefer the fan not to run
 at all during text editing and web browsing.  Can anyone comment
 on that?  Are there other caveats?

T500 works fine, although it is heavy laptop.

OpenBSD 5.5-beta (GENERIC.MP) #287: Fri Feb  7 11:45:09 MST 2014
t...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4166717440 (3973MB)
avail mem = 4047581184 (3860MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (80 entries)
bios0: vendor LENOVO version 6FET82WW (3.12 ) date 11/26/2009
bios0: LENOVO 2089A35
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT APIC MCFG HPET SLIC BOOT ASF! SSDT TCPA DMAR 
SSDT SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) UART(S3) IGBE(S4) EXP0(S4) EXP1(S4) 
EXP2(S4) EXP3(S4) EXP4(S4) PCI1(S4) USB0(S3) USB3(S3) USB5(S3) EHC0(S3) 
EHC1(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 Duo CPU P8600 @ 2.40GHz, 2394.33 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,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,LONG,LAHF,PERF
cpu0: 3MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 7 var ranges, 88 fixed ranges
cpu0: apic clock running at 265MHz
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 Duo CPU P8600 @ 2.40GHz, 2394.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,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,LONG,LAHF,PERF
cpu1: 3MB 64b/line 8-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 0xe000, 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 -1 (EXP2)
acpiprt5 at acpi0: bus -1 (EXP3)
acpiprt6 at acpi0: bus 13 (EXP4)
acpiprt7 at acpi0: bus 21 (PCI1)
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: PUBS, resource for USB0, USB3, USB5, EHC0, EHC1
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 100 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model 42T4621 serial  1562 type LION oem SANYO
acpibat1 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
acpidock0 at acpi0: GDCK not docked (0)
cpu0: Enhanced SpeedStep 2394 MHz: speeds: 2401, 2400, 1600, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel GM45 Host rev 0x07
vga1 at pci0 dev 2 function 0 Intel GM45 Video rev 0x07
intagp0 at vga1
agp0 at intagp0: aperture at 0xd000, size 0x1000
inteldrm0 at vga1
drm0 at inteldrm0
inteldrm0: 1680x1050
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
Intel GM45 Video rev 0x07 at pci0 dev 2 function 1 not configured
Intel GM45 HECI rev 0x07 at pci0 dev 3 function 0 not configured
em0 at pci0 dev 25 function 0 Intel ICH9 IGP M AMT rev 0x03: msi, address 
00:27:13:b7:d2:45
uhci0 at pci0 dev 26 function 0 Intel 82801I USB rev 0x03: apic 1 int 20
uhci1 at pci0 dev 26 function 1 Intel 82801I USB rev 0x03: apic 1 int 21
uhci2 at pci0 dev 26 function 2 Intel 82801I USB rev 0x03: apic 1 int 22
ehci0 at pci0 dev 26 function 7 Intel 82801I USB rev 0x03: apic 1 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 Intel EHCI root hub rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 Intel 82801I HD Audio rev 0x03: msi
azalia0: codecs: Conexant CX20561
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 Intel 82801I PCIE rev 0x03: msi
pci1 at ppb0 bus 2
ppb1 at pci0 dev 28 function 1 Intel 82801I PCIE rev 0x03: msi
pci2 at ppb1 bus 3
iwn0 at pci2 dev 0 function 0 Intel WiFi Link 5300 rev 0x00: msi, MIMO 3T3R, 
MoW, address 00:21:6a:51:73:be
ppb2 at pci0 dev 28 function 4 Intel 82801I PCIE rev 0x03: msi
pci3 at ppb2 bus 13
uhci3 at pci0 dev 29 function 0 Intel 82801I USB rev 0x03: apic 1 int 16
uhci4 at pci0 dev 29 function 1 Intel 82801I USB rev 0x03: apic 1 int 17
uhci5 at pci0 dev 29 function 2 Intel 82801I USB rev 0x03: apic 1 int 18
ehci1 at pci0 dev 29 function 7 Intel 82801I USB rev 0x03: apic 1 int 19
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 Intel EHCI root hub rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 Intel 82801BAM Hub-to-PCI rev 0x93
pci4 

ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

2014-02-24 Thread Fabian Raetz
Hi misc@,

while calculating my phys. memory (mb) with the 
folllowing shellsript i get as a result -424.

sysctl -n hw.physmem returns 3849830400


#!/bin/sh

phys_mem_bytes=`sysctl -n hw.physmem`
phys_mem_mb=`expr $phys_mem_bytes / 1024 / 1024`
echo $phys_mem_mb
--

so i tried
expr 2147483647 / 2 which returns 1073741824 while
expr 2147483648 / 2 returns -1073741824


ksh(1) states that expr does Integer arithmetic.
So is this the expected behaviour or a bug?


Regards,
Fabian Raetz



Re: while trying to compile gettext 0.18.3.2 I see questionable messages

2014-02-24 Thread Ingo Schwarze
Hi Lorenzo,

Lorenzo Beretta wrote on Mon, Feb 24, 2014 at 04:11:17PM +0100:

 Funny thing is that according to
 http://permalink.gmane.org/gmane.comp.lib.glibc.bugs/6277 the bug
 was reported in 2003, but neither stpcpy(3) nor the info pages seem
 to mention it --

Well, to be fair,

 - the linux-man stpcpy(3) clearly says perhaps
 - when Alastair Houghton posted to bug-glibc in 2003,
   he did not provide references to support his claims
 - he didn't say at which time stpcpy(3) appeared in Lattice C
 - and he didn't attempt to argue in any way why he thought
   that it didn't appear somewhere else, earlier.

So, all the glibc crowd could have done back then would have been
to either substitute unsubstantiated perhaps by unsubstatiated
hearsay, or go hunting for some facts themselves.  There is more
unsubstantiated hearsay to be found on the 'net, and conflicting
hearsay, for example here:

  http://marc.info/?l=freebsd-archm=94341707907908
(what is said there was proven WRONG in my last mail,
 but Alastair Houghton did not prove it wrong in 2003)

Let's see what will happen now:

  http://marc.info/?l=linux-manm=139320350105832

 one more reason to keep a copy of the openbsd
 manpages around all the time :)

Yes.  But be aware that

 - Many OpenBSD manuals still contain the original 4.3BSD-Net/2
   HISTORY sections.  Even though Cynthia Livingston (of USENIX)
   did a monumental job in converting the manuals from the man(7)
   to the new mdoc(7) format and added much useful information,
   she had limited access to historic information, so these
   old sections are still full of errors.  In particular, whenever
   you find first appeared in 3BSD, you should be wary, unless
   there are recent OpenBSD commits to the HISTORY section in that
   page.  Quite some stuff marked as 3BSD may actually be older.

 - Many OpenBSD pages are still lacking HISTORY and in particular
   AUTHORS information completely.

 - In one specific respect, the wording is often ambiguous.
   While we now try to use first appeared in only for
   original inventions and rather say something like has
   been available since for stuff that came from elsewhere
   and was ported to or reimplemented for OpenBSD, for historical
   reasons, many pages still stay first appeared in OpenBSD
   even for stuff that was *not* invented by OpenBSD.

All this is still going to take a long time to get better,
and in the meantime, it's not always easy to see what has
already been fixed and what hasn't even been looked at, yet.

Yours,
  Ingo



Re: ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

2014-02-24 Thread Richard Pöttler
On Mon, Feb 24, 2014 at 10:59 PM, Fabian Raetz fabian.ra...@gmail.com wrote:
 while calculating my phys. memory (mb) with the
 folllowing shellsript i get as a result -424.

 sysctl -n hw.physmem returns 3849830400

 
 #!/bin/sh

 phys_mem_bytes=`sysctl -n hw.physmem`
 phys_mem_mb=`expr $phys_mem_bytes / 1024 / 1024`
 echo $phys_mem_mb
 --

You declared #!/bin/sh so you are using the broune shell, not ksh - fyi.

 so i tried
 expr 2147483647 / 2 which returns 1073741824 while
 expr 2147483648 / 2 returns -1073741824

This looks like an integer overflow:
http://en.wikipedia.org/wiki/Integer_overflow
Have you tried to use bc(1)?

cheers
richi



Re: ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

2014-02-24 Thread Fred

On 02/24/14 22:32, Richard Pöttler wrote:

On Mon, Feb 24, 2014 at 10:59 PM, Fabian Raetz fabian.ra...@gmail.com wrote:

while calculating my phys. memory (mb) with the
folllowing shellsript i get as a result -424.

sysctl -n hw.physmem returns 3849830400


#!/bin/sh

phys_mem_bytes=`sysctl -n hw.physmem`
phys_mem_mb=`expr $phys_mem_bytes / 1024 / 1024`
echo $phys_mem_mb
--


You declared #!/bin/sh so you are using the broune shell, not ksh - fyi.



On OpenBSD sh is the same binary as ksh, the notes section of the sh(1) 
gives some more detail as does the faq[1].


Fred

[1]http://www.openbsd.org/faq/faq10.html#ksh



Re: ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

2014-02-24 Thread Robert Peichaer
On Mon, Feb 24, 2014 at 11:10:44PM +, Fred wrote:
 On 02/24/14 22:32, Richard P??ttler wrote:
 On Mon, Feb 24, 2014 at 10:59 PM, Fabian Raetz fabian.ra...@gmail.com 
 wrote:
 while calculating my phys. memory (mb) with the
 folllowing shellsript i get as a result -424.
 
 sysctl -n hw.physmem returns 3849830400
 
 
 #!/bin/sh
 
 phys_mem_bytes=`sysctl -n hw.physmem`
 phys_mem_mb=`expr $phys_mem_bytes / 1024 / 1024`
 echo $phys_mem_mb
 --
 
 You declared #!/bin/sh so you are using the broune shell, not ksh - fyi.
 
 
 On OpenBSD sh is the same binary as ksh, the notes section of the sh(1)
 gives some more detail as does the faq[1].
 
 Fred
 
 [1]http://www.openbsd.org/faq/faq10.html#ksh

#!/bin/sh

phys_mem_bytes=$(sysctl -n hw.physmem)
phys_mem_mb=$(($phys_mem_bytes / 1024 / 1024))
echo $phys_mem_mb
 

-- 
-=[rpe]=-



Re: ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

2014-02-24 Thread Stuart Henderson
On 2014-02-24, Fabian Raetz fabian.ra...@gmail.com wrote:
 Hi misc@,

 while calculating my phys. memory (mb) with the 
 folllowing shellsript i get as a result -424.

 sysctl -n hw.physmem returns 3849830400

 
 #!/bin/sh

 phys_mem_bytes=`sysctl -n hw.physmem`
 phys_mem_mb=`expr $phys_mem_bytes / 1024 / 1024`
 echo $phys_mem_mb
 --

 so i tried
 expr 2147483647 / 2 which returns 1073741824 while
 expr 2147483648 / 2 returns -1073741824


 ksh(1) states that expr does Integer arithmetic.
 So is this the expected behaviour or a bug?

I don't see this discussed in ksh(1) - it's expr(1), /bin/expr on OpenBSD.
This uses 32-bit signed integer types, which are limited to 2^31-1, above
which it wraps around.

It may be possible to change this after we're done with release, but for
now here's a quick workaround:

phys_mem_mb=`perl -e print int($phys_mem_bytes / 1024 / 1024);`



Re: ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

2014-02-24 Thread Alexander Hall
On February 25, 2014 12:27:41 AM CET, Stuart Henderson s...@spacehopper.org 
wrote:
On 2014-02-24, Fabian Raetz fabian.ra...@gmail.com wrote:
 Hi misc@,

 while calculating my phys. memory (mb) with the 
 folllowing shellsript i get as a result -424.

 sysctl -n hw.physmem returns 3849830400

 
 #!/bin/sh

 phys_mem_bytes=`sysctl -n hw.physmem`
 phys_mem_mb=`expr $phys_mem_bytes / 1024 / 1024`
 echo $phys_mem_mb
 --

 so i tried
 expr 2147483647 / 2 which returns 1073741824 while
 expr 2147483648 / 2 returns -1073741824


 ksh(1) states that expr does Integer arithmetic.
 So is this the expected behaviour or a bug?

I don't see this discussed in ksh(1) - it's expr(1), /bin/expr on
OpenBSD.

IIRC i386 differs from amd64 (and other arches too).

/Alexander

This uses 32-bit signed integer types, which are limited to 2^31-1,
above
which it wraps around.

It may be possible to change this after we're done with release, but
for
now here's a quick workaround:

phys_mem_mb=`perl -e print int($phys_mem_bytes / 1024 / 1024);`



Re: ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

2014-02-24 Thread Stuart Henderson
It does for /bin/sh, which is why I suggested perl rather than echo 
$(($(sysctl -n hw.physmem)/1024/1024)) which will work on 64-bit arch but not 
32-bit.

On 24 February 2014 23:49:08 GMT+00:00, Alexander Hall alexan...@beard.se 
wrote:


On February 25, 2014 12:27:41 AM CET, Stuart Henderson
s...@spacehopper.org wrote:
On 2014-02-24, Fabian Raetz fabian.ra...@gmail.com wrote:
 Hi misc@,

 while calculating my phys. memory (mb) with the 
 folllowing shellsript i get as a result -424.

 sysctl -n hw.physmem returns 3849830400

 
 #!/bin/sh

 phys_mem_bytes=`sysctl -n hw.physmem`
 phys_mem_mb=`expr $phys_mem_bytes / 1024 / 1024`
 echo $phys_mem_mb
 --

 so i tried
 expr 2147483647 / 2 which returns 1073741824 while
 expr 2147483648 / 2 returns -1073741824


 ksh(1) states that expr does Integer arithmetic.
 So is this the expected behaviour or a bug?

I don't see this discussed in ksh(1) - it's expr(1), /bin/expr on
OpenBSD.

IIRC i386 differs from amd64 (and other arches too).

/Alexander

This uses 32-bit signed integer types, which are limited to 2^31-1,
above
which it wraps around.

It may be possible to change this after we're done with release, but
for
now here's a quick workaround:

phys_mem_mb=`perl -e print int($phys_mem_bytes / 1024 / 1024);`



Google Summer Of Code 2014.

2014-02-24 Thread Bob Beck
The OpenBSD Foundation is pleased to announce that we have been
accepted as a mentoring organization for Google Summer of Code 2014.
As such if you are a student who qualifies to apply for GSOC, you will
be able to find us in Google's Summer of Code Application process.

We have an ideas page which is located at
http://www.openbsdfoundation.org/gsoc2014.html

I will repeat my usual disclaimer here on behalf of the foundation -
doing anything with GSOC does *not* guarantee the result will end up
in OpenBSD or any related project. That having been said
we hope to be able to put some mentors together with students to
accomplish things that may become useful to the community at large.

This will be our first year doing this, so we hope to learn from the
experience and see if it will work out in future years.

-Bob Beck - The OpenBSD Foundation.



Re: ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

2014-02-24 Thread Ingo Schwarze
Hi Fabian,

Fabian Raetz wrote on Mon, Feb 24, 2014 at 10:59:34PM +0100:

 while calculating my phys. memory (mb) with the 
 folllowing shellsript i get as a result -424.
 
 sysctl -n hw.physmem returns 3849830400
 
 
 #!/bin/sh
 
 phys_mem_bytes=`sysctl -n hw.physmem`
 phys_mem_mb=`expr $phys_mem_bytes / 1024 / 1024`
 echo $phys_mem_mb
 --
 
 so i tried
 expr 2147483647 / 2 which returns 1073741824 while
 expr 2147483648 / 2 returns -1073741824
 
 ksh(1) states that expr does Integer arithmetic.
 So is this the expected behaviour or a bug?

How strange, six replies but nobody answered your question...

The above behaviour is required by POSIX:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html#tag_17_01_02_01

  Integer variables and constants, including the values of operands
   and option-arguments, used by the standard utilities listed in
   this volume of POSIX.1-2008 shall be implemented as equivalent
   to the ISO C standard signed long data type; floating point shall
   be implemented as equivalent to the ISO C standard double type.
   Conversions between types shall be as described in the ISO C
   standard. All variables shall be initialized to zero if they are
   not otherwise assigned by the input to the application.

   Arithmetic operators and control flow keywords shall be implemented
   as equivalent to those in the cited ISO C standard section, as
   listed in Selected ISO C Standard Operators and Control Flow
   Keywords.

So, POSIX *requires* that the output of expr 2147483648 + 0
and sh -c 'echo $((2147483648 + 0))' be machine dependent.
For example, on i386, where long is 32 bit, it must be negative,
but on amd64, where long is 64 bit, it must be positive.
I guess it was a bad idea to have the standard require such
weirdness; then again, this isn't exactly the only place
where POSIX requires, well, weird behaviour.

Our /bin/ksh uses long to store integers,
see /usr/src/bin/ksh/table.h and /usr/src/bin/ksh/expr.c,
so that seems fine.

Our /bin/expr uses int to store integer numbers.
As long as we have sizeof(int) == sizeof(long) on all
architectures (hum...  /me isn't a hardware hacker)
that's fine as well.

It might be a bad idea to change this after we're done with release;
on first sight, i see nothing here that might need fixing.

Well, maybe a CAVEATS entry in some manuals might make sense,
since it doesn't appear as if many people are aware of what
POSIX requires...

Yours,
  Ingo



Re: sysmerge trouble

2014-02-24 Thread Philip Guenther
On Mon, Feb 24, 2014 at 7:58 PM, Ed Ahlsen-Girard eagir...@cox.net wrote:
 On Mon, 24 Feb 2014 10:59:57 -0800
 Philip Guenther guent...@gmail.com wrote:
...
 Six weeks ago was approximately when the /etc/signify/ directory was
 added.  My guess is that you missed the bit in the FAQ about using the
 -d and -P options when doing cvs updates and thus have no
 /usr/src/etc/signify/ directory.

 I'm still missing it, apparently.

Then you ran the wrong cvs command.  I would give a more precise
response, but you included no information about what commands you've
used.


 No signify in 'following current'.

It doesn't require additional action beyond sysmerge with a correct
cvs tree or a snapshot, so why would it be included there?


Philip Guenther



Re: ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

2014-02-24 Thread Philip Guenther
On Mon, Feb 24, 2014 at 5:00 PM, Ingo Schwarze schwa...@usta.de wrote:
...
 The above behaviour is required by POSIX:

 http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html#tag_17_01_02_01

   Integer variables and constants, including the values of operands
and option-arguments, used by the standard utilities listed in
this volume of POSIX.1-2008 shall be implemented as equivalent
to the ISO C standard signed long data type; floating point shall
be implemented as equivalent to the ISO C standard double type.
Conversions between types shall be as described in the ISO C
standard. All variables shall be initialized to zero if they are
not otherwise assigned by the input to the application.
...
 Our /bin/expr uses int to store integer numbers.
 As long as we have sizeof(int) == sizeof(long) on all
 architectures (hum...  /me isn't a hardware hacker)
 that's fine as well.

Our expr is broken then: on LP64 platforms (amd64, sparc64, mips64,
etc) int is only 32bits while long is 64bits.

(We have both kinds of platforms: country (ILP32) and western (LP64).
ILP32 have 32bit types for int, long, and pointers, while LP64 have
32bit ints and 64bit longs and pointers.)


Philip Guenther



Re: ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

2014-02-24 Thread Dennis Davis
On Tue, 25 Feb 2014, Ingo Schwarze wrote:

 From: Ingo Schwarze schwa...@usta.de
 To: Fabian Raetz fabian.ra...@gmail.com
 Cc: misc@openbsd.org
 Date: Tue, 25 Feb 2014 01:00:49
 Subject: Re: ksh: expr 2147483648 / 2 = -1073741824 expected behavior or bug?

...

  so i tried
  expr 2147483647 / 2 which returns 1073741824 while
  expr 2147483648 / 2 returns -1073741824
 
  ksh(1) states that expr does Integer arithmetic.
  So is this the expected behaviour or a bug?

 How strange, six replies but nobody answered your question...

 The above behaviour is required by POSIX:

...

Possibly worth muddying the waters slightly by noting the bash
shell on my old i386 box gets the sum right:


poulidor $ cat /tmp/t.sh
#!/usr/local/bin/bash

echo $((2147483647/2))
echo $((2147483648/2))
poulidor $ /tmp/t.sh
1073741823
1073741824
poulidor $ /usr/local/bin/bash --version
GNU bash, version 4.2.42(1)-release (i386-unknown-openbsd5.3)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


Seems like bash is not adhering to the POSIX standard :-)
-- 
Dennis Davis dennisda...@fastmail.fm