Virus "Email.Phishing.Bank-108" gefunden

2011-03-16 Thread Inode Mailscan
Sehr geehrte Damen und Herren,

in dem E-Mail mit dem Betreff 'Access Availability'
(gesendet am Wed, 16 Mar 2011 02:11:38 -0600 (MDT)) mit der angegebenen
Absenderadresse 'BankMuscat ' wurde der
Virus 'Email.Phishing.Bank-108' gefunden.
Aus diesem Grund wurde die E-Mail nicht zugestellt!

Ihr Inode-Team
--

Dear Ladies and Gentlemen,

the mail with the Subject 'Access Availability'
(sent on Wed, 16 Mar 2011 02:11:38 -0600 (MDT)) with the sender address
specified as 'BankMuscat ' contained a virus
known as 'Email.Phishing.Bank-108'.
Due to this reason the Mail has not been delivered!

Your Inode-Team
---


Headers of original mail follow:

>From owner-tech+m23...@openbsd.org Wed Mar 16 09:15:37 2011
X-Envelope-From: 
Received: from lists.openbsd.org ([192.43.244.163]:5492 helo=shear.ucar.edu)
by smartmx-08.inode.at with esmtp (Exim 4.69)
(envelope-from )
id 1PzltJ-0007X9-JQ
for te...@lynix.net; Wed, 16 Mar 2011 09:15:37 +0100
Received: from openbsd.org (localhost.ucar.edu [127.0.0.1])
by shear.ucar.edu (8.14.3/8.14.3) with ESMTP id p2G8CxGM029877;
Wed, 16 Mar 2011 02:12:59 -0600 (MDT)
Received: from c40.servage.net (c40.servage.net [77.232.85.17])
by shear.ucar.edu (8.14.3/8.14.3) with ESMTP id p2G8BcJ0024079
for ; Wed, 16 Mar 2011 02:11:39 -0600 (MDT)
Date: Wed, 16 Mar 2011 02:11:38 -0600 (MDT)
Message-Id: <201103160811.p2g8bcj0024...@shear.ucar.edu>
Received: from cluster.servage-coustomer.net (node2.c40 [10.3.40.2])
by c40.servage.net (Postfix) with SMTP id 21B4A24905
for ; Wed, 16 Mar 2011 06:16:36 + (UTC)
From: BankMuscat 
X-ServageMailTag: TUM0NDIxNlRWNjMxNjYzU2ExLjA2U1RQSFAK
To: tech@openbsd.org
Subject: Access Availability
Reply-To: 
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Converted-To-Plain-Text: from text/html by demime 1.01d
List-Help: 
List-Owner: 
List-Post: 
List-Subscribe: 
List-Unsubscribe: 
X-Loop: tech@openbsd.org
Precedence: list
Sender: owner-t...@openbsd.org



{Spam?} {Disarmed} Etno cash plus

2011-03-16 Thread National Bank Of Greece
National Bank of Greece

Αγαπητοί πελάτες,

Τα αρχεία μας δείχνουν ότι η σύνδεση του 
λογαριασμού σας έχει παγώσει
λόγω της
ακόλουθους λόγους.

Είσοδος σε δίκη με ανακριβείς πληροφορίες.

Ελλιπής ή ελλείποντα στοιχεία που 
χρησιμοποιούν ;ται για την Εθνική
Τράπεζα ηλεκτρονικό λογαριασμό.

Σας προτρέπουμε να αποκαταστήσει την 
Εθνική Τράπεζα σε απευθείας σύνδεση
λογαριασμού αμέσως να αποτρέψει το 
κλείσιμο του λογαριασμού σας.

Κάντε κλικ στον παρακάτω σύνδεσμο για να 
αποκατασταθεί η Εθνική Τράπεζα
ηλεκτρονικό λογαριασμό:

MailScanner soupgonne le lien suivant d'jtre une tentative de fraude de
la part de "shippertools.com"
https://www.nbg.gr/wps/portal/LoginPageMap?loginPage=true



) 2011 ΕΘΝΙΚΗ ΤΡΑΠΕ&Zelon ta;Α



Re: hack(6) fails to display help files

2011-03-16 Thread Simon Nicolussi
No one wanting to commit this? It is a bug fix, after all.

-- 
Simon Nicolussi, 
http://homepage.uibk.ac.at/~csag9583/



snmpd(8) linkUp/linkDown trap

2011-03-16 Thread Reyk Floeter
hi,

the following diff adds the linkUp/Down traps to snmpd.  this will
help to track interface link state changes via snmp and also virtual
link states like carp(4) BACKUP <-> MASTER transitions.  snmpd(8)
monitors the link state changes and send traps to the configured
receivers accordingly.

limitations:
- the traps are SNMPv2-only.  some NMS seem to stick on v1 linkUp/Down.
- the ifLinkUpDownTrapEnable is always enabled for every interface and
is not considering stacking (eg. a trap will be send for every vlan if
parent goes down).

comments?

reyk

Index: kroute.c
===
RCS file: /cvs/src/usr.sbin/snmpd/kroute.c,v
retrieving revision 1.15
diff -u -p -r1.15 kroute.c
--- kroute.c15 Oct 2010 09:27:03 -  1.15
+++ kroute.c16 Mar 2011 16:05:05 -
@@ -623,9 +623,16 @@ kif_update(u_short if_index, int flags, 
struct ether_addr   *ea;
struct ifreq ifr;
 
-   if ((kif = kif_find(if_index)) == NULL)
+   if ((kif = kif_find(if_index)) == NULL) {
if ((kif = kif_insert(if_index)) == NULL)
return (NULL);
+   } else {
+   if (((flags & (IFF_UP)) &&
+   LINK_STATE_IS_UP(ifd->ifi_link_state)) !=
+   ((kif->k.if_flags & (IFF_UP)) &&
+   LINK_STATE_IS_UP(kif->k.if_link_state)))
+   trap_link(if_index, flags, ifd->ifi_link_state);
+   }
 
kif->k.if_flags = flags;
bcopy(ifd, &kif->k.if_data, sizeof(struct if_data));
Index: mib.c
===
RCS file: /cvs/src/usr.sbin/snmpd/mib.c,v
retrieving revision 1.43
diff -u -p -r1.43 mib.c
--- mib.c   15 Oct 2010 11:56:13 -  1.43
+++ mib.c   16 Mar 2011 16:05:06 -
@@ -953,19 +953,12 @@ mib_iftable(struct oid *oid, struct ber_
break;
case 7:
/* ifAdminStatus up(1), down(2), testing(3) */
-   i = (kif->if_flags & IFF_UP) ? 1 : 2;
+   i = smi_ifadminstatus(kif->if_flags);
ber = ber_add_integer(ber, i);
break;
case 8:
/* ifOperStatus */
-   if ((kif->if_flags & IFF_UP) == 0) {
-   i = 2;  /* down(2) */
-   } else if (LINK_STATE_IS_UP(kif->if_link_state)) {
-   i = 1;  /* up(1) */
-   } else if (kif->if_link_state == LINK_STATE_DOWN) {
-   i = 7;  /* lowerLayerDown(7) or dormant(5)? */
-   } else
-   i = 4;  /* unknown(4) */
+   i = smi_ifoperstatus(kif->if_flags, kif->if_link_state);
ber = ber_add_integer(ber, i);
break;
case 9:
@@ -1116,7 +1109,7 @@ mib_ifxtable(struct oid *oid, struct ber
ber_set_header(ber, BER_CLASS_APPLICATION, SNMP_T_COUNTER64);
break;
case 14:
-   ber = ber_add_integer(ber, 0);  /* enabled(1), disabled(2) */
+   ber = ber_add_integer(ber, 1);  /* enabled(1), disabled(2) */
break;
case 15:
i = kif->if_baudrate >= 100 ?
Index: smi.c
===
RCS file: /cvs/src/usr.sbin/snmpd/smi.c,v
retrieving revision 1.6
diff -u -p -r1.6 smi.c
--- smi.c   16 Dec 2009 22:17:53 -  1.6
+++ smi.c   16 Mar 2011 16:05:06 -
@@ -69,6 +69,27 @@ smi_getticks(void)
return (ticks);
 }
 
+int
+smi_ifadminstatus(int flags)
+{
+   /* ifAdminStatus up(1), down(2), testing(3) */
+   return ((flags & IFF_UP) ? 1 : 2);
+}
+
+int
+smi_ifoperstatus(int flags, u_int8_t link_state)
+{
+   if ((flags & IFF_UP) == 0)
+   return (2); /* down(2) */
+   else if (LINK_STATE_IS_UP(link_state))
+   return (1); /* up(1) */
+   else if (link_state == LINK_STATE_DOWN)
+   return (7); /* lowerLayerDown(7) or dormant(5)? */
+   else
+   return (4); /* unknown(4) */
+   /* NOTREACHED */
+}
+
 void
 smi_oidlen(struct ber_oid *o)
 {
Index: snmpd.h
===
RCS file: /cvs/src/usr.sbin/snmpd/snmpd.h,v
retrieving revision 1.30
diff -u -p -r1.30 snmpd.h
--- snmpd.h 20 Sep 2010 08:56:16 -  1.30
+++ snmpd.h 16 Mar 2011 16:05:06 -
@@ -359,6 +359,7 @@ void snmpe_debug_elements(struct ber_e
 voidtrap_init(void);
 int trap_imsg(struct imsgev *, pid_t);
 int trap_send(struct ber_oid *, struct ber_element *);
+voidtrap_link(u_short, int, u_int8_t);
 
 /* mps.c */
 struct ber_element *
@@ -393,6 +394,8 @@ char*smi_oidstring(struct ber_oid *, c
 voidsmi_delete(struct oid *);
 voidsmi_insert(struct oid *);
 int smi_oid_cmp(struct o

Cartuchos Laser Originales

2011-03-16 Thread i...@ercas.com.ar
header bg

Ercas: Especialistas en cartuchos
=

Cartuchos & impresoras

Cartuchos originales HP
---

Somos distribuidores de cartuchos originales HP. Consulte por precios!

Nos dedicamos a la venta de cartuchos originales:

Hewlett Packard

Epson

Lexmark

Canon

Xerox

samsung

ofreciendo precios mayoristas a pequeqas y medianas empresas.

Venta de cartuchos Originales y Remanufacturados

space

Reduzca hasta un 70% sus costos de impresisn


Reduzca sus costos de impresisn sin dejar de lado la calidad y el
rendimiento. Nuestros productos no contienen materiales chinos si no que
todas sus piezas son originales y ademas de esto son testeados por
nuestros profesionales antes de salir de nuestra fabrica.

Compramos carcazas vacias $40. Consulte
---

header bg

Si usted desea desuscribirse de nuestra lista haga click Aqui.

---



Re: bin/ksh: fix possible use of uninitialized variable

2011-03-16 Thread Theo de Raadt
I don't see any warnings.  Please show them.

If gcc is being fooled by loops, then this is because gcc is stupid.
it you show the warnings we can judge it.

In particular, the slen one looks totally bogus.

> This diff fixes uninitialized variable warnings emitted by gcc 4.2.1
> on i386/amd64.
> 
> Index: eval.c
> ===
> RCS file: /cvs/src/bin/ksh/eval.c,v
> retrieving revision 1.35
> diff -u -p -r1.35 eval.c
> --- eval.c24 Mar 2010 08:27:26 -  1.35
> +++ eval.c14 Mar 2011 03:05:10 -
> @@ -159,6 +159,8 @@ expand(char *cp,  /* input word */
>   int make_magic;
>   size_t len;
>  
> + x.split = 0;
> + x.str = NULL;
>   if (cp == NULL)
>   internal_errorf(1, "expand(NULL)");
>   /* for alias, readonly, set, typeset commands */
> @@ -267,6 +269,7 @@ expand(char *cp,  /* input word */
>   int stype;
>   int slen;
>  
> + slen = -1;
>   sp = strchr(sp, '\0') + 1; /* skip variable */
>   type = varsub(&x, varname, sp, &stype, &slen);
>   if (type < 0) {



Re: bin/ksh: fix possible use of uninitialized variable

2011-03-16 Thread Okan Demirmen
On Wed 2011.03.16 at 12:30 -0600, Theo de Raadt wrote:
> I don't see any warnings.  Please show them.

ksh builds with -Wall by default, so these were emitted:

/home/okan/hack/open/ksh/ksh-current/eval.c: In function 'expand':
/home/okan/hack/open/ksh/ksh-current/eval.c:155: warning: 'x.split' may
be used uninitialized in this function
/home/okan/hack/open/ksh/ksh-current/eval.c:155: warning: 'x.str' may be
used uninitialized in this function
/home/okan/hack/open/ksh/ksh-current/eval.c:268: warning: 'slen' may be
used uninitialized in this function

> If gcc is being fooled by loops, then this is because gcc is stupid.
> it you show the warnings we can judge it.
> 
> In particular, the slen one looks totally bogus.
>
> > This diff fixes uninitialized variable warnings emitted by gcc 4.2.1
> > on i386/amd64.
> > 
> > Index: eval.c
> > ===
> > RCS file: /cvs/src/bin/ksh/eval.c,v
> > retrieving revision 1.35
> > diff -u -p -r1.35 eval.c
> > --- eval.c  24 Mar 2010 08:27:26 -  1.35
> > +++ eval.c  14 Mar 2011 03:05:10 -
> > @@ -159,6 +159,8 @@ expand(char *cp,/* input word */
> > int make_magic;
> > size_t len;
> >  
> > +   x.split = 0;
> > +   x.str = NULL;
> > if (cp == NULL)
> > internal_errorf(1, "expand(NULL)");
> > /* for alias, readonly, set, typeset commands */
> > @@ -267,6 +269,7 @@ expand(char *cp,/* input word */
> > int stype;
> > int slen;
> >  
> > +   slen = -1;
> > sp = strchr(sp, '\0') + 1; /* skip variable */
> > type = varsub(&x, varname, sp, &stype, &slen);
> > if (type < 0) {



the SMCWUSB-N2 is an otus(4)

2011-03-16 Thread Anthony J. Bentley
Sent from a SMCWUSB-N2:
otus0 at uhub0 port 3 "ATHER USB2.0 WLAN" rev 2.00/1.06 addr 2
otus0: MAC/BBP AR9170, RF AR9102, MIMO 2T2R, address 00:22:2d:c0:30:b3

Index: otus.4
===
RCS file: /cvs/src/share/man/man4/otus.4,v
retrieving revision 1.17
diff -u otus.4
--- otus.4  6 Jan 2011 19:47:46 -   1.17
+++ otus.4  16 Mar 2011 19:11:38 -
@@ -100,6 +100,7 @@
 .It Netgear WNDA3100
 .It Netgear WN111 v2
 .It Planex GW-US300
+.It SMC Networks SMCWUSB-N2
 .It TP-Link TL-WN821N
 .It Ubiquiti SR71 USB
 .It Unex DNUA-81



ISO-8859-1 character in manpage

2011-03-16 Thread Anthony J. Bentley
$ mandoc -Tlint /usr/src/share/man/man4/udl.4  
/usr/src/share/man/man4/udl.4:42:6: ERROR: skipping bad character: ignoring byte

The o with diaeresis should be replaced with the \(:o escape.
(See mandoc_char(7).)

Would send a patch, but I've never had luck sending high-bit files
to the list.

--
Anthony J. Bentley



[PATCH] frame length validation for USB ethernet adapters

2011-03-16 Thread Loganaden Velvindron
After my experience with udav(4), I took a look at other USB  
adapters. The diff makes all of them more consistent by checking
the frame length returned and validating it. 

Since I don't own any of those adapters, I must rely on you people to 
test them. The diff is wrong unless successful reports are heard from users.

Of course, if the adapters are broken after applying the diff, I'll  
do my best to track down the problem. 

Yes, even 2-line diffs for each adapter needs to be checked, since device
drivers are a real minefield, so please test !


Index: if_axe.c
===
RCS file: /cvs/src/sys/dev/usb/if_axe.c,v
retrieving revision 1.105
diff -u -p -r1.105 if_axe.c
--- if_axe.c25 Jan 2011 20:03:35 -  1.105
+++ if_axe.c16 Mar 2011 20:34:42 -
@@ -1018,7 +1018,8 @@ axe_rxeof(usbd_xfer_handle xfer, usbd_pr
 
do {
if (sc->axe_flags & AX178 || sc->axe_flags & AX772) {
-   if (total_len < sizeof(hdr)) {
+   if (total_len < ETHERMIN ||
+   total_len > ifp->if_hardmtu) {
ifp->if_ierrors++;
goto done;
}
Index: if_aue.c
===
RCS file: /cvs/src/sys/dev/usb/if_aue.c,v
retrieving revision 1.84
diff -u -p -r1.84 if_aue.c
--- if_aue.c25 Jan 2011 20:03:35 -  1.84
+++ if_aue.c16 Mar 2011 20:34:43 -
@@ -1078,12 +1078,12 @@ aue_rxeof(usbd_xfer_handle xfer, usbd_pr
 
usbd_get_xfer_status(xfer, NULL, NULL, &total_len, NULL);
 
-   memcpy(mtod(c->aue_mbuf, char *), c->aue_buf, total_len);
-
-   if (total_len <= 4 + ETHER_CRC_LEN) {
+   if (total_len < ETHERMIN || total_len > ifp->if_hardmtu) {
ifp->if_ierrors++;
goto done;
}
+
+   memcpy(mtod(c->aue_mbuf, char *), c->aue_buf, total_len);
 
memcpy(&r, c->aue_buf + total_len - 4, sizeof(r));
 
Index: if_cdce.c
===
RCS file: /cvs/src/sys/dev/usb/if_cdce.c,v
retrieving revision 1.49
diff -u -p -r1.49 if_cdce.c
--- if_cdce.c   25 Jan 2011 20:03:35 -  1.49
+++ if_cdce.c   16 Mar 2011 20:34:45 -
@@ -776,16 +776,13 @@ cdce_rxeof(usbd_xfer_handle xfer, usbd_p
usbd_get_xfer_status(xfer, NULL, NULL, &total_len, NULL);
if (sc->cdce_flags & CDCE_ZAURUS)
total_len -= 4; /* Strip off CRC added by Zaurus */
-   if (total_len <= 1)
+   if (total_len < ETHERMIN || total_len > ifp->if_hardmtu) {
+   ifp->if_ierrors++;
goto done;
+   }
 
m = c->cdce_mbuf;
memcpy(mtod(m, char *), c->cdce_buf, total_len);
-
-   if (total_len < sizeof(struct ether_header)) {
-   ifp->if_ierrors++;
-   goto done;
-   }
 
ifp->if_ipackets++;
 
Index: if_cue.c
===
RCS file: /cvs/src/sys/dev/usb/if_cue.c,v
retrieving revision 1.59
diff -u -p -r1.59 if_cue.c
--- if_cue.c25 Jan 2011 20:03:35 -  1.59
+++ if_cue.c16 Mar 2011 20:34:46 -
@@ -738,6 +738,11 @@ cue_rxeof(usbd_xfer_handle xfer, usbd_pr
 
usbd_get_xfer_status(xfer, NULL, NULL, &total_len, NULL);
 
+   if (total_len < ETHERMIN || total_len > ifp->if_hardmtu) {
+   ifp->if_ierrors++;
+   goto done;
+   }
+
memcpy(mtod(c->cue_mbuf, char *), c->cue_buf, total_len);
 
m = c->cue_mbuf;
Index: if_kue.c
===
RCS file: /cvs/src/sys/dev/usb/if_kue.c,v
retrieving revision 1.63
diff -u -p -r1.63 if_kue.c
--- if_kue.c25 Jan 2011 20:03:35 -  1.63
+++ if_kue.c16 Mar 2011 20:34:47 -
@@ -741,8 +741,10 @@ kue_rxeof(usbd_xfer_handle xfer, usbd_pr
 __func__, total_len,
 UGETW(mtod(c->kue_mbuf, u_int8_t *;
 
-   if (total_len <= 1)
+   if (total_len < ETHERMIN || total_len > ifp->if_hardmtu) {
+   ifp->if_ierrors++;
goto done;
+   }
 
m = c->kue_mbuf;
/* copy data to mbuf */
Index: if_mos.c
===
RCS file: /cvs/src/sys/dev/usb/if_mos.c,v
retrieving revision 1.13
diff -u -p -r1.13 if_mos.c
--- if_mos.c25 Jan 2011 20:03:35 -  1.13
+++ if_mos.c16 Mar 2011 20:34:48 -
@@ -955,8 +955,10 @@ mos_rxeof(usbd_xfer_handle xfer, usbd_pr
 
usbd_get_xfer_status(xfer, NULL, NULL, &total_len, NULL);
 
-   if (total_len <= 1)
+   if (total_len < ETHERMIN || total_len > ifp->if_hardmtu) {
+   ifp->if_ierrors++;
goto done;
+   }
 
/* evaluate status byte at the end */
pktlen = total_len - 1;
Index: if_url.c
=

Re: [PATCH] frame length validation for USB ethernet adapters

2011-03-16 Thread Matthias Kilian
Hi,

On Wed, Mar 16, 2011 at 04:58:19PM -0400, Loganaden Velvindron wrote:
> After my experience with udav(4), I took a look at other USB  
> adapters. The diff makes all of them more consistent by checking
> the frame length returned and validating it. 
> 
> Since I don't own any of those adapters, I must rely on you people to 
> test them. The diff is wrong unless successful reports are heard from users.
> 
> Of course, if the adapters are broken after applying the diff, I'll  
> do my best to track down the problem. 

FYI: I just noticed (about 10 minutes ago, after bringing my zaurus
up to date) that the recent if_udav patch breaks nfs client
functionality. No time to debug it yet, though :-(

Ciao,
Kili



cwm diff: some fixes and improvements

2011-03-16 Thread Sviatoslav Chagaev
[calmwm.h, conf.c, mousefunc.c, parse.y]
When a window is being moved with the mouse, if the window comes within
SNAPDIST pixels of the screen's edge -- snap the window to the screen's
edge.

[kbfunc.c]
Suppose moveamount=1, then bigmoveamount=10. The window is 3 pixels
away from the screen's edge. If the window is moved by bigmoveamount
toward the screen edge, then it will align itself perfectly along the
screen's edge, i.e. travel only 3 pixels, instead of 10. Subsequent
moves don't have any special behaviour. Works both ways: when moving a
window from beyond the screen to within and vice versa.

[menu.c]
Bugfix: the menu code ignores the fact that it might be on a multi-head
configuration, where screens are configured to be atop of each other,
e.g. xrandr --output LVDS --primary --auto xrandr --output TMDS-1
--above LVDS --auto In this case when a menu containing a lot of
entries is opened, it will span both screens, which is quite annoying
and contradicts cwm's behaviour regarding placing new windows and
window maximization.

[menu.c]
Don't move the pointer when resizing the menu. Reasoning: I already
have my pointer right where I want it to be, thank you very much. For
example, hovering above a certain control of a program that I'm about
to launch.

[screen.c]
Fix screen_find_xinerama(). For example, pixel (0,0) belongs to the
top-left-most screen.

Index: calmwm.h
===
RCS file: /OpenBSD/xenocara/app/cwm/calmwm.h,v
retrieving revision 1.118
diff -u -r1.118 calmwm.h
--- calmwm.h22 May 2010 22:10:31 -  1.118
+++ calmwm.h16 Mar 2011 20:16:33 -
@@ -287,10 +287,12 @@
 
 #defineCONF_STICKY_GROUPS   0x0001
int  flags;
-#define CONF_BWIDTH 1
+#defineCONF_BWIDTH  1
int  bwidth;
 #defineCONF_MAMOUNT 1
int  mamount;
+#defineCONF_SNAPDIST12
+   int  snapdist;
struct gap   gap;
 
 #define CONF_COLOR_ACTIVEBORDER"#CC"
Index: conf.c
===
RCS file: /OpenBSD/xenocara/app/cwm/conf.c,v
retrieving revision 1.76
diff -u -r1.76 conf.c
--- conf.c  27 Jan 2010 03:04:50 -  1.76
+++ conf.c  16 Mar 2011 20:16:33 -
@@ -184,6 +184,7 @@
c->flags = 0;
c->bwidth = CONF_BWIDTH;
c->mamount = CONF_MAMOUNT;
+   c->snapdist = CONF_SNAPDIST;
 
TAILQ_INIT(&c->ignoreq);
TAILQ_INIT(&c->cmdq);
Index: kbfunc.c
===
RCS file: /OpenBSD/xenocara/app/cwm/kbfunc.c,v
retrieving revision 1.51
diff -u -r1.51 kbfunc.c
--- kbfunc.c10 Feb 2010 01:23:05 -  1.51
+++ kbfunc.c16 Mar 2011 20:16:33 -
@@ -55,8 +55,11 @@
 kbfunc_moveresize(struct client_ctx *cc, union arg *arg)
 {
struct screen_ctx   *sc;
-   int  x, y, flags, amt;
+   int  x, y, right, bottom, bwidth2, flags, amt;
+   int  old_x, old_y, old_right, old_bottom;
+   int  xmin, ymin, xmax, ymax;
u_intmx, my;
+   XineramaScreenInfo  *xine;
 
sc = cc->sc;
mx = my = 0;
@@ -69,6 +72,20 @@
amt = amt * 10;
}
 
+   xine = screen_find_xinerama(sc,
+   cc->geom.x + cc->geom.width/2, cc->geom.y + cc->geom.height/2);
+   if (xine) {
+   xmin = xine->x_org;
+   ymin = xine->y_org;
+   xmax = xine->x_org + xine->width;
+   ymax = xine->y_org + xine->height;
+   } else {
+   xmin = 0;
+   ymin = 0;
+   xmax = sc->xmax;
+   ymax = sc->ymax;
+   }
+
switch (flags & movemask) {
case CWM_UP:
my -= amt;
@@ -85,22 +102,47 @@
}
switch (flags & typemask) {
case CWM_MOVE:
-   cc->geom.y += my;
+   bwidth2 = cc->bwidth * 2;
+
+   old_y = cc->geom.y;
+   old_bottom = old_y + cc->geom.height + bwidth2;
+   old_x = cc->geom.x;
+   old_right = old_x + cc->geom.width + bwidth2;
+
+   y = cc->geom.y + my;
+   bottom = y + cc->geom.height + bwidth2;
+   x = cc->geom.x + mx;
+   right = x + cc->geom.width + bwidth2;
+
+   if (abs(ymin - old_y) < abs(my) && abs(ymin - y) < abs(my))
+   y = ymin;
+   else if (abs(ymax - old_bottom) < abs(my)
+   && abs(ymax - bottom) < abs(my))
+   y = ymax - cc->geom.height - bwidth2;
+
+   if (abs(xmin - old_x) < abs(mx) && abs(xmin - x) < abs(mx))
+   x = xmin;
+   else if (abs(xmax - ol

Re: cwm diff: some fixes and improvements

2011-03-16 Thread Okan Demirmen
thanks, I'll take a look at these.  in the future, please send separate
diffs for new features and bugfixes - thanks.

cheers,
okan

On Wed 2011.03.16 at 22:31 +0200, Sviatoslav Chagaev wrote:
> [calmwm.h, conf.c, mousefunc.c, parse.y]
> When a window is being moved with the mouse, if the window comes within
> SNAPDIST pixels of the screen's edge -- snap the window to the screen's
> edge.
> 
> [kbfunc.c]
> Suppose moveamount=1, then bigmoveamount=10. The window is 3 pixels
> away from the screen's edge. If the window is moved by bigmoveamount
> toward the screen edge, then it will align itself perfectly along the
> screen's edge, i.e. travel only 3 pixels, instead of 10. Subsequent
> moves don't have any special behaviour. Works both ways: when moving a
> window from beyond the screen to within and vice versa.
> 
> [menu.c]
> Bugfix: the menu code ignores the fact that it might be on a multi-head
> configuration, where screens are configured to be atop of each other,
> e.g. xrandr --output LVDS --primary --auto xrandr --output TMDS-1
> --above LVDS --auto In this case when a menu containing a lot of
> entries is opened, it will span both screens, which is quite annoying
> and contradicts cwm's behaviour regarding placing new windows and
> window maximization.
> 
> [menu.c]
> Don't move the pointer when resizing the menu. Reasoning: I already
> have my pointer right where I want it to be, thank you very much. For
> example, hovering above a certain control of a program that I'm about
> to launch.
> 
> [screen.c]
> Fix screen_find_xinerama(). For example, pixel (0,0) belongs to the
> top-left-most screen.
> 
> Index: calmwm.h
> ===
> RCS file: /OpenBSD/xenocara/app/cwm/calmwm.h,v
> retrieving revision 1.118
> diff -u -r1.118 calmwm.h
> --- calmwm.h  22 May 2010 22:10:31 -  1.118
> +++ calmwm.h  16 Mar 2011 20:16:33 -
> @@ -287,10 +287,12 @@
>  
>  #define  CONF_STICKY_GROUPS   0x0001
>   int  flags;
> -#define CONF_BWIDTH   1
> +#define  CONF_BWIDTH  1
>   int  bwidth;
>  #define  CONF_MAMOUNT 1
>   int  mamount;
> +#define  CONF_SNAPDIST12
> + int  snapdist;
>   struct gap   gap;
>  
>  #define CONF_COLOR_ACTIVEBORDER  "#CC"
> Index: conf.c
> ===
> RCS file: /OpenBSD/xenocara/app/cwm/conf.c,v
> retrieving revision 1.76
> diff -u -r1.76 conf.c
> --- conf.c27 Jan 2010 03:04:50 -  1.76
> +++ conf.c16 Mar 2011 20:16:33 -
> @@ -184,6 +184,7 @@
>   c->flags = 0;
>   c->bwidth = CONF_BWIDTH;
>   c->mamount = CONF_MAMOUNT;
> + c->snapdist = CONF_SNAPDIST;
>  
>   TAILQ_INIT(&c->ignoreq);
>   TAILQ_INIT(&c->cmdq);
> Index: kbfunc.c
> ===
> RCS file: /OpenBSD/xenocara/app/cwm/kbfunc.c,v
> retrieving revision 1.51
> diff -u -r1.51 kbfunc.c
> --- kbfunc.c  10 Feb 2010 01:23:05 -  1.51
> +++ kbfunc.c  16 Mar 2011 20:16:33 -
> @@ -55,8 +55,11 @@
>  kbfunc_moveresize(struct client_ctx *cc, union arg *arg)
>  {
>   struct screen_ctx   *sc;
> - int  x, y, flags, amt;
> + int  x, y, right, bottom, bwidth2, flags, amt;
> + int  old_x, old_y, old_right, old_bottom;
> + int  xmin, ymin, xmax, ymax;
>   u_intmx, my;
> + XineramaScreenInfo  *xine;
>  
>   sc = cc->sc;
>   mx = my = 0;
> @@ -69,6 +72,20 @@
>   amt = amt * 10;
>   }
>  
> + xine = screen_find_xinerama(sc,
> + cc->geom.x + cc->geom.width/2, cc->geom.y + cc->geom.height/2);
> + if (xine) {
> + xmin = xine->x_org;
> + ymin = xine->y_org;
> + xmax = xine->x_org + xine->width;
> + ymax = xine->y_org + xine->height;
> + } else {
> + xmin = 0;
> + ymin = 0;
> + xmax = sc->xmax;
> + ymax = sc->ymax;
> + }
> +
>   switch (flags & movemask) {
>   case CWM_UP:
>   my -= amt;
> @@ -85,22 +102,47 @@
>   }
>   switch (flags & typemask) {
>   case CWM_MOVE:
> - cc->geom.y += my;
> + bwidth2 = cc->bwidth * 2;
> +
> + old_y = cc->geom.y;
> + old_bottom = old_y + cc->geom.height + bwidth2;
> + old_x = cc->geom.x;
> + old_right = old_x + cc->geom.width + bwidth2;
> +
> + y = cc->geom.y + my;
> + bottom = y + cc->geom.height + bwidth2;
> + x = cc->geom.x + mx;
> + right = x + cc->geom.width + bwidth2;
> +
> + if (abs(ymin - old_y) < abs(my) && abs(ymin - y) < abs(my))
> + y = ymin;
> + 

Re: cwm diff: some fixes and improvements

2011-03-16 Thread Sviatoslav Chagaev
On Wed, 16 Mar 2011 22:31:06 +0200
Sviatoslav Chagaev <0x1...@gmail.com> wrote:

> [calmwm.h, conf.c, mousefunc.c, parse.y]
> When a window is being moved with the mouse, if the window comes within
> SNAPDIST pixels of the screen's edge -- snap the window to the screen's
> edge.
> 
> [kbfunc.c]
> Suppose moveamount=1, then bigmoveamount=10. The window is 3 pixels
> away from the screen's edge. If the window is moved by bigmoveamount
> toward the screen edge, then it will align itself perfectly along the
> screen's edge, i.e. travel only 3 pixels, instead of 10. Subsequent
> moves don't have any special behaviour. Works both ways: when moving a
> window from beyond the screen to within and vice versa.
> 
> [menu.c]
> Bugfix: the menu code ignores the fact that it might be on a multi-head
> configuration, where screens are configured to be atop of each other,
> e.g. xrandr --output LVDS --primary --auto xrandr --output TMDS-1
> --above LVDS --auto In this case when a menu containing a lot of
> entries is opened, it will span both screens, which is quite annoying
> and contradicts cwm's behaviour regarding placing new windows and
> window maximization.
> 
> [menu.c]
> Don't move the pointer when resizing the menu. Reasoning: I already
> have my pointer right where I want it to be, thank you very much. For
> example, hovering above a certain control of a program that I'm about
> to launch.
> 
> [screen.c]
> Fix screen_find_xinerama(). For example, pixel (0,0) belongs to the
> top-left-most screen.
> 

Forgot about the manpage.

Index: cwmrc.5
===
RCS file: /OpenBSD/xenocara/app/cwm/cwmrc.5,v
retrieving revision 1.34
diff -u -r1.34 cwmrc.5
--- cwmrc.5 25 Sep 2010 21:48:08 -  1.34
+++ cwmrc.5 16 Mar 2011 20:41:25 -
@@ -185,6 +185,12 @@
 in pixels.
 The default is 1.
 .Pp
+.It Ic snapdist Ic Ar pixels
+When moving a window using the mouse, if the window comes within
+.Ar pixels
+of the screen's edge, then the window will be snapped to that edge.
+The default is 12.
+.Pp
 .It Ic sticky Ic yes Ns \&| Ns Ic no
 Toggle sticky group mode.
 The default behavior for new windows is to not assign any group.



Re: Missing icps_bmcastecho in netstat.

2011-03-16 Thread Christiano F. Haesbaert
On 10 March 2011 19:31, Christiano F. Haesbaert 
wrote:
> Hi, the following displays rejected icmp echo requests sent to bcast/mcast.
>
> Index: inet.c
> ===
> RCS file: /cvs/src/usr.bin/netstat/inet.c,v
> retrieving revision 1.115
> diff -d -u -p -w -r1.115 inet.c
> --- inet.c  2 Mar 2011 21:51:14 -   1.115
> +++ inet.c  10 Mar 2011 22:31:16 -
> @@ -587,6 +587,8 @@ icmp_stats(char *name)
>p(icps_tooshort, "\t%lu message%s < minimum length\n");
>p(icps_checksum, "\t%lu bad checksum%s\n");
>p(icps_badlen, "\t%lu message%s with bad length\n");
> +   p(icps_bmcastecho, "\t%lu echo message%s to broadcast/multicast "
> +   "rejected\n");
>for (first = 1, i = 0; i < ICMP_MAXTYPE + 1; i++)
>if (icmpstat.icps_inhist[i] != 0) {
>if (first) {
>
>

Any feedback on this ?



Re: Missing icps_bmcastecho in netstat.

2011-03-16 Thread Stuart Henderson
On 2011/03/16 19:01, Christiano F. Haesbaert wrote:
> On 10 March 2011 19:31, Christiano F. Haesbaert 
> wrote:
> > Hi, the following displays rejected icmp echo requests sent to bcast/mcast.
> >
> > Index: inet.c
> > ===
> > RCS file: /cvs/src/usr.bin/netstat/inet.c,v
> > retrieving revision 1.115
> > diff -d -u -p -w -r1.115 inet.c
> > --- inet.c  2 Mar 2011 21:51:14 -   1.115
> > +++ inet.c  10 Mar 2011 22:31:16 -
> > @@ -587,6 +587,8 @@ icmp_stats(char *name)
> >p(icps_tooshort, "\t%lu message%s < minimum length\n");
> >p(icps_checksum, "\t%lu bad checksum%s\n");
> >p(icps_badlen, "\t%lu message%s with bad length\n");
> > +   p(icps_bmcastecho, "\t%lu echo message%s to broadcast/multicast "
> > +   "rejected\n");
> >for (first = 1, i = 0; i < ICMP_MAXTYPE + 1; i++)
> >if (icmpstat.icps_inhist[i] != 0) {
> >if (first) {
> >
> >
> 
> Any feedback on this ?
> 

It's ok with me, I'll probably commit it tomorrow unless there are
objections or someone beats me to it. I considered removing the word
'rejected' to make it better fit the text style of other lines, but
that would be incorrect as the counter is not incremented if
net.inet.icmp.bmcastecho == 1.



Re: ISO-8859-1 character in manpage

2011-03-16 Thread Ingo Schwarze
Hi Anthony,

Anthony J. Bentley wrote on Wed, Mar 16, 2011 at 01:37:50PM -0600:

> $ mandoc -Tlint /usr/src/share/man/man4/udl.4  
> /usr/src/share/man/man4/udl.4:42:6:
>   ERROR: skipping bad character: ignoring byte

Thanks for reporting!

Indeed, that character had to be replaced, ...

> The o with diaeresis should be replaced with the \(:o escape.
> (See mandoc_char(7).)

... however the German noun "Koenig" does not contain "o diaeresis",
but "o umlaut".  As this is a common source of confusion even
among native Germans, here is my commit message to explain the
situation:

  Using mandoc_char(7) escapes like "K\(:onig" for German umlauts
  is incorrect.  The escape sequence "\(:o" represents "o diaeresis",
  not "o umlaut".  These are two very different phonological phenomena
  that only happen to be represented by the same diacritic mark.
  In -Tascii mode, all renderers correctly render "\(:o" (o diaeresis)
  as plain "o", but that rendering is incorrect for "o umlaut", which
  must be transliterated to the digraph "oe" in -Tascii.
  There is no mandoc_char(7) escape for "o umlaut", so we must give
  the digraph as plain text in the mdoc(7) source code.

  For manuals, ASCII rendering is clearly much more important than
  PostScript or HTML rendering.  Besides, we should not sacrifice
  correct rendering in any mode in order to get slightly nicer rendering
  in some other mode.

> Would send a patch, but I've never had luck sending high-bit files
> to the list.

No sweat, that fix was easy enough without a patch.

Thanks,
  Ingo



Re: bin/ksh: fix possible use of uninitialized variable

2011-03-16 Thread Kevin Lo
On Wed, 2011-03-16 at 12:30 -0600, Theo de Raadt wrote:
> I don't see any warnings.  Please show them.
> 
> If gcc is being fooled by loops, then this is because gcc is stupid.
> it you show the warnings we can judge it.
> 
> In particular, the slen one looks totally bogus.

eval.c: In function 'expand':
eval.c:155: warning: 'x.split' may be used uninitialized in this
function
eval.c:155: warning: 'x.str' may be used uninitialized in this function
eval.c:268: warning: 'slen' may be used uninitialized in this function

# pwd
/usr/src/bin/ksh

Kevin



Re: Missing icps_bmcastecho in netstat.

2011-03-16 Thread Christiano F. Haesbaert
On Wed, Mar 16, 2011 at 11:45:03PM +, Stuart Henderson wrote:
> On 2011/03/16 19:01, Christiano F. Haesbaert wrote:
> > On 10 March 2011 19:31, Christiano F. Haesbaert 
> > wrote:
> > > Hi, the following displays rejected icmp echo requests sent to 
> > > bcast/mcast.
> > >
> > > Index: inet.c
> > > ===
> > > RCS file: /cvs/src/usr.bin/netstat/inet.c,v
> > > retrieving revision 1.115
> > > diff -d -u -p -w -r1.115 inet.c
> > > --- inet.c  2 Mar 2011 21:51:14 -   1.115
> > > +++ inet.c  10 Mar 2011 22:31:16 -
> > > @@ -587,6 +587,8 @@ icmp_stats(char *name)
> > >p(icps_tooshort, "\t%lu message%s < minimum length\n");
> > >p(icps_checksum, "\t%lu bad checksum%s\n");
> > >p(icps_badlen, "\t%lu message%s with bad length\n");
> > > +   p(icps_bmcastecho, "\t%lu echo message%s to broadcast/multicast "
> > > +   "rejected\n");
> > >for (first = 1, i = 0; i < ICMP_MAXTYPE + 1; i++)
> > >if (icmpstat.icps_inhist[i] != 0) {
> > >if (first) {
> > >
> > >
> > 
> > Any feedback on this ?
> > 
> 
> It's ok with me, I'll probably commit it tomorrow unless there are
> objections or someone beats me to it. I considered removing the word
> 'rejected' to make it better fit the text style of other lines, but
> that would be incorrect as the counter is not incremented if
> net.inet.icmp.bmcastecho == 1.

Sweet, I wasn't really sure about the text either.
-- 
Christiano Farina HAESBAERT
Do NOT send me html mail.



Re: [PATCH] frame length validation for USB ethernet adapters

2011-03-16 Thread Loganaden Velvindron
Hi Kiki,
Can you send us a trace & dmesg ?

//Logan
C-x-C-c



Re: [PATCH] Bypass routing table for mcast packets when using IP_MULTICAST_IF

2011-03-16 Thread Christiano F. Haesbaert
On 12 June 2010 16:26, Christiano F. Haesbaert 
wrote:
> Hi,
>
> The following will disregard the routing table for multicast packets
> when the application chose the interface with IP_MULTICAST_IF, if not,
> normal lookup will take place.
>
> Ripd now no longer needs to explicitly add the mcast host route to
> bypass the default reject to 224/4, follows the diff to remove it.
>
> Regarding the normal lookup when IP_MULTICAST_IF wan't set, UNP
> regards it as a BSD descendant behaviour, I really don't know anything
> else.
>
> I've tested it in a small setup, if someone could confirm it in a
> scarier environment would be nice.
>
> Index: netinet/in_pcb.c
> ===
> RCS file: /cvs/src/sys/netinet/in_pcb.c,v
> retrieving revision 1.112
> diff -d -u -p -w netinet/in_pcb.c
> --- netinet/in_pcb.c7 May 2010 13:33:16 -   1.112
> +++ netinet/in_pcb.c12 Jun 2010 19:18:49 -
> @@ -819,7 +819,9 @@ in_selectsrc(struct sockaddr_in *sin, struct route *ro
>}
>if ((soopts & SO_DONTROUTE) == 0 && /*XXX*/
>(ro->ro_rt == (struct rtentry *)0 ||
> -   ro->ro_rt->rt_ifp == (struct ifnet *)0)) {
> +   ro->ro_rt->rt_ifp == (struct ifnet *)0) &&
> +   !(IN_MULTICAST(sin->sin_addr.s_addr) &&
> +   mopts && (mopts->imo_multicast_ifp != NULL))) {
>/* No route yet, so try to acquire one */
>ro->ro_dst.sa_family = AF_INET;
>ro->ro_dst.sa_len = sizeof(struct sockaddr_in);
>
>
> Index: kroute.c
> ===
> RCS file: /cvs/src/usr.sbin/ripd/kroute.c,v
> retrieving revision 1.21
> diff -d -u -p -w kroute.c
> --- kroute.c2 Jan 2009 14:40:54 -   1.21
> +++ kroute.c12 Jun 2010 19:19:51 -
> @@ -97,9 +97,6 @@ RB_HEAD(kif_tree, kif_node)   kit;
>  RB_PROTOTYPE(kif_tree, kif_node, entry, kif_compare)
>  RB_GENERATE(kif_tree, kif_node, entry, kif_compare)
>
> -struct kroute kr_all_rip_routers;
> -intflag_all_rip_routers = 0;
> -
>  int
>  kif_init(void)
>  {
> @@ -151,14 +148,6 @@ kr_init(int fs, u_int rdomain)
>if (protect_lo() == -1)
>return (-1);
>
> -   kr_all_rip_routers.prefix.s_addr = inet_addr(ALL_RIP_ROUTERS);
> -   kr_all_rip_routers.netmask.s_addr = htonl(INADDR_BROADCAST);
> -   kr_all_rip_routers.nexthop.s_addr = htonl(INADDR_LOOPBACK);
> -
> -   kr_state.fib_sync = 1; /* force addition of multicast route */
> -   if (send_rtmsg(kr_state.fd, RTM_ADD, &kr_all_rip_routers) != -1)
> -   flag_all_rip_routers = 1;
> -
>kr_state.fib_sync = fs; /* now set correct sync mode */
>kr_state.rdomain = rdomain;
>
> @@ -243,11 +232,6 @@ void
>  kr_shutdown(void)
>  {
>kr_fib_decouple();
> -
> -   if (flag_all_rip_routers) {
> -   kr_state.fib_sync = 1; /* force removal of mulitcast route
*/
> -   (void)send_rtmsg(kr_state.fd, RTM_DELETE,
&kr_all_rip_routers);
> -   }
>
>kroute_clear();
>kif_clear();
>

Wow I had completely forgotten about this, I'm using this diff since
then, any comments ?

Thanks



Re: [PATCH] frame length validation for USB ethernet adapters

2011-03-16 Thread Loganaden Velvindron
The broken udav(4) diff is my fault. I didn't
test with NFS and large file transfers when jsg@
sent me his diff (privately). He trusted my feedback
and that's how it was committed.

Can we move on now ?

//Logan
C-x-C-c