Re: Minor clarifications for bioctl.8 and softraid.4

2010-09-13 Thread Chris Palmer
Jason McIntyre writes:

 ok, my diff below tries to collect the various bits of feedback. stuff i
 haven't taken:

Thanks for doing this.

 - delete - detach, for reasons given by marco

I'd still like to reconsider this.

 - `` - ; i don't think it's worth changing

But it looks silly with the other style of quotes right next to it in the
page:

 ``Unused'', promote it to being a ``Hot Spare''.

 -h  Where necessary, produce human-readable output.  Use unit suffix-

I like all my bike sheds to be painted a single consistent color. :)

 feel free to argue. anyway, here's what i have. ok?

It's ok by me, even if I wasn't able to convince you on the above points.


-- 
http://noncombatant.org/



raise the openings on mpi(4)

2010-09-13 Thread David Gwynne
last time i tried this i caused weird issues on people using the
SPI variants of mpi(4).

this restricts the large number of openings to the SAS or FC mpi(4)
variants, both of which i have succesffully tested myself.

ok?

Index: mpi.c
===
RCS file: /cvs/src/sys/dev/ic/mpi.c,v
retrieving revision 1.161
diff -u -p -r1.161 mpi.c
--- mpi.c   13 Sep 2010 07:48:12 -  1.161
+++ mpi.c   13 Sep 2010 07:49:52 -
@@ -339,7 +340,10 @@ mpi_attach(struct mpi_softc *sc)
sc-sc_link.adapter_softc = sc;
sc-sc_link.adapter_target = sc-sc_target;
sc-sc_link.adapter_buswidth = sc-sc_buswidth;
-   sc-sc_link.openings = sc-sc_maxcmds / sc-sc_buswidth;
+   if (sc-sc_porttype == MPI_PORTFACTS_PORTTYPE_SCSI)
+   sc-sc_link.openings = sc-sc_maxcmds / sc-sc_buswidth;
+   else
+   sc-sc_link.openings = sc-sc_maxcmds;
sc-sc_link.pool = sc-sc_iopool;
 
bzero(saa, sizeof(saa));



Re: patch to add RequestHeader directive to httpd mod_headers.c

2010-09-13 Thread Sebastian Reitenbach
Hi,

thanks for taking a look.

On Sunday 12 September 2010 09:33:44 pm you wrote:
 On 09/12/10 18:20, Sebastian Reitenbach wrote:
  -table *tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
  +table *tbl;
  +switch (hdr-inout) {
  +case hdrs_out:
  +  tbl = r-headers_out;
  +  break;
  +case hdrs_in:
  +  tbl = r-headers_in;
  +  break;
  +}
  +tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);

 Err... Set tbl above and then set it again?
Ah, after looking at it again, I see. Will provide sth. new when I'm back 
home.


 Also, what's with the indentation?
ugh. yes. will fix that too.


   switch (hdr-action) {
   case hdr_add:
   ap_table_addn(tbl, hdr-header, hdr-value);

Sebastian



DELIVRANCE DES C.N.I POUR LES PROCHAINES ELECTIONS

2010-09-13 Thread CICG (Centre d'Information et de Communication Gouvernementale)
Visitez le portail officiel du Gouvernement de Ctte d'Ivoire, Cliquez ici (
http://www.gouv.ci; )  
( http://www.gouv.ci; )

COMMUNIQUE DE LA COMMISSION ELECTORALE INDEPENDANTE
(C.E.I)


 



DELIVRANCE DES C.N.I AUX POPULATONS IVOIRIENNES POUR LES PROCHAINES ELECTIONS


( http://www.gouv.ci/communique_gouv.php?recordID=93; )


 
 COMMUNIQUE



   
   Le Prisident de la Ripublique a signi, le jeudi 9 septembre 2010, peu aprhs
Conseil des ministres s'est tenu le mjme jour au Palais prisidentiel, le
dicret portant autorisation de dilivrance des cartes d'identiti aux Ivoiriens
figurant sur la liste ilectorale difinitive. C'itait en prisence des membres
du gouvernement, conduits par le Premier ministre Guillaume Soro Kigbafori,
des premiers responsables des structures techniques en charge des ilections
que sont  la Commission Electorale Indipendante (CEI), l'Office National
d'Identification(ONI), la SAGEM, l'Institut National des Statistiques (INS),
la Commission Nationale de Supervision de l'Identification (CNSI) et de M.
Young-Jin Choi, Reprisentant spicial du Secritaire Giniral des Nations Unies.
Ci-dessous l'intigraliti du dicret lu par le Secritaire Giniral du
Gouvernement, M. Filix Tyioulou-Dyila : 

 A lire ici. (
http://www.gouv.ci/actualite_politique.php?recordID=1159; )







 



   







 Le Conseil des Ministres



Le Conseil des Ministres s'est tenu le jeudi 26 ao{t 2010, de 13H15mn `14H30
mn au Palais de la Prisidence de la Ripublique au Plateau, sous la prisidence
de Son Excellence Monsieur Laurent GBAGBO, Prisident de la Ripublique.



Lire plus [+] ( http://www.gouv.ci/conseil_ministre.php?recordID=82; )
 
  Le Site Web de la semaine 

-
( http://www.plan.gouv.ci/; )



 Visitez ce site  ( http://www.plan.gouv.ci/; )


 
  Grands dossiers

 
( http://www.gouv.ci/bonnegouvernance2009_2013.php; )



--



 ( http://www.gouv.ci/ajustemet_prix_petrol31052010.php; )


 
 

 




 
 

LA COMMUNICATION AU COEUR DE L'ACTION GOUVERNEMENTALE
   Continuez de nous faire part de vos suggestions (
http://www.gouv.ci/webmaster.php; ). 
Merci ` toutes celles et tous ceux qui nous ont dij` icrit !



 

Si vous ne souhaitez plus recevoir notre lettre d'informations, cliquez ici
pour vous disabonner
 

[demime 1.01d removed an attachment of type image/jpeg which had a name of 
=?iso-8859-1?Q?ajustemet=5Fprix=5Foro2.Jpg?=]

[demime 1.01d removed an attachment of type image/jpeg which had a name of 
=?iso-8859-1?Q?bonne_gouvernance.Jpg?=]

[demime 1.01d removed an attachment of type image/jpeg which had a name of 
=?iso-8859-1?Q?decret=5Fcni.Jpg?=]

[demime 1.01d removed an attachment of type image/jpeg which had a name of 
=?iso-8859-1?Q?gouvletter.jpg?=]

[demime 1.01d removed an attachment of type image/jpeg which had a name of 
=?iso-8859-1?Q?logo.jpg?=]

[demime 1.01d removed an attachment of type image/jpeg which had a name of 
=?iso-8859-1?Q?Minist=E8re_du_plan_et_du_d=E9veloppement.Jpg?=]



aibs(4) support for newer asus boards

2010-09-13 Thread Claudio Jeker
On newer ASUS boards the way the aibs(4) sensors are accessed got changed.
So some system will show this:
aibs0 at acpi0
aibs0: TSIF not found
aibs0: FSIF not found
aibs0: VSIF not found
aibs0: no sensors found

The following diff adds support for those systems (using GGRP, GITM to
enumerate and poll sensor values). New mode is used when the RTMP, RVLT,
and RFAN AML nodes are not present else the old behaviour is used.

This needs testing on all systems with aibs(4) to ensure that no
regression got introduced. People with ACPI knowledge should verify that I
did not do anything crazy in ACPI land.

-- 
:wq Claudio

Index: atk0110.c
===
RCS file: /cvs/src/sys/dev/acpi/atk0110.c,v
retrieving revision 1.4
diff -u -p -r1.4 atk0110.c
--- atk0110.c   17 May 2010 21:59:45 -  1.4
+++ atk0110.c   13 Sep 2010 08:45:29 -
@@ -40,6 +40,19 @@
  * -- cnst.su.
  */
 
+#define ATK_ID_MUX_HWMON   0x0006
+
+#define ATK_CLASS(x)   (((x)  24)  0xff)
+#define ATK_CLASS_FREQ_CTL 3
+#define ATK_CLASS_FAN_CTL  4
+#define ATK_CLASS_HWMON6
+#define ATK_CLASS_MGMT 17
+
+#define ATK_TYPE(x)(((x)  16)  0xff)
+#define ATK_TYPE_VOLT  2
+#define ATK_TYPE_TEMP  3
+#define ATK_TYPE_FAN   4
+
 #define AIBS_MORE_SENSORS
 /* #define AIBS_VERBOSE */
 
@@ -48,6 +61,7 @@ struct aibs_sensor {
int64_t i;
int64_t l;
int64_t h;
+   SIMPLEQ_ENTRY(aibs_sensor)  entry;
 };
 
 struct aibs_softc {
@@ -56,20 +70,46 @@ struct aibs_softc {
struct acpi_softc   *sc_acpi;
struct aml_node *sc_devnode;
 
-   struct aibs_sensor  *sc_asens_volt;
-   struct aibs_sensor  *sc_asens_temp;
-   struct aibs_sensor  *sc_asens_fan;
+   struct aml_node *sc_ggrpnode;
+   struct aml_node *sc_gitmnode;
+   struct aml_node *sc_sitmnode;
+   struct aml_node *sc_rtmpnode;
+   struct aml_node *sc_rvltnode;
+   struct aml_node *sc_rfannode;
 
+   SIMPLEQ_HEAD(, aibs_sensor) sc_sensorlist;
struct ksensordev   sc_sensordev;
+
+   int sc_mode;/* 1 = new, 0 = old */
+};
+
+/* Command buffer used for GITM and SITM methods */
+struct aibs_cmd_buffer {
+   u_int32_t   id;
+   u_int32_t   param1;
+   u_int32_t   param2;
 };
 
+/* Return buffer used by the GITM and SITM mehtods */
+struct aibs_ret_buffer {
+   u_int32_t   flags;
+   u_int32_t   value;
+   /* there is more stuff that is unknown */
+};
 
 intaibs_match(struct device *, void *, void *);
 void   aibs_attach(struct device *, struct device *, void *);
 void   aibs_refresh(void *);
 
 void   aibs_attach_sif(struct aibs_softc *, enum sensor_type);
-void   aibs_refresh_r(struct aibs_softc *, enum sensor_type);
+void   aibs_attach_new(struct aibs_softc *);
+void   aibs_add_sensor(struct aibs_softc *, char *);
+void   aibs_refresh_r(struct aibs_softc *, struct aibs_sensor *);
+intaibs_getvalue(struct aibs_softc *, int64_t, int64_t *);
+intaibs_getpack(struct aibs_softc *, struct aml_node *, int64_t,
+   struct aml_value *);
+void   aibs_probe(struct aibs_softc *);
+intaibs_find_cb(struct aml_node *, void *);
 
 
 struct cfattach aibs_ca = {
@@ -103,14 +143,20 @@ aibs_attach(struct device *parent, struc
sc-sc_acpi = (struct acpi_softc *)parent;
sc-sc_devnode = aa-aaa_node;
 
-   printf(\n);
-
strlcpy(sc-sc_sensordev.xname, sc-sc_dev.dv_xname,
sizeof(sc-sc_sensordev.xname));
+   SIMPLEQ_INIT(sc-sc_sensorlist);
 
-   aibs_attach_sif(sc, SENSOR_TEMP);
-   aibs_attach_sif(sc, SENSOR_FANRPM);
-   aibs_attach_sif(sc, SENSOR_VOLTS_DC);
+   aibs_probe(sc);
+   printf(\n);
+
+   if (sc-sc_mode)
+   aibs_attach_new(sc);
+   else {
+   aibs_attach_sif(sc, SENSOR_TEMP);
+   aibs_attach_sif(sc, SENSOR_FANRPM);
+   aibs_attach_sif(sc, SENSOR_VOLTS_DC);
+   }
 
if (sc-sc_sensordev.sensors_count == 0) {
printf(%s: no sensors found\n, DEVNAME(sc));
@@ -132,7 +178,6 @@ aibs_attach_sif(struct aibs_softc *sc, e
struct aml_value**v;
int i, n;
charname[] = ?SIF;
-   struct aibs_sensor  *as;
 
switch (st) {
case SENSOR_TEMP:
@@ -153,13 +198,11 @@ aibs_attach_sif(struct aibs_softc *sc, e
aml_freevalue(res);
return;
}
-
if (res.type != AML_OBJTYPE_PACKAGE) {
printf(%s: %s: not a package\n, DEVNAME(sc), name);
aml_freevalue(res);
return;
}
-
v = res.v_package;
if (v[0]-type != AML_OBJTYPE_INTEGER) {

Re: Minor clarifications for bioctl.8 and softraid.4

2010-09-13 Thread Owain Ainsworth
On Sun, Sep 12, 2010 at 11:00:47PM -0700, Chris Palmer wrote:
 Jason McIntyre writes:
 
  ok, my diff below tries to collect the various bits of feedback. stuff i
  haven't taken:
 
 Thanks for doing this.
 
  - delete - detach, for reasons given by marco
 
 I'd still like to reconsider this.
 
  - `` - ; i don't think it's worth changing
 
 But it looks silly with the other style of quotes right next to it in the
 page:

Admittedly, from purely anecdotal evidence I am used to seeing that
quoting style in our manpages, so I would make the change for the sake
of consistency.

-0-
-- 
If the code and the comments disagree, then both are probably wrong.
-- Norm Schryer



Re: raise the openings on mpi(4)

2010-09-13 Thread Kenneth R Westerback
On Mon, Sep 13, 2010 at 05:52:31PM +1000, David Gwynne wrote:
 last time i tried this i caused weird issues on people using the
 SPI variants of mpi(4).
 
 this restricts the large number of openings to the SAS or FC mpi(4)
 variants, both of which i have succesffully tested myself.
 
 ok?

ok krw@

 Ken

 
 Index: mpi.c
 ===
 RCS file: /cvs/src/sys/dev/ic/mpi.c,v
 retrieving revision 1.161
 diff -u -p -r1.161 mpi.c
 --- mpi.c 13 Sep 2010 07:48:12 -  1.161
 +++ mpi.c 13 Sep 2010 07:49:52 -
 @@ -339,7 +340,10 @@ mpi_attach(struct mpi_softc *sc)
   sc-sc_link.adapter_softc = sc;
   sc-sc_link.adapter_target = sc-sc_target;
   sc-sc_link.adapter_buswidth = sc-sc_buswidth;
 - sc-sc_link.openings = sc-sc_maxcmds / sc-sc_buswidth;
 + if (sc-sc_porttype == MPI_PORTFACTS_PORTTYPE_SCSI)
 + sc-sc_link.openings = sc-sc_maxcmds / sc-sc_buswidth;
 + else
 + sc-sc_link.openings = sc-sc_maxcmds;
   sc-sc_link.pool = sc-sc_iopool;
  
   bzero(saa, sizeof(saa));



Re: raise the openings on mpi(4)

2010-09-13 Thread Marco Peereboom
Meh.  Code has changed a lot since then and we should just raise them
all and see if this is still an issue.

On Mon, Sep 13, 2010 at 05:52:31PM +1000, David Gwynne wrote:
 last time i tried this i caused weird issues on people using the
 SPI variants of mpi(4).
 
 this restricts the large number of openings to the SAS or FC mpi(4)
 variants, both of which i have succesffully tested myself.
 
 ok?
 
 Index: mpi.c
 ===
 RCS file: /cvs/src/sys/dev/ic/mpi.c,v
 retrieving revision 1.161
 diff -u -p -r1.161 mpi.c
 --- mpi.c 13 Sep 2010 07:48:12 -  1.161
 +++ mpi.c 13 Sep 2010 07:49:52 -
 @@ -339,7 +340,10 @@ mpi_attach(struct mpi_softc *sc)
   sc-sc_link.adapter_softc = sc;
   sc-sc_link.adapter_target = sc-sc_target;
   sc-sc_link.adapter_buswidth = sc-sc_buswidth;
 - sc-sc_link.openings = sc-sc_maxcmds / sc-sc_buswidth;
 + if (sc-sc_porttype == MPI_PORTFACTS_PORTTYPE_SCSI)
 + sc-sc_link.openings = sc-sc_maxcmds / sc-sc_buswidth;
 + else
 + sc-sc_link.openings = sc-sc_maxcmds;
   sc-sc_link.pool = sc-sc_iopool;
  
   bzero(saa, sizeof(saa));



find(1) manpage patch (was: system/6462: find(1) -print wtf [non-bug])

2010-09-13 Thread Joachim Schipper
On Mon, Sep 13, 2010 at 09:55:17AM +0200, Joachim Schipper wrote:
 On Thu, Sep 09, 2010 at 10:15:01PM -0600, Tim Chase wrote:
  On 09/09/10 20:37, d...@mindrot.org wrote [lightly edited]:
   $ touch foo.orig foo.rej
   $ find . -type f -name \*.orig -or -name \*.rej
   ./foo.orig
   ./foo.rej
   $ find . -type f -name \*.orig -or -name \*.rej -print
   ./foo.rej
  
   [WTF?!]
   
   Not a bug, but rather order of operations  short-circuit logic 
   evaluation.
 
 Perhaps we could help other people avoid this misunderstanding by
 changing the last EXAMPLE in find(1) to
 
 $ find . \( -name \*.jpg -or -name \*.gif \) -print0 | xargs -0r rm
 
 This would demonstrate proper form, too: use print0 when dealing with
 untrusted filenames (...).

[Please snip bugs@ and Stuart from replies.]

Here are two diffs to find(1).

The first diff changes the last example in find(1). This diff:
- makes it clear that it, in fact, works on all files *under* (not just
  in) the current working directory;
- adds handling of *.gif files to illustrate ordering;
- changes to -print0 | xargs -0r to illustrate proper form.

The second diff is relative to the first diff, and adds the following
warning to CAVEATS:
Using find in combination with xargs(1) requires some care:

$ find . -name \e*.jpg | xargs rm

would, given a file *important\n.jpg* (where *\n* is a newline),
remove *important*. Use the -print0 or -X flags, or use -exec
instead.

This is already addressed in the man page (e.g. under the description of
-print0 or -X), but many people (including the EXAMPLES) get it wrong;
hopefully the above warning (and the references from the description of
-print and the EXAMPLES section) prevents some people from making this
mistake.

Joachim

Index: find.1
===
RCS file: /cvs/src/usr.bin/find/find.1,v
retrieving revision 1.78
diff -u -p -r1.78 find.1
--- find.1  15 Jul 2010 20:51:38 -  1.78
+++ find.1  13 Sep 2010 12:29:56 -
@@ -525,11 +525,11 @@ ending in a dot and single digit, but sk
 .Pp
 .Dl $ find /usr/src -path /usr/src/gnu -prune -or -name \e*.[0-9]
 .Pp
-Find and remove all *.jpg files in the current working directory:
+Find and remove all *.jpg or *.gif files under the current working directory:
 .Pp
-.Dl $ find . -name \e*.jpg -exec rm {} \e;
+.Dl $ find . \e( -name \e*.jpg -o -name \e*.gif \e) -exec rm {} \e;
 or
-.Dl $ find . -name \e*.jpg | xargs rm
+.Dl $ find . \e( -name \e*.jpg -o -name \e*.gif \e) -print0 | xargs -0r rm
 .Sh SEE ALSO
 .Xr chflags 1 ,
 .Xr chmod 1 ,

--- find.1  Mon Sep 13 14:12:53 2010
+++ find.1.new  Mon Sep 13 14:32:38 2010
@@ -382,7 +382,10 @@
 It prints the pathname of the current file to standard output, followed
 by a newline
 .Pq Ql \en
-character.
+character. This should not be used in conjunction with
+.Xr xargs 1 ,
+see
+.Sx CAVEATS .
 .It Ic -print0
 This primary always evaluates to true.
 It prints the pathname of the current file to standard output, followed
@@ -530,6 +533,13 @@
 .Dl $ find . \e( -name \e*.jpg -o -name \e*.gif \e) -exec rm {} \e;
 or
 .Dl $ find . \e( -name \e*.jpg -o -name \e*.gif \e) -print0 | xargs -0r rm
+.Pp
+Note the use of
+.Ic -exec
+or
+.Ic -print0 ;
+see
+.Sx CAVEATS .
 .Sh SEE ALSO
 .Xr chflags 1 ,
 .Xr chmod 1 ,
@@ -637,6 +647,26 @@
 and
 .Ql \;
 may have to be escaped from the shell.
+.Pp
+Using
+.Nm
+in combination with
+.Xr xargs 1
+requires some care:
+.Pp
+.Dl $ find . -name \e*.jpg | xargs rm
+.Pp
+would, given a file
+.Pa important\en.jpg
+(where \en is a newline), remove
+.Pa important .
+Use the
+.Ic -print0
+or
+.Ic -X
+flags, or use
+.Ic -exec
+instead.
 .Pp
 As there is no delimiter separating options and file names or file
 names and the



Re: Minor clarifications for bioctl.8 and softraid.4

2010-09-13 Thread Jason McIntyre
On Sun, Sep 12, 2010 at 11:00:47PM -0700, Chris Palmer wrote:
 Jason McIntyre writes:
 
  ok, my diff below tries to collect the various bits of feedback. stuff i
  haven't taken:
 
 Thanks for doing this.
 
  - delete - detach, for reasons given by marco
 
 I'd still like to reconsider this.
 

if marco indicates he's alright with it, i'll add it.

  - `` - ; i don't think it's worth changing
 
 But it looks silly with the other style of quotes right next to it in the
 page:
 
  ``Unused'', promote it to being a ``Hot Spare''.
 
  -h  Where necessary, produce human-readable output.  Use unit 
 suffix-
 

ok, i will make this change.

i'll hold off from commit to see about the delete/detach thing...

jmc



Re: Minor clarifications for bioctl.8 and softraid.4

2010-09-13 Thread Marco Peereboom
I don't like detach.  bioctl is a generic tool and the intent of that
command is to delete a logical disk of a controller.  The fact that
softraid detaches the disk is a side-effect.  On mfi, for example, that
is a pretty destructive command.

On Mon, Sep 13, 2010 at 03:10:12PM +0100, Jason McIntyre wrote:
 On Sun, Sep 12, 2010 at 11:00:47PM -0700, Chris Palmer wrote:
  Jason McIntyre writes:
  
   ok, my diff below tries to collect the various bits of feedback. stuff i
   haven't taken:
  
  Thanks for doing this.
  
   - delete - detach, for reasons given by marco
  
  I'd still like to reconsider this.
  
 
 if marco indicates he's alright with it, i'll add it.
 
   - `` - ; i don't think it's worth changing
  
  But it looks silly with the other style of quotes right next to it in the
  page:
  
   ``Unused'', promote it to being a ``Hot Spare''.
  
   -h  Where necessary, produce human-readable output.  Use unit 
  suffix-
  
 
 ok, i will make this change.
 
 i'll hold off from commit to see about the delete/detach thing...
 
 jmc



Re: Minor clarifications for bioctl.8 and softraid.4

2010-09-13 Thread Marco Peereboom
sure.

On Mon, Sep 13, 2010 at 03:29:19PM +0100, Jason McIntyre wrote:
 On Mon, Sep 13, 2010 at 09:18:10AM -0500, Marco Peereboom wrote:
  I don't like detach.  bioctl is a generic tool and the intent of that
  command is to delete a logical disk of a controller.  The fact that
  softraid detaches the disk is a side-effect.  On mfi, for example, that
  is a pretty destructive command.
  
 
 ok. alright with the rest of the diff?
 jmc
 
 Index: bioctl.8
 ===
 RCS file: /cvs/src/sbin/bioctl/bioctl.8,v
 retrieving revision 1.80
 diff -u -r1.80 bioctl.8
 --- bioctl.8  31 Dec 2009 14:00:45 -  1.80
 +++ bioctl.8  13 Sep 2010 14:29:28 -
 @@ -119,7 +119,9 @@
  promote it to being a
  .Dq Hot Spare .
  .It Fl h
 -Where necessary, produce human-readable output.
 +Where necessary, produce
 +.Dq human-readable
 +output.
  Use unit suffixes: Byte, Kilobyte, Megabyte,
  Gigabyte, Terabyte, Petabyte, Exabyte in order to reduce the number of
  digits to four or less.
 @@ -223,7 +225,7 @@
  It cannot be used during the initial creation of the crypto volume.
  .It Fl r Ar rounds
  When creating an encrypted volume, specifies the number of iterations of
 -the algorithm used to convert a passphrase into a key.
 +the PBKDF2 algorithm used to convert a passphrase into a key.
  Higher iteration counts take more time, but offer more resistance to key
  guessing attacks.
  The minimum is 1000 rounds and the default is 8192.
 @@ -245,7 +247,7 @@
  .Ed
  .Pp
  .Nm
 -will ask for a passphrase, that will be needed to unlock the encrypted
 +will ask for a passphrase, which will be needed to unlock the encrypted
  disk.
  After creating a newly encrypted disk, the first megabyte of it should be
  zeroed, so tools like
 @@ -267,6 +269,11 @@
  .Xr bio 4 ,
  .Xr scsi 4 ,
  .Xr softraid 4
 +.Rs
 +.%R RFC 2898
 +.%T PKCS #5: Password-Based Cryptography Specification Version 2.0
 +.%D 2000
 +.Re
  .Sh HISTORY
  The
  .Nm
 @@ -278,4 +285,4 @@
  interface was written by
  .An Marco Peereboom Aq ma...@openbsd.org .
  .Sh CAVEATS
 -Use of the crypto  RAID 4/5 disciplines are currently considered 
 experimental.
 +Use of the CRYPTO  RAID 4/5 disciplines are currently considered 
 experimental.



Re: patch to add RequestHeader directive to httpd mod_headers.c

2010-09-13 Thread Sebastian Reitenbach

Hi,

attached a new revision of the patch. Please comment, and let me know 
whether its OK to add or still sth. wrong.


thanks,
Sebastian

Alexander Hall wrote:
 On 09/12/10 18:20, Sebastian Reitenbach wrote:

 -table *tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
 +table *tbl;
 +switch (hdr-inout) {
 +case hdrs_out:
 +  tbl = r-headers_out;
 +  break;
 +case hdrs_in:
 +  tbl = r-headers_in;
 +  break;
 +}
 +tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);

 Err... Set tbl above and then set it again?

 Also, what's with the indentation?

  switch (hdr-action) {
  case hdr_add:
  ap_table_addn(tbl, hdr-header, hdr-value);






Index: mod_headers.c
===
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_headers.c,v
retrieving revision 1.8
diff -u -r1.8 mod_headers.c
--- mod_headers.c21 Aug 2003 13:11:36 -1.8
+++ mod_headers.c13 Sep 2010 16:15:01 -
@@ -59,13 +59,19 @@
/*
 * mod_headers.c: Add/append/remove HTTP response headers
 * Written by Paul Sutton, p...@ukweb.com, 1 Oct 1996
+ * Updated with RequestHeader by Martin Algesten,
+ *   puck...@taglab.com, 13 Jul 2002.
 *
 * New directive, Header, can be used to add/replace/remove HTTP headers.
 * Valid in both per-server and per-dir configurations.
+ * In addition directive, RequestHeader, can be used exactly as Header but
+ * with the difference that the header is added to the request headers 
rather

+ * than the response.
 *
 * Syntax is:
 *
- *   Header action header value
+ *   Headeraction header value
+ *   RequestHeader action header value
 *
 * Where action is one of:
 * set- set this header, replacing any old value
@@ -77,7 +83,7 @@
 * Where action is unset, the third argument (value) should not be given.
 * The header name can include the colon, or not.
 *
- * The Header directive can only be used where allowed by the FileInfo
+ * The directives can only be used where allowed by the FileInfo
 * override.
 *
 * When the request is processed, the header directives are processed in
@@ -112,7 +118,15 @@
hdr_unset = 'u' /* unset header */
} hdr_actions;

+
+typedef enum {
+hdrs_in  = 'i', /* Add header to incoming (request) 
headers */
+hdrs_out = 'o'  /* Add header to outgoing (response) 
headers */

+} hdrs_inout;
+
+
typedef struct {
+hdrs_inout inout;
hdr_actions action;
char *header;
char *value;
@@ -154,7 +168,7 @@
return a;
}

-static const char *header_cmd(cmd_parms *cmd, headers_conf * dirconf, 
char *action, char *hdr, char *value)
+static const char *header_cmd(cmd_parms *cmd, headers_conf * dirconf, 
char *action, char *hdr, char *value, hdrs_inout inout )

{
header_entry *new;
server_rec *s = cmd-server;
@@ -175,6 +189,8 @@
new-do_err = 0;
}

+new-inout = inout;
+
if (!strcasecmp(action, set))
new-action = hdr_set;
else if (!strcasecmp(action, add))
@@ -202,11 +218,23 @@
return NULL;
}

+static const char *outheader_cmd(cmd_parms *cmd, headers_conf * 
dirconf, char *action, char *hdr, char *value)

+{
+header_cmd( cmd, dirconf, action, hdr, value, hdrs_out );
+}
+
+static const char *inheader_cmd(cmd_parms *cmd, headers_conf * dirconf, 
char *action, char *hdr, char *value)

+{
+header_cmd( cmd, dirconf, action, hdr, value, hdrs_in );
+}
+
static const command_rec headers_cmds[] =
{
-{Header, header_cmd, (void *)0, OR_FILEINFO, TAKE23,
+{Header, outheader_cmd, NULL, OR_FILEINFO, TAKE23,
+ an action, header and value},
+{RequestHeader, inheader_cmd, NULL, OR_FILEINFO, TAKE23,
 an action, header and value},
-{ErrorHeader, header_cmd, (void *)1, OR_FILEINFO, TAKE23,
+{ErrorHeader, outheader_cmd, (void *)1, OR_FILEINFO, TAKE23,
 an action, header and value},
{NULL}
};
@@ -217,7 +245,15 @@

for (i = 0; i  headers-nelts; ++i) {
header_entry *hdr = ((header_entry *) (headers-elts))[i];
-table *tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
+table *tbl;
+switch (hdr-inout) {
+case hdrs_out:
+tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
+break;
+case hdrs_in:
+tbl = r-headers_in;
+break;
+}
switch (hdr-action) {
case hdr_add:
ap_table_addn(tbl, hdr-header, hdr-value);



MCLGETI support for xl(4)

2010-09-13 Thread Loganaden Velvindron

Greetings,

With help from dlg@, claudio@, oga@, miod@  @weerd, I've been trying to 
write

to get mclgeti support for xl(4).

It's been working fine on -current for quite some time.

I've tried flooding it with tcpbench, ping -f, and siege.

I'm looking for feedback on how I can improve it.

Here's the diff:

xlreg.h

Index: src/sys/dev/ic/xlreg.h
===
RCS file: /cvs/src/sys/dev/ic/xlreg.h,v
retrieving revision 1.24
diff -u -p -r1.24 xlreg.h
--- src/sys/dev/ic/xlreg.h  7 Sep 2010 16:21:43 -   1.24
+++ src/sys/dev/ic/xlreg.h  12 Sep 2010 06:33:39 -
@@ -480,7 +480,10 @@ struct xl_chain_data {
   struct xl_chain_onefrag xl_rx_chain[XL_RX_LIST_CNT];
   struct xl_chain xl_tx_chain[XL_TX_LIST_CNT];

-   struct xl_chain_onefrag *xl_rx_head;
+   struct xl_chain_onefrag *xl_rx_cons;
+struct xl_chain_onefrag *xl_rx_prod;
+int  xl_rx_cnt;
+

   /* 3c90x boomerang queuing stuff */
   struct xl_chain *xl_tx_head;

xl.c

Index: src/sys/dev/ic/xl.c
===
RCS file: /cvs/src/sys/dev/ic/xl.c,v
retrieving revision 1.96
diff -u -p -r1.96 xl.c
--- src/sys/dev/ic/xl.c 7 Sep 2010 16:21:43 -   1.96
+++ src/sys/dev/ic/xl.c 12 Sep 2010 10:49:32 -
@@ -180,6 +180,7 @@ void xl_iff(struct xl_softc *);
void xl_iff_90x(struct xl_softc *);
void xl_iff_905b(struct xl_softc *);
int xl_list_rx_init(struct xl_softc *);
+void xl_fill_rx_ring(struct xl_softc *);
int xl_list_tx_init(struct xl_softc *);
int xl_list_tx_init_90xB(struct xl_softc *);
void xl_wait(struct xl_softc *);
@@ -1076,8 +1077,8 @@ xl_list_rx_init(struct xl_softc *sc)
   for (i = 0; i  XL_RX_LIST_CNT; i++) {
   cd-xl_rx_chain[i].xl_ptr =
   (struct xl_list_onefrag *)ld-xl_rx_list[i];
-   if (xl_newbuf(sc, cd-xl_rx_chain[i]) == ENOBUFS)
-   return(ENOBUFS);
+   /*if (xl_newbuf(sc, cd-xl_rx_chain[i]) == ENOBUFS)
+   return(ENOBUFS);*/
   if (i == (XL_RX_LIST_CNT - 1))
   n = 0;
   else
@@ -1088,11 +1089,33 @@ xl_list_rx_init(struct xl_softc *sc)
   ld-xl_rx_list[i].xl_next = htole32(next);
   }

-   cd-xl_rx_head = cd-xl_rx_chain[0];
-
+   cd-xl_rx_prod = cd-xl_rx_cons = cd-xl_rx_chain[0];
+   cd-xl_rx_cnt = 0;
+   xl_fill_rx_ring(sc);
   return (0);
}

+void
+xl_fill_rx_ring(struct xl_softc *sc)
+{ 
+struct xl_chain_data*cd;

+struct xl_list_data *ld;
+
+cd = sc-xl_cdata;
+ld = sc-xl_ldata;
+
+while (cd-xl_rx_cnt  XL_RX_LIST_CNT) {
+if (xl_newbuf(sc, cd-xl_rx_prod) == ENOBUFS){
+/*printf(Not filling);*/
+break;
+}
+cd-xl_rx_prod = cd-xl_rx_prod-xl_next;
+cd-xl_rx_cnt++;
+/*printf(filling works %d,cd-xl_rx_cnt);*/
+}
+}
+
+
/*
 * Initialize an RX descriptor and attach an MBUF cluster.
 */
@@ -1102,7 +1125,7 @@ xl_newbuf(struct xl_softc *sc, struct xl
   struct mbuf *m_new = NULL;
   bus_dmamap_tmap;

-   MGETHDR(m_new, M_DONTWAIT, MT_DATA);
+   /*MGETHDR(m_new, M_DONTWAIT, MT_DATA);
   if (m_new == NULL)
   return (ENOBUFS);

@@ -1110,6 +1133,13 @@ xl_newbuf(struct xl_softc *sc, struct xl
   if (!(m_new-m_flags  M_EXT)) {
   m_freem(m_new);
   return (ENOBUFS);
+   }*/
+
+   m_new = MCLGETI(NULL, M_DONTWAIT, sc-sc_arpcom.ac_if, MCLBYTES);
+  
+   if (!m_new){

+   /*printf(\n no mbufs);*/
+   return (ENOBUFS);
   }

   m_new-m_len = m_new-m_pkthdr.len = MCLBYTES;
@@ -1119,17 +1149,24 @@ xl_newbuf(struct xl_softc *sc, struct xl
   return (ENOBUFS);
   }

+
+/*if (bus_dmamap_load_mbuf(sc-sc_dmat, c-map, m_new, 
BUS_DMA_NOWAIT)){

+m_free(m_new);
+return (ENOBUFS);
+}*/
+  
+

   /* sync the old map, and unload it (if necessary) */
   if (c-map-dm_nsegs != 0) {
   bus_dmamap_sync(sc-sc_dmat, c-map,
   0, c-map-dm_mapsize, BUS_DMASYNC_POSTREAD);
   bus_dmamap_unload(sc-sc_dmat, c-map);
   }
-
+  
   map = c-map;

   c-map = sc-sc_rx_sparemap;
   sc-sc_rx_sparemap = map;
-
+  
   /* Force longword alignment for packet payload. */

   m_adj(m_new, ETHER_ALIGN);

@@ -1156,8 +1193,8 @@ xl_rx_resync(struct xl_softc *sc)
   struct xl_chain_onefrag *pos;
   int i;

-   pos = sc-xl_cdata.xl_rx_head;
-
+   pos = sc-xl_cdata.xl_rx_cons;
+   printf(\n resync);  
   for (i = 0; i  XL_RX_LIST_CNT; i++) {

   bus_dmamap_sync(sc-sc_dmat, sc-sc_listmap,
   ((caddr_t)pos-xl_ptr - sc-sc_listkva),

Re: MCLGETI support for xl(4)

2010-09-13 Thread Stuart Henderson
On 2010/09/15 00:31, Loganaden Velvindron wrote:
 Here's the diff:

Diff doesn't apply; both due to whitespace issues (xclip might
help with this) and if you're using thunderbird to send then
please disable format=flowed.



Re: patch to add RequestHeader directive to httpd mod_headers.c

2010-09-13 Thread Sebastian Reitenbach
Again,

as I was pointed out the patch was borked, and actually documentation missing, 
here is a new one, including the documentation.

Sebastian 

On Monday, September 13, 2010 18:26 CEST, Sebastian Reitenbach 
sebas...@l00-bugdead-prods.de wrote: 
 
 Hi,
 
 attached a new revision of the patch. Please comment, and let me know 
 whether its OK to add or still sth. wrong.
 
 thanks,
 Sebastian
 
 Alexander Hall wrote:
   On 09/12/10 18:20, Sebastian Reitenbach wrote:
  
   -table *tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
   +table *tbl;
   +switch (hdr-inout) {
   +case hdrs_out:
   +  tbl = r-headers_out;
   +  break;
   +case hdrs_in:
   +  tbl = r-headers_in;
   +  break;
   +}
   +tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
  
   Err... Set tbl above and then set it again?
  
   Also, what's with the indentation?
  
switch (hdr-action) {
case hdr_add:
ap_table_addn(tbl, hdr-header, hdr-value);
  
  
Index: src/modules/standard/mod_headers.c
===
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_headers.c,v
retrieving revision 1.8
diff -u -r1.8 mod_headers.c
--- src/modules/standard/mod_headers.c  21 Aug 2003 13:11:36 -  1.8
+++ src/modules/standard/mod_headers.c  13 Sep 2010 17:45:35 -
@@ -59,13 +59,19 @@
 /*
  * mod_headers.c: Add/append/remove HTTP response headers
  * Written by Paul Sutton, p...@ukweb.com, 1 Oct 1996
+ * Updated with RequestHeader by Martin Algesten,
+ *   puck...@taglab.com, 13 Jul 2002.
  *
  * New directive, Header, can be used to add/replace/remove HTTP headers.
  * Valid in both per-server and per-dir configurations.
+ * In addition directive, RequestHeader, can be used exactly as Header but
+ * with the difference that the header is added to the request headers rather
+ * than the response.
  *
  * Syntax is:
  *
- *   Header action header value
+ *   Headeraction header value
+ *   RequestHeader action header value
  *
  * Where action is one of:
  * set- set this header, replacing any old value
@@ -77,7 +83,7 @@
  * Where action is unset, the third argument (value) should not be given.
  * The header name can include the colon, or not.
  *
- * The Header directive can only be used where allowed by the FileInfo 
+ * The directives can only be used where allowed by the FileInfo 
  * override.
  *
  * When the request is processed, the header directives are processed in
@@ -112,7 +118,15 @@
 hdr_unset = 'u' /* unset header */
 } hdr_actions;
 
+
+typedef enum {
+hdrs_in  = 'i', /* Add header to incoming (request) headers */
+hdrs_out = 'o'  /* Add header to outgoing (response) headers */
+} hdrs_inout;
+
+
 typedef struct {
+hdrs_inout inout;
 hdr_actions action;
 char *header;
 char *value;
@@ -154,7 +168,7 @@
 return a;
 }
 
-static const char *header_cmd(cmd_parms *cmd, headers_conf * dirconf, char 
*action, char *hdr, char *value)
+static const char *header_cmd(cmd_parms *cmd, headers_conf * dirconf, char 
*action, char *hdr, char *value, hdrs_inout inout )
 {
 header_entry *new;
 server_rec *s = cmd-server;
@@ -175,6 +189,8 @@
new-do_err = 0;
 }
 
+new-inout = inout;
+
 if (!strcasecmp(action, set))
 new-action = hdr_set;
 else if (!strcasecmp(action, add))
@@ -202,11 +218,23 @@
 return NULL;
 }
 
+static const char *outheader_cmd(cmd_parms *cmd, headers_conf * dirconf, char 
*action, char *hdr, char *value)
+{
+header_cmd( cmd, dirconf, action, hdr, value, hdrs_out );
+}
+
+static const char *inheader_cmd(cmd_parms *cmd, headers_conf * dirconf, char 
*action, char *hdr, char *value)
+{
+header_cmd( cmd, dirconf, action, hdr, value, hdrs_in );
+}
+
 static const command_rec headers_cmds[] =
 {
-{Header, header_cmd, (void *)0, OR_FILEINFO, TAKE23,
+{Header, outheader_cmd, NULL, OR_FILEINFO, TAKE23,
+ an action, header and value},
+{RequestHeader, inheader_cmd, NULL, OR_FILEINFO, TAKE23,
  an action, header and value},
-{ErrorHeader, header_cmd, (void *)1, OR_FILEINFO, TAKE23,
+{ErrorHeader, outheader_cmd, (void *)1, OR_FILEINFO, TAKE23,
  an action, header and value},
 {NULL}
 };
@@ -217,7 +245,15 @@
 
 for (i = 0; i  headers-nelts; ++i) {
 header_entry *hdr = ((header_entry *) (headers-elts))[i];
-   table *tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
+table *tbl;
+switch (hdr-inout) {
+case hdrs_out:
+tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
+break;
+case hdrs_in:
+tbl = r-headers_in;
+break;
+}
 switch (hdr-action) {
 case hdr_add:
 ap_table_addn(tbl, hdr-header, hdr-value);
Index: htdocs/manual/mod/mod_headers.html

Re: find(1) manpage patch (was: system/6462: find(1) -print wtf [non-bug])

2010-09-13 Thread Jason McIntyre
On Mon, Sep 13, 2010 at 02:49:58PM +0200, Joachim Schipper wrote:
 
 Here are two diffs to find(1).
 
 The first diff changes the last example in find(1). This diff:
 - makes it clear that it, in fact, works on all files *under* (not just
   in) the current working directory;

that seems clearer, yes.

 - adds handling of *.gif files to illustrate ordering;

but we already have an example that does this:

Print out a list of all the files which are not both newer than
``ttt'' and owned by ``wnj'':

$ find / \! \( -newer ttt -user wnj \)

i think that covers it well enough.

 - changes to -print0 | xargs -0r to illustrate proper form.


wouldn;t it be better to just use find -X? it is shorter, and the
description of -X is probably the best place to start reading for most
people.

 The second diff is relative to the first diff, and adds the following
 warning to CAVEATS:
 Using find in combination with xargs(1) requires some care:
 
 $ find . -name \e*.jpg | xargs rm
 
 would, given a file *important\n.jpg* (where *\n* is a newline),
 remove *important*. Use the -print0 or -X flags, or use -exec
 instead.
 
 This is already addressed in the man page (e.g. under the description of
 -print0 or -X), but many people (including the EXAMPLES) get it wrong;
 hopefully the above warning (and the references from the description of
 -print and the EXAMPLES section) prevents some people from making this
 mistake.
 

i don;t instinctively like this. if we document something correctly, we
shouldn;t be adding in duplicate text just in case it gets missed. there
is enough reading to do already, and what if the second text section is
also ignored/not understood by the reader?

i'd prefer to just concentrate on saying something well, once.

jmc


   Joachim
 
 Index: find.1
 ===
 RCS file: /cvs/src/usr.bin/find/find.1,v
 retrieving revision 1.78
 diff -u -p -r1.78 find.1
 --- find.115 Jul 2010 20:51:38 -  1.78
 +++ find.113 Sep 2010 12:29:56 -
 @@ -525,11 +525,11 @@ ending in a dot and single digit, but sk
  .Pp
  .Dl $ find /usr/src -path /usr/src/gnu -prune -or -name \e*.[0-9]
  .Pp
 -Find and remove all *.jpg files in the current working directory:
 +Find and remove all *.jpg or *.gif files under the current working directory:
  .Pp
 -.Dl $ find . -name \e*.jpg -exec rm {} \e;
 +.Dl $ find . \e( -name \e*.jpg -o -name \e*.gif \e) -exec rm {} \e;
  or
 -.Dl $ find . -name \e*.jpg | xargs rm
 +.Dl $ find . \e( -name \e*.jpg -o -name \e*.gif \e) -print0 | xargs -0r rm
  .Sh SEE ALSO
  .Xr chflags 1 ,
  .Xr chmod 1 ,
 
 --- find.1Mon Sep 13 14:12:53 2010
 +++ find.1.newMon Sep 13 14:32:38 2010
 @@ -382,7 +382,10 @@
  It prints the pathname of the current file to standard output, followed
  by a newline
  .Pq Ql \en
 -character.
 +character. This should not be used in conjunction with
 +.Xr xargs 1 ,
 +see
 +.Sx CAVEATS .
  .It Ic -print0
  This primary always evaluates to true.
  It prints the pathname of the current file to standard output, followed
 @@ -530,6 +533,13 @@
  .Dl $ find . \e( -name \e*.jpg -o -name \e*.gif \e) -exec rm {} \e;
  or
  .Dl $ find . \e( -name \e*.jpg -o -name \e*.gif \e) -print0 | xargs -0r rm
 +.Pp
 +Note the use of
 +.Ic -exec
 +or
 +.Ic -print0 ;
 +see
 +.Sx CAVEATS .
  .Sh SEE ALSO
  .Xr chflags 1 ,
  .Xr chmod 1 ,
 @@ -637,6 +647,26 @@
  and
  .Ql \;
  may have to be escaped from the shell.
 +.Pp
 +Using
 +.Nm
 +in combination with
 +.Xr xargs 1
 +requires some care:
 +.Pp
 +.Dl $ find . -name \e*.jpg | xargs rm
 +.Pp
 +would, given a file
 +.Pa important\en.jpg
 +(where \en is a newline), remove
 +.Pa important .
 +Use the
 +.Ic -print0
 +or
 +.Ic -X
 +flags, or use
 +.Ic -exec
 +instead.
  .Pp
  As there is no delimiter separating options and file names or file
  names and the



Re: revised kernel perf control

2010-09-13 Thread Ted Unangst
On Fri, Sep 10, 2010 at 4:34 PM, Alexander Hall ha...@openbsd.org wrote:
 I wasn't aware of any problems with suspend.  My laptop doesn't resume
 reliably anyway, so it's not something I tested for.  But it's just
 running some code in a timeout.  If timeouts are still running during
 suspend, I'd say that's somebody else's bug.

 ISTR that the problem was that during the later part of a suspend, only
 one cpu is active, while the throttling affects all of them. I don't
 know enough about that to tell anything though.

 Well, anyhow, with this diff, and one cpu pegged, my thinkpad did not
 survive a resume. While idle, though, all seems fine.

OK, I'm willing to believe there is a problem, but I still think that
at the point where running setperf would be harmful, timeouts should
be disabled.

Barring that, how am I supposed to check if there is an imminent suspend?



Re: revised kernel perf control

2010-09-13 Thread Bret S. Lambert
On Mon, Sep 13, 2010 at 04:15:29PM -0400, Ted Unangst wrote:
 On Fri, Sep 10, 2010 at 4:34 PM, Alexander Hall ha...@openbsd.org wrote:
  I wasn't aware of any problems with suspend.  My laptop doesn't resume
  reliably anyway, so it's not something I tested for.  But it's just
  running some code in a timeout.  If timeouts are still running during
  suspend, I'd say that's somebody else's bug.
 
  ISTR that the problem was that during the later part of a suspend, only
  one cpu is active, while the throttling affects all of them. I don't
  know enough about that to tell anything though.
 
  Well, anyhow, with this diff, and one cpu pegged, my thinkpad did not
  survive a resume. While idle, though, all seems fine.
 
 OK, I'm willing to believe there is a problem, but I still think that
 at the point where running setperf would be harmful, timeouts should
 be disabled.
 
 Barring that, how am I supposed to check if there is an imminent suspend?
 

Register a device with suspend resume hooks which disables/enables throttling?



Re: patch to add RequestHeader directive to httpd mod_headers.c

2010-09-13 Thread Alexander Hall
I don't have any actual interest in the change myself, nor the time to
test it, but now at least the diff has the fixes I expected to see
regarding my prior concerns.

/Alexander

On 09/13/10 19:50, Sebastian Reitenbach wrote:
 Again,
 
 as I was pointed out the patch was borked, and actually documentation 
 missing, here is a new one, including the documentation.
 
 Sebastian 
 
 On Monday, September 13, 2010 18:26 CEST, Sebastian Reitenbach 
 sebas...@l00-bugdead-prods.de wrote: 
  
 Hi,

 attached a new revision of the patch. Please comment, and let me know 
 whether its OK to add or still sth. wrong.

 thanks,
 Sebastian

 Alexander Hall wrote:
   On 09/12/10 18:20, Sebastian Reitenbach wrote:
  
   -table *tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
   +table *tbl;
   +switch (hdr-inout) {
   +case hdrs_out:
   +  tbl = r-headers_out;
   +  break;
   +case hdrs_in:
   +  tbl = r-headers_in;
   +  break;
   +}
   +tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
  
   Err... Set tbl above and then set it again?
  
   Also, what's with the indentation?
  
switch (hdr-action) {
case hdr_add:
ap_table_addn(tbl, hdr-header, hdr-value);
  
  
 Index: src/modules/standard/mod_headers.c
 ===
 RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_headers.c,v
 retrieving revision 1.8
 diff -u -r1.8 mod_headers.c
 --- src/modules/standard/mod_headers.c21 Aug 2003 13:11:36 -  
 1.8
 +++ src/modules/standard/mod_headers.c13 Sep 2010 17:45:35 -
 @@ -59,13 +59,19 @@
  /*
   * mod_headers.c: Add/append/remove HTTP response headers
   * Written by Paul Sutton, p...@ukweb.com, 1 Oct 1996
 + * Updated with RequestHeader by Martin Algesten,
 + *   puck...@taglab.com, 13 Jul 2002.
   *
   * New directive, Header, can be used to add/replace/remove HTTP headers.
   * Valid in both per-server and per-dir configurations.
 + * In addition directive, RequestHeader, can be used exactly as Header but
 + * with the difference that the header is added to the request headers rather
 + * than the response.
   *
   * Syntax is:
   *
 - *   Header action header value
 + *   Headeraction header value
 + *   RequestHeader action header value
   *
   * Where action is one of:
   * set- set this header, replacing any old value
 @@ -77,7 +83,7 @@
   * Where action is unset, the third argument (value) should not be given.
   * The header name can include the colon, or not.
   *
 - * The Header directive can only be used where allowed by the FileInfo 
 + * The directives can only be used where allowed by the FileInfo 
   * override.
   *
   * When the request is processed, the header directives are processed in
 @@ -112,7 +118,15 @@
  hdr_unset = 'u' /* unset header */
  } hdr_actions;
  
 +
 +typedef enum {
 +hdrs_in  = 'i', /* Add header to incoming (request) headers 
 */
 +hdrs_out = 'o'  /* Add header to outgoing (response) headers 
 */
 +} hdrs_inout;
 +
 +
  typedef struct {
 +hdrs_inout inout;
  hdr_actions action;
  char *header;
  char *value;
 @@ -154,7 +168,7 @@
  return a;
  }
  
 -static const char *header_cmd(cmd_parms *cmd, headers_conf * dirconf, char 
 *action, char *hdr, char *value)
 +static const char *header_cmd(cmd_parms *cmd, headers_conf * dirconf, char 
 *action, char *hdr, char *value, hdrs_inout inout )
  {
  header_entry *new;
  server_rec *s = cmd-server;
 @@ -175,6 +189,8 @@
   new-do_err = 0;
  }
  
 +new-inout = inout;
 +
  if (!strcasecmp(action, set))
  new-action = hdr_set;
  else if (!strcasecmp(action, add))
 @@ -202,11 +218,23 @@
  return NULL;
  }
  
 +static const char *outheader_cmd(cmd_parms *cmd, headers_conf * dirconf, 
 char *action, char *hdr, char *value)
 +{
 +header_cmd( cmd, dirconf, action, hdr, value, hdrs_out );
 +}
 +
 +static const char *inheader_cmd(cmd_parms *cmd, headers_conf * dirconf, char 
 *action, char *hdr, char *value)
 +{
 +header_cmd( cmd, dirconf, action, hdr, value, hdrs_in );
 +}
 +
  static const command_rec headers_cmds[] =
  {
 -{Header, header_cmd, (void *)0, OR_FILEINFO, TAKE23,
 +{Header, outheader_cmd, NULL, OR_FILEINFO, TAKE23,
 + an action, header and value},
 +{RequestHeader, inheader_cmd, NULL, OR_FILEINFO, TAKE23,
   an action, header and value},
 -{ErrorHeader, header_cmd, (void *)1, OR_FILEINFO, TAKE23,
 +{ErrorHeader, outheader_cmd, (void *)1, OR_FILEINFO, TAKE23,
   an action, header and value},
  {NULL}
  };
 @@ -217,7 +245,15 @@
  
  for (i = 0; i  headers-nelts; ++i) {
  header_entry *hdr = ((header_entry *) (headers-elts))[i];
 - table *tbl = (hdr-do_err ? r-err_headers_out : r-headers_out);
 +table *tbl;
 +switch (hdr-inout) {
 +case 

Re: find(1) manpage patch

2010-09-13 Thread Ingo Schwarze
Hi,

I like these two and have tweaked them a bit.

Joachim Schipper wrote on Mon, Sep 13, 2010 at 02:49:58PM +0200:

 The first diff changes the last example in find(1). This diff:
 - makes it clear that it, in fact, works on all files *under* (not just
   in) the current working directory;
 - adds handling of *.gif files to illustrate ordering;
 - changes to -print0 | xargs -0r to illustrate proper form.
 
 The second diff is relative to the first diff, and adds the following
 warning to CAVEATS:
[...]

My tweaks:
 * regarding -print:
   should not is not nice in manuals, let's say is dangerous.
 * regarding -print0:
   Point to xargs(1) -0, it nicely fits on the same line.
 * EXAMPLES:
   remove all *.jpg and *.gif files (not or)
   Also, give the pointer to CAVEATS in a more concise form.
 * CAVEATS:
   Using the newline might mislead people to underestimate the danger:
   Who ever uses newlines in filenames?
   Better use the space character for demonstration purposes.
   And don't recommend -X, it is rarely doing the job, if at all.

 This is already addressed in the man page (e.g. under the description of
 -print0 or -X), but many people (including the EXAMPLES) get it wrong;
 hopefully the above warning (and the references from the description of
 -print and the EXAMPLES section) prevents some people from making this
 mistake.

Even if this introduces some more redundancy, self-contained descriptions
for all options (-X, -print, and -print0) are good, and EXAMPLES and
CAVEATS are good places to help inexperienced users, even using some
verbosity if need be, so i don't think this is overdone.

OK to commit?


Index: find.1
===
RCS file: /cvs/src/usr.bin/find/find.1,v
retrieving revision 1.78
diff -u -r1.78 find.1
--- find.1  15 Jul 2010 20:51:38 -  1.78
+++ find.1  13 Sep 2010 23:35:00 -
@@ -383,10 +383,17 @@
 by a newline
 .Pq Ql \en
 character.
+This is dangerous in conjunction with
+.Xr xargs 1 ,
+see
+.Sx CAVEATS .
 .It Ic -print0
 This primary always evaluates to true.
 It prints the pathname of the current file to standard output, followed
-by a null character.
+by a null character, suitable for use with the
+.Fl 0
+option to
+.Xr xargs 1 .
 .It Ic -prune
 This primary always evaluates to true.
 It causes
@@ -525,11 +532,13 @@
 .Pp
 .Dl $ find /usr/src -path /usr/src/gnu -prune -or -name \e*.[0-9]
 .Pp
-Find and remove all *.jpg files in the current working directory:
+Find and remove all *.jpg and *.gif files under the current working
+directory
+.Pq see also Sx CAVEATS :
 .Pp
-.Dl $ find . -name \e*.jpg -exec rm {} \e;
+.Dl $ find . \e( -name \e*.jpg -o -name \e*.gif \e) -exec rm {} \e;
 or
-.Dl $ find . -name \e*.jpg | xargs rm
+.Dl $ find . \e( -name \e*.jpg -o -name \e*.gif \e) -print0 | xargs -0r rm
 .Sh SEE ALSO
 .Xr chflags 1 ,
 .Xr chmod 1 ,
@@ -637,6 +646,24 @@
 and
 .Ql \;
 may have to be escaped from the shell.
+.Pp
+Using
+.Nm
+in combination with
+.Xr xargs 1
+requires some care:
+.Pp
+.Dl $ find . -name \e*.jpg | xargs rm
+.Pp
+would, given a file named
+.Pa important .jpg
+(with a space character in the middle), remove
+.Pa important .
+Use the
+.Ic -print0
+or
+.Ic -exec
+primaries instead.
 .Pp
 As there is no delimiter separating options and file names or file
 names and the



ifconfig wpapass

2010-09-13 Thread Alexander Hall
Not to mess with ifconfig's wpapsk, this diff does instead introduces
wpapass and -wpapass.

Same nwid relation as before:
- A nwid is required prior to supplying a passphrase to wpapass.
- If the nwid is changed afterwards, the passkey is not adjusted.

There has been discussion whether we should clear the wpa key on nwid
change, but I see that as a separate issue.

Again, bsd.rd size impact not checked.

I'd appreciate if someone would comment on the Makefile changes too.

/Alexander

Index: distrib/special/ifconfig/Makefile
===
RCS file: /cvs/src/distrib/special/ifconfig/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- distrib/special/ifconfig/Makefile   28 Oct 2009 07:36:49 -  1.2
+++ distrib/special/ifconfig/Makefile   13 Sep 2010 23:56:14 -
@@ -1,8 +1,10 @@
 #  $OpenBSD: Makefile,v 1.2 2009/10/28 07:36:49 deraadt Exp $
 
 PROG=  ifconfig
+SRCS=  ifconfig.c pbkdf2.c
 COPTS+=-DSMALL
-.PATH:  ${.CURDIR}/../../../sbin/ifconfig
+.PATH:  ${.CURDIR}/../../../sbin/ifconfig ${.CURDIR}/../../../sbin/bioctl
+CFLAGS+=-I${.CURDIR}/../../../sbin/bioctl
 
 CPPFLAGS+=-DINET6
 
Index: sbin/ifconfig/Makefile
===
RCS file: /cvs/src/sbin/ifconfig/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- sbin/ifconfig/Makefile  22 Nov 2009 22:00:24 -  1.10
+++ sbin/ifconfig/Makefile  13 Sep 2010 23:56:14 -
@@ -1,7 +1,10 @@
 #  $OpenBSD: Makefile,v 1.10 2009/11/22 22:00:24 claudio Exp $
 
+.PATH: ${.CURDIR}/../bioctl
+CFLAGS+=-I${.CURDIR}/../bioctl
+
 PROG=  ifconfig
-SRCS=  ifconfig.c brconfig.c
+SRCS=  ifconfig.c brconfig.c pbkdf2.c
 MAN=   ifconfig.8
 
 CPPFLAGS+=-DINET6
Index: sbin/ifconfig/ifconfig.c
===
RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v
retrieving revision 1.239
diff -u -p -r1.239 ifconfig.c
--- sbin/ifconfig/ifconfig.c3 Jul 2010 04:44:51 -   1.239
+++ sbin/ifconfig/ifconfig.c13 Sep 2010 23:56:15 -
@@ -161,6 +161,7 @@ voidsetifwpaakms(const char *, int);
 void   setifwpaciphers(const char *, int);
 void   setifwpagroupcipher(const char *, int);
 void   setifwpapsk(const char *, int);
+void   setifwpapass(const char *, int);
 void   setifchan(const char *, int);
 void   setifscan(const char *, int);
 void   setiftxpower(const char *, int);
@@ -319,6 +320,8 @@ const structcmd {
{ wpaprotos,  NEXTARG,0,  setifwpaprotos },
{ wpapsk, NEXTARG,0,  setifwpapsk },
{ -wpapsk,-1, 0,  setifwpapsk },
+   { wpapass,NEXTARG,0,  setifwpapass },
+   { -wpapass,   -1, 0,  setifwpapass },
{ chan,   NEXTARG0,   0,  setifchan },
{ -chan,  -1, 0,  setifchan },
{ scan,   NEXTARG0,   0,  setifscan },
@@ -1715,6 +1718,45 @@ setifwpapsk(const char *val, int d)
errx(1, wpapsk: invalid pre-shared key);
if (len != sizeof(psk.i_psk))
errx(1, wpapsk: bad pre-shared key length);
+   psk.i_enabled = 1;
+   } else
+   psk.i_enabled = 0;
+
+   (void)strlcpy(psk.i_name, name, sizeof(psk.i_name));
+   if (ioctl(s, SIOCS80211WPAPSK, (caddr_t)psk)  0)
+   err(1, SIOCS80211WPAPSK);
+}
+
+void
+setifwpapass(const char *val, int d)
+{
+   struct ieee80211_wpapsk psk;
+   struct ieee80211_nwid nwid;
+   int passlen, nwid_len;
+
+   if (d != -1) {
+   memset(ifr, 0, sizeof(ifr));
+   ifr.ifr_data = (caddr_t)nwid;
+   strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+   if (ioctl(s, SIOCG80211NWID, (caddr_t)ifr))
+   err(1, SIOCG80211NWID);
+
+   passlen = strlen(val);
+   if (passlen  8 || passlen  63)
+   errx(1, wpapass: passphrase must be between 8 and 63 
+   characters);
+u
+   nwid_len = nwid.i_len;
+   if (nwid_len == 0)
+   errx(1, wpapass: nwid not set);
+   else if (nwid_len  IEEE80211_NWID_LEN) {
+   nwid_len = IEEE80211_NWID_LEN;
+   warnx(truncating nwid to its first %d characters,
+   nwid_len);
+   }
+
+   pkcs5_pbkdf2(val, passlen, nwid.i_nwid, nwid_len, psk.i_psk,
+   sizeof(psk.i_psk), 4096);
psk.i_enabled = 1;
} else
psk.i_enabled = 0;



Dünyanın en gelişmiş araç takip sis.Hem de Aidatsız....

2010-09-13 Thread Aidatsız Araç Takip
OLACAKSA EN ]Y]S] OLACAK,

  OLACAKSA  ''C]P]ES'' OLACAK..

 225 $ + MONTAJ

7   En son teknoloji ile geli~tirilmi~, 10 y}l sonras}  d|~|n|lerek
haz}rlanm}~ olacak..

7   Real time (gergek zamanl}) takip yapabilecek..

 3 saniyede bir gergek zamanl} takip.

7   Kriptolu (~ifreli) ileti~im  olacak.

7   Yedek batarya ve ~arj devresi sistem dahilinde olacak...

7   Ayn} anda t|m araglar tek bir ekranda olacak..

7   ]stenilen araglar ayr} ayr}  bvl|nm|~ ekranlarda da takip
edilebilecek.

7   Segenekli blokaj,  sistem dahilinde olacak..

7   18 ge~it ihlal raporu verebilecek..Raporlar} 4 ayr} ge~it grafikte
gvrebilecek.

7   En uygun maliyet olacak...

7   100 |n |zerinde vzellik olacak..

7   Rakipleri ile mukayese kabul etmeyecek.

7   Tamamen yerli yaz}l}m ve |retim olacak.

7   Soracap}n}z t|m sorulara cevap verebilecek donan}m} olacak.

7   Kolay kullan}m ve ~}k  ekran tasar}m} olacak..

7   225 $ + KDV + Montaj  fiyat} olacak..



D\NYA' NIN HER YER]NDEN D\NYA' NIN HER YER]NDEK] ARAGLARINIZI TAK]P
EDEB]LECEKS]N]Z..

 AYRICA SINIRLI SAYIDA VE  SINIRLI B]R ADET ]G]N,

   ''VM\R BOYU A]DATSIZ KULLANIM ''

^]MD] ALIN S\RES]Z VM\R BOYU A]DAT VDEMEDEN KULLANIN.

UNUTMAYIN SINIRLI SAYIDA C]HAZ VE SINIRLI B]R S\RE ]G]N.



Aray}n,C]P]ES igin bilgi verelim..Demo ~ifre ve parolan}z} verelim..

  NOKKON
 Noktasal Konumlama Teknolojileri

Tel: 0 216 465 0 222

   0 216 465 0 322



fix some warnings on sgi

2010-09-13 Thread Marco Peereboom
This quiets the compiler quite a bit.

ok?

Index: Makefile.inc
===
RCS file: /cvs/src/sys/arch/sgi/stand/Makefile.inc,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile.inc
--- Makefile.inc14 May 2009 18:57:41 -  1.5
+++ Makefile.inc14 Sep 2010 01:43:53 -
@@ -14,6 +14,7 @@ CPPFLAGS+=-I.
 
 CFLAGS+=   -fno-stack-protector -Wall
 CFLAGS+=   -fno-builtin-vprintf -fno-builtin-printf -fno-builtin-putchar
+CFLAGS+=   -fno-builtin-exit
 SAABI?=-mips3 -mno-abicalls -G 0 -fno-pic -fno-common
 AS?=   as
 LD?=   ld



fix gcc4 compiler error on sgi

2010-09-13 Thread Marco Peereboom
This is just like the mips64 code.

Index: arcbios.c
===
RCS file: /cvs/src/sys/arch/sgi/stand/boot/arcbios.c,v
retrieving revision 1.12
diff -u -p -r1.12 arcbios.c
--- arcbios.c   22 Jul 2009 20:23:44 -  1.12
+++ arcbios.c   14 Sep 2010 02:23:45 -
@@ -36,7 +36,7 @@
 
 #include stand.h
 
-static int bios_is_32bit;
+intbios_is_32bit;
 
 u_int  kl_n_shift = 32;
 intarcbios_init(void);



Re: find(1) manpage patch

2010-09-13 Thread Stuart Henderson
On 2010/09/14 01:48, Ingo Schwarze wrote:

I like most of this, one thing though,

 +This is dangerous in conjunction with
 +.Xr xargs 1 ,
 +see
 +.Sx CAVEATS .

This is also dangerous when using the output in some other
ways, e.g.:  rm `find . -name *.jpg`

 @@ -637,6 +646,24 @@
  and
  .Ql \;
  may have to be escaped from the shell.
 +.Pp
 +Using
 +.Nm
 +in combination with
 +.Xr xargs 1
 +requires some care:

Using filenames output by .Nm requires some care: ?

(I did think of Using the -print flag requires some care:
but readers may then miss the fact that it is implicit).