ftp, ignore whitespace at end of Content-Length

2012-04-23 Thread Stuart Henderson
As noted on misc, ftp http://www.spamhaus.org/drop/drop.lasso fails due
to whitespace after the value of the content-length header.

wget/curl/lynx/w3m all handle this.

OK?

Index: fetch.c
===
RCS file: /cvs/src/usr.bin/ftp/fetch.c,v
retrieving revision 1.103
diff -u -p -r1.103 fetch.c
--- fetch.c 25 Aug 2010 20:32:37 -  1.103
+++ fetch.c 23 Apr 2012 07:19:45 -
@@ -746,7 +746,10 @@ again:
cp = buf;
 #define CONTENTLEN Content-Length: 
if (strncasecmp(cp, CONTENTLEN, sizeof(CONTENTLEN) - 1) == 0) {
+   size_t s;
cp += sizeof(CONTENTLEN) - 1;
+   if (s=strcspn(cp,  \t))
+   *(cp+s) = 0;
filesize = strtonum(cp, 0, LLONG_MAX, errstr);
if (errstr != NULL)
goto improper;



add vmxnet3 to pcidevs

2012-04-23 Thread mxb

Diff below adds vmxnet3 to pcidevs.
vmxnet and vmxnet2 have the same PCI ID and thus catched by the same 
macro - VMWARE NET.


While there, remove \t with space for MACHINE_2

//maxim

Index: sys/dev/pci/pcidevs
===
RCS file: /cvs/src/sys/dev/pci/pcidevs,v
retrieving revision 1.1639
diff -u -p -r1.1639 pcidevs
--- sys/dev/pci/pcidevs 14 Apr 2012 08:59:53 -  1.1639
+++ sys/dev/pci/pcidevs 23 Apr 2012 08:31:32 -
@@ -5870,7 +5870,8 @@ product VLSI 82C925   0x0280  82C925
 product VMWARE VIRTUAL20x0405  Virtual SVGA II
 product VMWARE VIRTUAL 0x0710  Virtual SVGA
 product VMWARE NET 0x0720  Virtual NIC
-productVMWARE MACHINE_20x0740  Virtual Machine 
Communication Interface

+product VMWARE NET30x07b0  Virtual NIC III
+product VMWARE MACHINE_2   0x0740  Virtual Machine Communication 
Interface

 product VMWARE EHCI0x0770  Virtual EHCI
 product VMWARE PCI 0x0790  Virtual PCI-PCI
 product VMWARE PCIE0x07a0  Virtual PCIE-PCIE



Re: add vmxnet3 to pcidevs

2012-04-23 Thread Brad Smith

On 23/04/12 4:32 AM, mxb wrote:

Diff below adds vmxnet3 to pcidevs.
vmxnet and vmxnet2 have the same PCI ID and thus catched by the same
macro - VMWARE NET.

While there, remove \t with space for MACHINE_2


The PCI id entries are sorted so this new addition needs to be
moved further down so it is in order.


//maxim

Index: sys/dev/pci/pcidevs
===
RCS file: /cvs/src/sys/dev/pci/pcidevs,v
retrieving revision 1.1639
diff -u -p -r1.1639 pcidevs
--- sys/dev/pci/pcidevs 14 Apr 2012 08:59:53 - 1.1639
+++ sys/dev/pci/pcidevs 23 Apr 2012 08:31:32 -
@@ -5870,7 +5870,8 @@ product VLSI 82C925 0x0280 82C925
product VMWARE VIRTUAL2 0x0405 Virtual SVGA II
product VMWARE VIRTUAL 0x0710 Virtual SVGA
product VMWARE NET 0x0720 Virtual NIC
-product VMWARE MACHINE_2 0x0740 Virtual Machine Communication Interface
+product VMWARE NET3 0x07b0 Virtual NIC III
+product VMWARE MACHINE_2 0x0740 Virtual Machine Communication Interface
product VMWARE EHCI 0x0770 Virtual EHCI
product VMWARE PCI 0x0790 Virtual PCI-PCI
product VMWARE PCIE 0x07a0 Virtual PCIE-PCIE




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



Re: pthread_spin_lock family implementation

2012-04-23 Thread David Coppa
On Fri, Apr 20, 2012 at 9:47 PM, Brad Smith b...@comstyle.com wrote:
 On 13/04/12 11:37 AM, Paul Irofti wrote:

 On Fri, Apr 13, 2012 at 05:34:09PM +0300, Paul Irofti wrote:

 Okay? (Yes, I'll do the manpage bits as well).


 Now with documentation and style fixes and hppa support.


 Tested with VLC which will use spin locks if available instead of falling
 back to mutexes and no noticeable regressions.

Any chance for this to go in?

cheers,
david



Re: add vmxnet3 to pcidevs

2012-04-23 Thread mxb

On 04/23/2012 10:39 AM, Brad Smith wrote:

On 23/04/12 4:32 AM, mxb wrote:

Diff below adds vmxnet3 to pcidevs.
vmxnet and vmxnet2 have the same PCI ID and thus catched by the same
macro - VMWARE NET.

While there, remove \t with space for MACHINE_2


The PCI id entries are sorted so this new addition needs to be
moved further down so it is in order.


//maxim

Index: sys/dev/pci/pcidevs
===
RCS file: /cvs/src/sys/dev/pci/pcidevs,v
retrieving revision 1.1639
diff -u -p -r1.1639 pcidevs
--- sys/dev/pci/pcidevs 14 Apr 2012 08:59:53 - 1.1639
+++ sys/dev/pci/pcidevs 23 Apr 2012 08:31:32 -
@@ -5870,7 +5870,8 @@ product VLSI 82C925 0x0280 82C925
product VMWARE VIRTUAL2 0x0405 Virtual SVGA II
product VMWARE VIRTUAL 0x0710 Virtual SVGA
product VMWARE NET 0x0720 Virtual NIC
-product VMWARE MACHINE_2 0x0740 Virtual Machine Communication Interface
+product VMWARE NET3 0x07b0 Virtual NIC III
+product VMWARE MACHINE_2 0x0740 Virtual Machine Communication Interface
product VMWARE EHCI 0x0770 Virtual EHCI
product VMWARE PCI 0x0790 Virtual PCI-PCI
product VMWARE PCIE 0x07a0 Virtual PCIE-PCIE






Sorry, forgot that one. Been long time.
New diff below.

Index: sys/dev/pci/pcidevs
===
RCS file: /cvs/src/sys/dev/pci/pcidevs,v
retrieving revision 1.1639
diff -u -p -r1.1639 pcidevs
--- sys/dev/pci/pcidevs 14 Apr 2012 08:59:53 -  1.1639
+++ sys/dev/pci/pcidevs 23 Apr 2012 09:00:38 -
@@ -5870,11 +5870,12 @@ product VLSI 82C925 0x0280  82C925
 product VMWARE VIRTUAL20x0405  Virtual SVGA II
 product VMWARE VIRTUAL 0x0710  Virtual SVGA
 product VMWARE NET 0x0720  Virtual NIC
-productVMWARE MACHINE_20x0740  Virtual Machine 
Communication Interface
+product VMWARE MACHINE_2   0x0740  Virtual Machine Communication 
Interface

 product VMWARE EHCI0x0770  Virtual EHCI
 product VMWARE PCI 0x0790  Virtual PCI-PCI
 product VMWARE PCIE0x07a0  Virtual PCIE-PCIE
-productVMWARE MACHINE  0x0801  Virtual Machine Interface
+product VMWARE NET30x07b0  Virtual NIC III
+product VMWARE MACHINE 0x0801  Virtual Machine Interface

 /* Weitek products */
 product WEITEK P9000   0x9001  P9000



Re: pthread_spin_lock family implementation

2012-04-23 Thread Paul Irofti
On Mon, Apr 23, 2012 at 10:40:27AM +0200, David Coppa wrote:
 On Fri, Apr 20, 2012 at 9:47 PM, Brad Smith b...@comstyle.com wrote:
  On 13/04/12 11:37 AM, Paul Irofti wrote:
 
  On Fri, Apr 13, 2012 at 05:34:09PM +0300, Paul Irofti wrote:
 
  Okay? (Yes, I'll do the manpage bits as well).
 
 
  Now with documentation and style fixes and hppa support.
 
 
  Tested with VLC which will use spin locks if available instead of falling
  back to mutexes and no noticeable regressions.
 
 Any chance for this to go in?

Sure, once I get some okays for it.



Re: add vmxnet3 to pcidevs

2012-04-23 Thread Stuart Henderson
On 2012/04/23 10:32, mxb wrote:
 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329
 Thunderbird/11.0.1
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Ne point resending now as it's simple enough to redo, but Thunderbird
mangled your diff, see this for info which is relevant when sending
diffs to most open source projects via email:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=Documentation/email-clients.txt



Remove timezone support from the kernel

2012-04-23 Thread Matthew Dempsky
There's no reason for the kernel to track the system's timezone
anymore.  This is handled in userspace by the TZ environment variable,
and POSIX doesn't even define what happens if you pass a non-NULL
pointer as the 'struct timezone *' argument to gettimeofday() (and
settimeofday() has never been in POSIX).

The diff below:
  - eliminates tz
  - adds a compile-time check to detect configs with non-0 timezone
  - changes settimeofday() to return EINVAL when given a non-0 timezone
  - eliminates the userconf code for changing/printing the timezone
  - removes clock and msdosfs code that looks at the kernel timezone

After this, we'll be able to move gettimeofday() and settimeofday()
into libc as user-space wrappers around clock_gettime() and
clock_settime(), respectively.

Any objections?


Index: conf/param.c
===
RCS file: /home/mdempsky/anoncvs/cvs/src/sys/conf/param.c,v
retrieving revision 1.34
diff -u -p -r1.34 param.c
--- conf/param.c10 Apr 2012 15:50:52 -  1.34
+++ conf/param.c23 Apr 2012 17:18:58 -
@@ -66,22 +66,19 @@
  * the kernel; it should be modified there to suit local taste
  * if necessary.
  *
- * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx
+ * Compiled with -DHZ=xx -DMAXUSERS=xx
  */
 
-#ifndef TIMEZONE
-# define TIMEZONE 0
-#endif
-#ifndef DST
-# define DST 0
+#if (defined(TIMEZONE)  TIMEZONE != 0) || (defined(DST)  DST != 0)
+#error Kernels cannot be configured with custom timezone settings anymore
 #endif
+
 #ifndef HZ
 #defineHZ 100
 #endif
 inthz = HZ;
 inttick = 100 / HZ;
 inttickadj = 24 / (60 * HZ);   /* can adjust 240ms in 60s */
-struct timezone tz = { TIMEZONE, DST };
 #defineNPROCESS (30 + 16 * MAXUSERS)
 #defineNTEXT (80 + NPROCESS / 8)   /* actually the object 
cache */
 #defineNVNODE (NPROCESS * 2 + NTEXT + 100)  
Index: kern/kern_time.c
===
RCS file: /home/mdempsky/anoncvs/cvs/src/sys/kern/kern_time.c,v
retrieving revision 1.74
diff -u -p -r1.74 kern_time.c
--- kern/kern_time.c23 Mar 2012 15:51:26 -  1.74
+++ kern/kern_time.c23 Apr 2012 17:15:20 -
@@ -391,8 +391,10 @@ sys_gettimeofday(struct proc *p, void *v
}
 #endif
}
-   if (tzp)
+   if (tzp) {
+   const struct timezone tz = { 0 };
error = copyout(tz, tzp, sizeof (tz));
+   }
return (error);
 }
 
@@ -415,20 +417,22 @@ sys_settimeofday(struct proc *p, void *v
 
if ((error = suser(p, 0)))
return (error);
-   /* Verify all parameters before changing time. */
-   if (tv  (error = copyin(tv, atv, sizeof(atv
-   return (error);
-   if (tzp  (error = copyin(tzp, atz, sizeof(atz
-   return (error);
+   if (tzp) {
+   if ((error = copyin(tzp, atz, sizeof(atz))) != 0)
+   return (error);
+   if (atz.tz_minuteswest != 0 || atz.tz_dsttime != 0)
+   return (EINVAL);
+   }
if (tv) {
struct timespec ts;
 
+   if ((error = copyin(tv, atv, sizeof(atv))) != 0)
+   return (error);
+
TIMEVAL_TO_TIMESPEC(atv, ts);
if ((error = settime(ts)) != 0)
return (error);
}
-   if (tzp)
-   tz = atz;
return (0);
 }
 
Index: kern/subr_userconf.c
===
RCS file: /home/mdempsky/anoncvs/cvs/src/sys/kern/subr_userconf.c,v
retrieving revision 1.37
diff -u -p -r1.37 subr_userconf.c
--- kern/subr_userconf.c1 Jun 2011 04:35:22 -   1.37
+++ kern/subr_userconf.c23 Apr 2012 17:15:53 -
@@ -40,7 +40,6 @@ extern short cfroots[];
 extern int cfroots_size;
 extern int pv_size;
 extern short pv[];
-extern struct timezone tz;
 extern char *pdevnames[];
 extern int pdevnames_size;
 extern struct pdevinit pdevinit[];
@@ -1306,28 +1305,6 @@ userconf_parse(char *cmd)
userconf_show();
else
userconf_show_attr(c);
-   break;
-   case 't':
-   if (*c == '\0' || userconf_number(c, a) == 0) {
-   if (*c != '\0') {
-   tz.tz_minuteswest = a;
-   while (*c != '\n'  *c != '\t' 
-   *c != ' '  *c != '\0')
-   c++;
-   while (*c == '\t' || *c == ' ')
-   c++;
-   if (*c != '\0' 
-   userconf_number(c, a) == 0)
-

Re: Remove timezone support from the kernel

2012-04-23 Thread Vitali
On Mon, Apr 23, 2012 at 8:37 PM, Matthew Dempsky matt...@dempsky.org wrote:
 There's no reason for the kernel to track the system's timezone
 anymore. B This is handled in userspace by the TZ environment variable,
 and POSIX doesn't even define what happens if you pass a non-NULL
 pointer as the 'struct timezone *' argument to gettimeofday() (and
 settimeofday() has never been in POSIX).

 The diff below:
 B - eliminates tz
 B - adds a compile-time check to detect configs with non-0 timezone
 B - changes settimeofday() to return EINVAL when given a non-0 timezone
 B - eliminates the userconf code for changing/printing the timezone
 B - removes clock and msdosfs code that looks at the kernel timezone

 After this, we'll be able to move gettimeofday() and settimeofday()
 into libc as user-space wrappers around clock_gettime() and
 clock_settime(), respectively.

 Any objections?


I think it's a good idea. Should have been done long ago.

--
### Coonardoo - PQP8P=P8QP:P0 Q QQP=Q / The Well In The Shadow / Le
Puits
Dans L'Ombre ###