Re: ksh sigwinch

2012-09-05 Thread LEVAI Daniel
On k, szept 04, 2012 at 18:15:29 -0400, Ted Unangst wrote:
 I move my windows around and even resize them sometimes.  Sometimes
 ksh catches on, but a lot of the time it doesn't.  The problem is if
 I'm running an editor like vi (kinda common reason why I'd want to
 resize the terminal), sigwinch doesn't get to ksh.  Then when I exit
 the editor, command line editing is all messed.
 
 Fix is simple.  Pretend we got a sigwinch whenever we do the regular
 mailcheck/jobs notify stuff.  Then the edit code will check the
 current status.
[...]

This doesn't work for me inside either urxvt or xterm. I've resized the
windows but the end of the line remained more far than the windows'
edge. Do I understand correctly that this patch would make ksh always
recalculate the editor's line end if a terminal window resize occurs?


Daniel

-- 
LÉVAI Dániel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D  650C C69B BE4C 83B6 3A8F



script to make installable disk image

2012-09-05 Thread Ted Unangst
We provide many forms of installation media, but neither floppy nor
iso images are best suited for usb drives.  It's pretty easy to make
a hard drive image containing the installer bsd.rd.

I tested this on i386, it should work on amd64 too.  It's just a bunch
of shell commands, save it to makeimage.sh or whatever.  Maybe we
could integrate this into the distrib build makefiles, but I wanted to
get a procedure done first.  I don't know what the best way to get a
disklabel on is, I just dumped a tiny bit of text into a file.

It's actually very similar to what builds the install.iso, but I
didn't do it as a makefile for now so it's easier for standalone users
to run.

It assumes you have a working bsd.rd in /.  If you wanted to build
amd64 on i386, or vice versa, you'll have to fiddle with the files.

#!/bin/sh
set -e
cp /bsd.rd .
gzip -9 bsd.rd
dd if=/dev/zero bs=1k count=3584 of=disk.img
sudo vnconfig vnd0 disk.img
sudo fdisk -y -i vnd0
echo 16 partitions:  disklabel.txt
echo #size   offset  fstype [fsize bsize  cpg]  
disklabel.txt
echo   a: 6944  128  4.2BSD   2048 163841  
disklabel.txt
echo   c: 71680  unused  disklabel.txt
disklabel -R vnd0 disklabel.txt
newfs -i 512000 vnd0a
mount /dev/vnd0a /mnt
cp bsd.rd.gz /mnt/bsd
cp /usr/mdec/boot /mnt/boot
/usr/mdec/installboot /mnt/boot /usr/mdec/biosboot vnd0
umount /mnt
vnconfig -u vnd0
rm bsd.rd.gz
rm disklabel.txt



Re: ksh sigwinch

2012-09-05 Thread Ted Unangst
On Wed, Sep 05, 2012 at 08:52, LEVAI Daniel wrote:
 On k, szept 04, 2012 at 18:15:29 -0400, Ted Unangst wrote:
 I move my windows around and even resize them sometimes.  Sometimes
 ksh catches on, but a lot of the time it doesn't.  The problem is if
 I'm running an editor like vi (kinda common reason why I'd want to
 resize the terminal), sigwinch doesn't get to ksh.  Then when I exit
 the editor, command line editing is all messed.

 Fix is simple.  Pretend we got a sigwinch whenever we do the regular
 mailcheck/jobs notify stuff.  Then the edit code will check the
 current status.
 [...]
 
 This doesn't work for me inside either urxvt or xterm. I've resized the
 windows but the end of the line remained more far than the windows'
 edge. Do I understand correctly that this patch would make ksh always
 recalculate the editor's line end if a terminal window resize occurs?

The did we get sigwinch code only runs after you hit enter.  The
next prompt (assuming the signal was received) will be correct.
Easiest way to see what's happening is to run set | grep COLUMNS.

What the diff fixes is the fact that in a lot of cases ksh *doesn't*
get the signal.  sigwinch is only delievered to the process group that
controls the terminal, and ksh runs children in a different group.
Ergo, it will never get the signal if another program is running.

I changed ksh to always act as if it received a sigwinch sometime
during execution of the command it just ran.  But I didn't change
anything about how frequently it checks to see if it received the
signal.

If you want the command line to update in realtime to window changes,
that's a trickier change.



Re: ksh sigwinch

2012-09-05 Thread LEVAI Daniel
On sze, szept 05, 2012 at 07:01:45 -0400, Ted Unangst wrote:
[...]
  This doesn't work for me inside either urxvt or xterm. I've resized the
  windows but the end of the line remained more far than the windows'
  edge. Do I understand correctly that this patch would make ksh always
  recalculate the editor's line end if a terminal window resize occurs?
 
 The did we get sigwinch code only runs after you hit enter.  The
[...]

Aha! My bad... It works as advertised after hitting enter.

 If you want the command line to update in realtime to window changes,
 that's a trickier change.

No need, this is perfect :)


Thanks,
Daniel

-- 
LÉVAI Dániel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D  650C C69B BE4C 83B6 3A8F



Re: Correct DPADD for iked' Makefile

2012-09-05 Thread Brad Smith
On Sun, Sep 02, 2012 at 12:02:23PM +0200, Marc Espie wrote:
 On Sun, Sep 02, 2012 at 01:08:58AM -0400, Brad Smith wrote:
  Whateve code that used to be within iked that used SSL was removed
  but DPADD was not updated so its still looking for an unused libssl.
  
  
  Index: Makefile
  ===
  RCS file: /home/cvs/src/sbin/iked/Makefile,v
  retrieving revision 1.6
  diff -u -p -r1.6 Makefile
  --- Makefile22 Dec 2010 17:43:10 -  1.6
  +++ Makefile28 Jul 2012 06:34:43 -
  @@ -11,7 +11,7 @@ MAN=  iked.conf.5 iked.8
   #NOMAN=yes
   
   LDADD= -lutil -levent -lcrypto
  -DPADD= ${LIBUTIL} ${LIBEVENT} ${LIBSSL} ${LIBCRYPTO}
  +DPADD= ${LIBUTIL} ${LIBEVENT} ${LIBCRYPTO}
   CFLAGS+=   -Wall -I${.CURDIR}
   CFLAGS+=   -Wstrict-prototypes -Wmissing-prototypes
   CFLAGS+=   -Wmissing-declarations
 
 Well, I have a LIBRARIES patch that would make this easier to keep in
 synch eventually...
 
 whenever people are not so busy with -pie and basically thinking I'm
 wasting time with useless stuff...
 
 
 Basically, add this to bsd.prog.mk
 
 .if defined(LIBRARIES)  !empty(LIBRARIES)
 .  for l in ${LIBRARIES}
 LDADD += -l$l
 DPADD += ${LIB${l:U}}
 .  endfor
 .endif
 
 then replace the above with:
 LIBRARIES = util event crypto
 
 and have LDADD and DPADD magically stay in synch !
 
 naming subject to discussion...

The idea makes sense and it has been shown that it is too easy for the contents
of the two variables to get out of sync.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Recursos Humanos, Qué Medir y Por Qué

2012-09-05 Thread Lic. Yinela Cheribin Juarez
Recursos Humanos, Qué Medir y Por Qué
SEMINARIO ONLINE EN VIVO este 11 de Septiembre de 2012.
Al participar en este importante seminario, usted dejará de ser un
administrador de recursos humanos tradicional y pasivo, para convertirse en un
Directivo de RRHH con visión estratégica, energía, liderazgo y capacidad para
generar  valor  y  entusiasmo  en  su  organización.

Inscríbase  y  aprenda:
+ Cuáles son los nuevos retos a los que se enfrenta un departamento de
Recursos Humanos
+ Cuál es el rol actual de la Dirección de Recursos Humanos
+ Cómo cambiar la imagen de “Recursos Inhumanos” y convertirla en un área
indispensable para su organización
+ Cómo convertir las funciones medulares de Recursos Humanos en impulsores
estratégicos
+ Cómo alinear la actuación de Recursos Humanos a la estrategia y objetivos de
su empresa
+ Cómo atraer, retener y desarrollar talento clave
+ Cuál es el costo de la desmotivación
Esquemas salariales, programas de desempeño y mucho más…
Adquiera la información completa y sin compromiso, solo responda este correo
con asunto -Deseo Folleto RRHH o Comuníquese al (507) 279-1083 / 279-0258 /
279-0887 - y a la brevedad lo recibirá!
ESTE CORREO NO PUEDE SER CONSIDERADO INTRUSIVO YA QUE CUMPLE CON LAS POLÍTICAS
ANTISPAM INTERNACIONALES Y LOCALES: Responda este correo con el Asunto borrar
y automáticamente quedará fuera de nuestras listas. Este correo ha sido
enviado a: tech@openbsd.org



better home for pbkdf2

2012-09-05 Thread Ted Unangst
We have several programs using the pbkdf2 function.  More people
should (and are likely to) use it.  So move it to libutil.

I think this needs a man page now (not included), but this is the code.

Index: lib/libutil/Makefile
===
RCS file: /cvs/src/lib/libutil/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- lib/libutil/Makefile2 Aug 2012 13:38:39 -   1.34
+++ lib/libutil/Makefile5 Sep 2012 19:07:28 -
@@ -7,7 +7,7 @@ HDRS=   util.h imsg.h
 SRCS=  check_expire.c duid.c getmaxpartitions.c getrawpartition.c login.c \
login_tty.c logout.c logwtmp.c opendev.c passwd.c pty.c readlabel.c \
login_fbtab.c uucplock.c fparseln.c opendisk.c pidfile.c \
-   fmt_scaled.c imsg.c imsg-buffer.c
+   fmt_scaled.c imsg.c imsg-buffer.c pbkdf2.c
 
 MAN=   check_expire.3 getmaxpartitions.3 getrawpartition.3 isduid.3 login.3 \
opendev.3 openpty.3 pw_init.3 pw_lock.3 readlabelfs.3 uucplock.3 \
Index: lib/libutil/pbkdf2.c
===
RCS file: lib/libutil/pbkdf2.c
diff -N lib/libutil/pbkdf2.c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ lib/libutil/pbkdf2.c5 Sep 2012 19:08:09 -
@@ -0,0 +1,253 @@
+/* $OpenBSD: pbkdf2.c,v 1.2 2012/06/28 20:42:22 mikeb Exp $*/
+
+/*-
+ * Copyright (c) 2008 Damien Bergamini damien.bergam...@free.fr
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include sys/types.h
+#include sys/param.h
+
+#include string.h
+#include limits.h
+#include stdlib.h
+#include util.h
+
+#include sha1.h
+
+
+/* #define PBKDF2_MAIN */
+
+/*
+ * HMAC-SHA-1 (from RFC 2202).
+ */
+static void
+hmac_sha1(const u_int8_t *text, size_t text_len, const u_int8_t *key,
+size_t key_len, u_int8_t digest[SHA1_DIGEST_LENGTH])
+{
+   SHA1_CTX ctx;
+   u_int8_t k_pad[SHA1_BLOCK_LENGTH];
+   u_int8_t tk[SHA1_DIGEST_LENGTH];
+   int i;
+
+   if (key_len  SHA1_BLOCK_LENGTH) {
+   SHA1Init(ctx);
+   SHA1Update(ctx, key, key_len);
+   SHA1Final(tk, ctx);
+
+   key = tk;
+   key_len = SHA1_DIGEST_LENGTH;
+   }
+
+   bzero(k_pad, sizeof k_pad);
+   bcopy(key, k_pad, key_len);
+   for (i = 0; i  SHA1_BLOCK_LENGTH; i++)
+   k_pad[i] ^= 0x36;
+
+   SHA1Init(ctx);
+   SHA1Update(ctx, k_pad, SHA1_BLOCK_LENGTH);
+   SHA1Update(ctx, text, text_len);
+   SHA1Final(digest, ctx);
+
+   bzero(k_pad, sizeof k_pad);
+   bcopy(key, k_pad, key_len);
+   for (i = 0; i  SHA1_BLOCK_LENGTH; i++)
+   k_pad[i] ^= 0x5c;
+
+   SHA1Init(ctx);
+   SHA1Update(ctx, k_pad, SHA1_BLOCK_LENGTH);
+   SHA1Update(ctx, digest, SHA1_DIGEST_LENGTH);
+   SHA1Final(digest, ctx);
+}
+
+/*
+ * Password-Based Key Derivation Function 2 (PKCS #5 v2.0).
+ * Code based on IEEE Std 802.11-2007, Annex H.4.2.
+ */
+int
+pkcs5_pbkdf2(const char *pass, size_t pass_len, const char *salt, size_t 
salt_len,
+u_int8_t *key, size_t key_len, u_int rounds)
+{
+   u_int8_t *asalt, obuf[SHA1_DIGEST_LENGTH];
+   u_int8_t d1[SHA1_DIGEST_LENGTH], d2[SHA1_DIGEST_LENGTH];
+   u_int i, j;
+   u_int count;
+   size_t r;
+
+   if (rounds  1 || key_len == 0)
+   return -1;
+   if (salt_len == 0 || salt_len  SIZE_MAX - 4)
+   return -1;
+   if ((asalt = malloc(salt_len + 4)) == NULL)
+   return -1;
+
+   memcpy(asalt, salt, salt_len);
+
+   for (count = 1; key_len  0; count++) {
+   asalt[salt_len + 0] = (count  24)  0xff;
+   asalt[salt_len + 1] = (count  16)  0xff;
+   asalt[salt_len + 2] = (count  8)  0xff;
+   asalt[salt_len + 3] = count  0xff;
+   hmac_sha1(asalt, salt_len + 4, pass, pass_len, d1);
+   memcpy(obuf, d1, sizeof(obuf));
+
+   for (i = 1; i  rounds; i++) {
+   hmac_sha1(d1, sizeof(d1), pass, pass_len, d2);
+   memcpy(d1, d2, sizeof(d1));
+   for (j = 0; j  sizeof(obuf); j++)
+   obuf[j] ^= d1[j];
+   }
+
+   r = MIN(key_len, SHA1_DIGEST_LENGTH);
+ 

mdoc.template license

2012-09-05 Thread Ted Unangst
More people would write man pages if they didn't have to reformat the
license block. Provide a default.

Index: mdoc.template
===
RCS file: /cvs/src/share/misc/mdoc.template,v
retrieving revision 1.12
diff -u -p -r1.12 mdoc.template
--- mdoc.template   4 Sep 2010 08:00:15 -   1.12
+++ mdoc.template   5 Sep 2012 19:24:58 -
@@ -1,5 +1,19 @@
 .\$OpenBSD: mdoc.template,v 1.12 2010/09/04 08:00:15 jmc Exp $
 .\
+.\ Copyright (c) CCYY YOUR NAME HERE u...@your.dom.ain
+.\
+.\ Permission to use, copy, modify, and distribute this software for any
+.\ purpose with or without fee is hereby granted, provided that the above
+.\ copyright notice and this permission notice appear in all copies.
+.\
+.\ THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\
 .\ The following requests are required for all man pages.
 .\
 .\ Remove `\' from the line below.



pbkdf2 manpage

2012-09-05 Thread Ted Unangst
A start at a man page.  Just enough to commit. :)

I have also renamed the C file to pkcs5_pbkdf2.c to reflect the name
of the function.

Index: Makefile
===
RCS file: /cvs/src/lib/libutil/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- Makefile2 Aug 2012 13:38:39 -   1.34
+++ Makefile5 Sep 2012 19:28:12 -
@@ -7,11 +7,12 @@ HDRS= util.h imsg.h
 SRCS=  check_expire.c duid.c getmaxpartitions.c getrawpartition.c login.c \
login_tty.c logout.c logwtmp.c opendev.c passwd.c pty.c readlabel.c \
login_fbtab.c uucplock.c fparseln.c opendisk.c pidfile.c \
-   fmt_scaled.c imsg.c imsg-buffer.c
+   fmt_scaled.c imsg.c imsg-buffer.c pkcs5_pbkdf2.c
 
 MAN=   check_expire.3 getmaxpartitions.3 getrawpartition.3 isduid.3 login.3 \
opendev.3 openpty.3 pw_init.3 pw_lock.3 readlabelfs.3 uucplock.3 \
-   fparseln.3 opendisk.3 login_fbtab.3 pidfile.3 fmt_scaled.3 imsg_init.3
+   fparseln.3 opendisk.3 login_fbtab.3 pidfile.3 fmt_scaled.3 imsg_init.3 \
+   pkcs5_pbkdf2.3
 
 MLINKS+=imsg_init.3 imsg_read.3
 MLINKS+=imsg_init.3 imsg_get.3
Index: pkcs5_pbkdf2.3
===
RCS file: pkcs5_pbkdf2.3
diff -N pkcs5_pbkdf2.3
--- /dev/null   1 Jan 1970 00:00:00 -
+++ pkcs5_pbkdf2.3  5 Sep 2012 19:43:52 -
@@ -0,0 +1,55 @@
+.\$OpenBSD: mdoc.template,v 1.12 2010/09/04 08:00:15 jmc Exp $
+.\
+.\ Copyright (c) 2012 Ted Unangst t...@openbsd.org
+.\
+.\ Permission to use, copy, modify, and distribute this software for any
+.\ purpose with or without fee is hereby granted, provided that the above
+.\ copyright notice and this permission notice appear in all copies.
+.\
+.\ THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\
+.Dd $Mdocdate$
+.Dt pkcs5_pbkdf2 3
+.Os
+.Sh NAME
+.Nm pkcs5_pbkdf2
+.Nd password based key derivation function
+.Sh SYNOPSIS
+.Fd #include util.h
+.Ft int
+.Fn pkcs5_pbkdf2 conat char *pass size_t pass_len const char *salt \
+size_t salt_len u_int8_t *key size_t key_len u_int rounds
+.Sh DESCRIPTION
+The
+.Nm
+function converts a password into a key suitable for encryption.
+The password and salt values are combined and repeatedly hashed
+.Ar rounds
+times.
+The repeated hashing is designed to thwart password guessing attacks from
+discovering the key.
+The higher the number of rounds, the slower each attempt will be.
+A minumum value of at least 1000 is recommended.
+.Sh RETURN VALUES
+The
+.Fn pkcs5_pbkdf2
+function returns 0 to indicate success and -1 for failure.
+.\ .Sh EXAMPLES
+.\ .Sh ERRORS
+.Sh SEE ALSO
+.Xr sha1 1
+.Sh STANDARDS
+RFC 2898
+.\ .Sh HISTORY
+.\ .Sh AUTHORS
+.Sh CAVEATS
+The standard allows for different hash functions to be used.
+This implementation only uses
+.Xr sha1 1 .
+.\ .Sh BUGS



Re: [Patch] Virtio drivers for OpenBSD V9

2012-09-05 Thread Stefan Fritsch
On Tuesday 04 September 2012, LEVAI Daniel wrote:
 On v, szept 02, 2012 at 12:13:33 +0200, Stefan Fritsch wrote:
  On Saturday 01 September 2012, LEVAI Daniel wrote:
I've just started to test this with an OpenBSD guest on a
Linux host. vio0 NIC and the virtio disk work like a charm.
I have a slightly (~10%) better performance with the ide
emulation than with virtio, but nevertheless it works.
  
  Thanks for testing. How did you test the performance?
 
 I've just used dd(1) to transfer files on the same disk and
 partition.

On my system, the behavior is not really consistent: Configuring the 
drive in kvm with cache=writeback, virtio is significantly faster at 
writing and ide is significantly faster at reading. With cache=none, 
it's the other way round and with smaller differences (5%). Ide is 
slightly faster at writing and virtio is slightly faster at reading.
There is obviously room for optimization...

  These are just debugging leftovers. I will remove them in the
  next version.

At http://www.sfritsch.de/~stf/openbsd-virtio/openbsd-virtio-v9.diff , 
there is a new version without the debugging output in vioblk. There 
are no other differences to v8.

Cheers,
Stefan



delete compat aout

2012-09-05 Thread Ted Unangst
compat_aout has so far survived the purges by keeping its head down,
but now its time has come.  this code does not and cannot work anymore,
since a.out binaries use system calls long since removed.

not shown in the diff is removing of the compat/aout directory.  in
theory, this code could be used by another architecture.  but nobody's
moving to elf soon, and even so, they can jump the old fashioned way
by downloading a snapshot, so i'll be deleting that as well.

Index: arch/i386/conf/files.i386
===
RCS file: /cvs/src/sys/arch/i386/conf/files.i386,v
retrieving revision 1.210
diff -u -p -r1.210 files.i386
--- arch/i386/conf/files.i386   27 May 2012 12:24:33 -  1.210
+++ arch/i386/conf/files.i386   5 Sep 2012 20:25:40 -
@@ -270,9 +270,6 @@ filearch/i386/i386/vm86.c   vm86
 file   arch/i386/i386/kvm86.c  kvm86
 file   arch/i386/i386/kvm86call.S  kvm86
 
-# a.out binary compatibility (COMPAT_AOUT)
-include compat/aout/files.aout
-
 # Linux binary compatibility (COMPAT_LINUX)
 include compat/linux/files.linux
 file   arch/i386/i386/linux_machdep.c  compat_linux
Index: arch/i386/i386/trap.c
===
RCS file: /cvs/src/sys/arch/i386/i386/trap.c,v
retrieving revision 1.103
diff -u -p -r1.103 trap.c
--- arch/i386/i386/trap.c   7 Aug 2012 05:16:53 -   1.103
+++ arch/i386/i386/trap.c   5 Sep 2012 20:26:46 -
@@ -71,9 +71,6 @@
 #include compat/linux/linux_syscall.h
 extern struct emul emul_linux_aout, emul_linux_elf;
 #endif
-#ifdef COMPAT_AOUT
-extern struct emul emul_aout;
-#endif
 #ifdef KVM86
 #include machine/kvm86.h
 #define KVM86MODE (kvm86_incall)
@@ -588,11 +585,7 @@ syscall(struct trapframe *frame)
 * Like syscall, but code is a quad, so as to maintain
 * quad alignment for the rest of the arguments.
 */
-   if (callp != sysent
-#ifdef COMPAT_AOUT
-p-p_emul != emul_aout
-#endif
-   )
+   if (callp != sysent)
break;
copyin(params + _QUAD_LOWWORD * sizeof(int), code, 
sizeof(int));
params += sizeof(quad_t);
Index: kern/exec_aout.c
===
RCS file: /cvs/src/sys/kern/exec_aout.c,v
retrieving revision 1.10
diff -u -p -r1.10 exec_aout.c
--- kern/exec_aout.c12 Nov 2005 04:31:24 -  1.10
+++ kern/exec_aout.c5 Sep 2012 20:28:30 -
@@ -41,9 +41,6 @@
 #include uvm/uvm_extern.h
 
 #if defined(_KERN_DO_AOUT)
-#if defined(COMPAT_AOUT)
-void aout_compat_setup(struct exec_package *epp);
-#endif
 
 /*
  * exec_aout_makecmds(): Check if it's an a.out-format executable.
@@ -90,9 +87,6 @@ exec_aout_makecmds(struct proc *p, struc
 
if (error)
kill_vmcmds(epp-ep_vmcmds);
-#ifdef COMPAT_AOUT
-   aout_compat_setup(epp);
-#endif
 
return error;
 }
Index: kern/exec_conf.c
===
RCS file: /cvs/src/sys/kern/exec_conf.c,v
retrieving revision 1.28
diff -u -p -r1.28 exec_conf.c
--- kern/exec_conf.c4 Jul 2011 22:53:53 -   1.28
+++ kern/exec_conf.c5 Sep 2012 20:28:54 -
@@ -54,11 +54,7 @@ extern struct emul emul_native, emul_elf
 struct execsw execsw[] = {
{ EXEC_SCRIPT_HDRSZ, exec_script_makecmds, emul_native, }, /* 
shell scripts */
 #ifdef _KERN_DO_AOUT
-#ifdef COMPAT_AOUT
-   { sizeof(struct exec), exec_aout_makecmds, emul_aout },
-#else
{ sizeof(struct exec), exec_aout_makecmds, emul_native },  /* 
a.out binaries */
-#endif
 #endif
 #ifdef _KERN_DO_ECOFF
{ ECOFF_HDR_SIZE, exec_ecoff_makecmds, emul_native },  /* ecoff 
binaries */



Re: delete compat aout

2012-09-05 Thread Ted Unangst
On Wed, Sep 05, 2012 at 16:55, Ted Unangst wrote:

 not shown in the diff is removing of the compat/aout directory.  in
 theory, this code could be used by another architecture.  but nobody's
 moving to elf soon, and even so, they can jump the old fashioned way
 by downloading a snapshot, so i'll be deleting that as well.

Actually, vax won't use this code anyway.  It's only useful for
allowing a.out binaries to load shared libraries, which don't exist on
vax.  You can still exec static a.out binaries without compat_aout.