Bug#444970: squirrelmail: Can't send attachment either

2007-10-05 Thread Toni Timonen
Hi,

I can't send attachment either, and running PHP4. Downgrading back to
1.4.10a-2 fixes the problem so something has happened on the way to
1.4.11-1.


- Toni


-- 
Toni Timonen toni dot timonen at iki dot fi
NP Solutions Ltd
Helsinki University of Technology
Department of Engineering Physics and Mathematics


signature.asc
Description: Digital signature


Bug#409710: ipython: Doesn't handle utf8 strings correctly

2007-02-04 Thread Toni Timonen
Package: ipython
Version: 0.7.3-2
Severity: normal
Tags: patch

Behaviour in python interpreter:
Python 2.4.4 (#2, Jan 13 2007, 18:15:24)
Type help, copyright, credits or license for more information.
 u'Böö'
u'B\xf6\xf6'


Behaviour in ipython:
Python 2.4.4 (#2, Jan 13 2007, 18:15:24)
IPython 0.7.3 -- An enhanced Interactive Python.

In [1]: u'Böö'
Out[1]: u'B\xc3\xb6\xc3\xb6'

In [2]: print u'Böö'
Böö

Expected behaviour: Same as in regular python interpreter.

Behaviour after the patch:
Python 2.4.4 (#2, Jan 13 2007, 18:15:24)
IPython 0.7.3 -- An enhanced Interactive Python.

In [1]: u'Böö'
Out[1]: u'B\xf6\xf6'

In [2]: print u'Böö'
Böö



-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-amd64
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)

Versions of packages ipython depends on:
ii  python2.4.4-2An interactive high-level object-o
ii  python-central0.5.12 register and build utility for Pyt

Versions of packages ipython recommends:
ii  python-numeric24.2-7 Numerical (matrix-oriented) Mathem
pn  python-numeric-extnone (no description available)
pn  python-pexpectnone (no description available)

-- no debconf information

-- 
Toni Timonen toni dot timonen at iki dot fi
NP Solutions Ltd
Helsinki University of Technology
Department of Engineering Physics and Mathematicsdiff -rub ipython-0.7.3.orig/IPython/iplib.py ipython-0.7.3/IPython/iplib.py
--- ipython-0.7.3.orig/IPython/iplib.py	2006-12-11 18:52:16.0 +0200
+++ ipython-0.7.3/IPython/iplib.py	2007-02-04 23:37:03.0 +0200
@@ -1965,7 +1965,7 @@
 
 
 try:
-line = raw_input_original(prompt)
+line = raw_input_original(prompt).decode(sys.stdin.encoding)
 except ValueError:
 warn(\n\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!)
 self.exit_now = True


signature.asc
Description: Digital signature


Bug#379764: sysstat: iostat fails to show stats of one partition

2006-07-25 Thread Toni Timonen
Package: sysstat
Version: 6.1.3-1
Severity: normal
Tags: patch

Hi,

getting iostat of one partition fails.
eg.


[EMAIL PROTECTED]:~/work/m/tmp/sysstat-6.1.3$ ./iostat -p /dev/hda1
Linux 2.6.15-1-686 (sd033)  25/07/06

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
  10.860.64   35.550.720.00   52.23

  Device:tps   Blk_read/s   Blk_wrtn/s   Blk_read 
Blk_wrtn
[EMAIL PROTECTED]:~/work/m/tmp/sysstat-6.1.3$


(but running 'iostat -p /dev/hda' gives full output).
A patch to fix this issue is attached.

Behaviour after the patch:

[EMAIL PROTECTED]:~/work/m/tmp/sysstat-6.1.3-patched$ ./iostat -p /dev/hda1
Linux 2.6.15-1-686 (sd033)  07/25/06

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
  10.860.64   35.550.720.00   52.23

Device:tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
hda1  0.00 0.00 0.00   7993   9460

[EMAIL PROTECTED]:~/work/m/tmp/sysstat-6.1.3-patched$ 


-- 
Toni Timonen
040-5111863,GPG 0x7984A4FD
--- sysstat-6.1.3/iostat.c  2006-05-24 16:24:07.0 +0300
+++ sysstat-6.1.3-patched/iostat.c  2006-07-25 15:14:22.0 +0300
@@ -577,6 +577,17 @@
   if (ok  st_dev_list_i-disp_part)
 /* Also read stats for its partitions */
 read_sysfs_dlist_part_stat(curr, st_dev_list_i-dev_name);
+  else {
+   char *parent=strdup(st_dev_list_i-dev_name);
+   char *p=strpbrk(parent,DIGITS);
+   if(p) {
+   *p=0;
+   sprintf(filename,%s/%s/%s/%s,
+   SYSFS_BLOCK,parent,st_dev_list_i-dev_name,S_STAT);
+   
read_sysfs_file_stat(curr,filename,st_dev_list_i-dev_name,DT_PARTITION);
+   }
+   free(parent);
+  }
}
 
/* Free structures corresponding to unregistered devices */


Bug#374524: pidentd: ERROR : UNKNOWN-ERROR

2006-06-20 Thread Toni Timonen
On Mon, Jun 19, 2006 at 03:50:55PM -0400, Mark Whitis wrote:

 postgresql was failing due to identd failures
 
 telnet localhost 113
 113,59699
 113 , 59699 : ERROR : UNKNOWN-ERROR
 
 Jun 19 15:27:13 localhost identd[4389]: started
 Jun 19 15:27:19 localhost identd[4389]: netlink_lookup: write failed: 
 Connection refused
 
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=305926
 
 reports of this bugs demise are greatly exagerated.
 
 fgrep TCPDIAG /usr/src/linux-source-2.6.16/.config
shows nothing

I think it is called CONFIG_INET_TCP_DIAG in 2.6.16 and should 
be there already.

Loading module tcp_diag should do the trick.



-- 
Toni Timonen toni dot timonen at iki dot fi
NP Solutions Ltd
Helsinki University of Technology
Department of Engineering Physics and Mathematics

signature.asc
Description: Digital signature


Bug#251885: ITP: cgal -- C++ library for computational geometry

2006-02-07 Thread Toni Timonen
On Tue, Feb 07, 2006 at 08:04:40PM +0100, Joachim Reichel wrote:

  How does upstream release version 3.1 of CGAL, actually fixes these
  issues?
 
 The license of some files was changed such that all files in the Kernel
 and Support Library are licensed under LGPL, the files in the Basic
 Library are licensed under QPL. In particlar, all *.C files that end up
 in libCGAL.so are licensed under LGPL.

ok. I got a different impression at first about the libCGAL.so.

After doing QPL-cleanup:
$ rm `grep -lr LICENSE.QPL .`

Build do fails. There seems to be some debug headers that the core
uses. 

Fortunately it is rather easy to fix (either fixing the license of the
debug headers or the use of the debug header with an attached patch).


-- 
Toni Timonen toni dot timonen at iki dot fi
NP Solutions Ltd
Helsinki University of Technology
Department of Engineering Physics and Mathematicsdiff -rub CGAL-3.1-orig/include/CGAL/Nef_2/Polynomial.h 
CGAL-3.1/include/CGAL/Nef_2/Polynomial.h
--- CGAL-3.1-orig/include/CGAL/Nef_2/Polynomial.h   2006-02-07 
00:21:27.0 +0200
+++ CGAL-3.1/include/CGAL/Nef_2/Polynomial.h2006-02-07 23:29:44.0 
+0200
@@ -35,7 +35,6 @@
 #include cstddef
 #undef _DEBUG
 #define _DEBUG 3
-#include CGAL/Nef_2/debug.h
 #include vector
 
 
diff -rub CGAL-3.1-orig/src/Polynomial.C CGAL-3.1/src/Polynomial.C
--- CGAL-3.1-orig/src/Polynomial.C  2006-02-07 00:21:26.0 +0200
+++ CGAL-3.1/src/Polynomial.C   2006-02-07 07:27:24.0 +0200
@@ -24,6 +24,9 @@
 
 #include CGAL/Nef_2/Polynomial.h
 
+#define CGAL_NEF_TRACEN(foo) 
+#define CGAL_NEF_TRACEV(foo)
+
 namespace CGAL{
 
 


signature.asc
Description: Digital signature


Bug#251885: ITP: cgal -- C++ library for computational geometry

2006-02-06 Thread Toni Timonen
Hi,

How does upstream release version 3.1 of CGAL, actually fixes these
issues? I don't see any changes in the license since lgpl/qpl dual
licensing.

-- 
Toni Timonen
NP-Ratkaisut Oy
Teknillinen Korkeakoulu/Teknillinen Fysiikka
040-5111863,GPG 0x7984A4FD, [EMAIL PROTECTED]
ICQ #45732842 irc://irc.npr.fi/#perunamaa


signature.asc
Description: Digital signature


Bug#38857: A patch for handling readonly keyrings in gnupg

2005-07-18 Thread Toni Timonen
Package: gnupg
Version: 1.4.1-1.1
Followup-For: Bug #38857

tags 38857 + patch
thanks

Hi,

I wrote a patch for gnupg to handle readonly keyrings correctly.
What it does now, is that when you try to modify a key in a keyring 
that is not writable it makes a copy of that keyring to a writable one
and modifies it.

Patch attached.

-- 
Toni Timonen toni dot timonen at iki dot fi
NP Solutions Ltd
Helsinki University of Technology
Department of Engineering Physics and Mathematics
diff -Nrub orig/gnupg-1.4.1/debian/patches/00list 
new/gnupg-1.4.1/debian/patches/00list
--- orig/gnupg-1.4.1/debian/patches/00list  2005-07-18 19:17:32.0 
+0300
+++ new/gnupg-1.4.1/debian/patches/00list   2005-07-18 19:53:17.0 
+0300
@@ -1,2 +1,3 @@
 15_free_caps
 16_min_privileges
+20_readonly_keyrings
diff -Nrub orig/gnupg-1.4.1/debian/patches/20_readonly_keyrings.dpatch 
new/gnupg-1.4.1/debian/patches/20_readonly_keyrings.dpatch
--- orig/gnupg-1.4.1/debian/patches/20_readonly_keyrings.dpatch 1970-01-01 
02:00:00.0 +0200
+++ new/gnupg-1.4.1/debian/patches/20_readonly_keyrings.dpatch  2005-07-18 
19:53:13.0 +0300
@@ -0,0 +1,38 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20_readonly_keyrings.dpatch by  [EMAIL PROTECTED]
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch to handle readonly keyrings (see #38857).
+
[EMAIL PROTECTED]@
+
+diff -rub orig/gnupg-1.4.1/g10/keydb.c gnupg-1.4.1/g10/keydb.c
+--- orig/gnupg-1.4.1/g10/keydb.c   2004-10-14 10:11:56.0 +0300
 gnupg-1.4.1/g10/keydb.c2005-07-18 19:34:53.0 +0300
+@@ -526,7 +526,17 @@
+ rc = G10ERR_GENERAL; /* oops */
+ break;
+   case KEYDB_RESOURCE_TYPE_KEYRING:
++  if(keyring_is_writable (hd-active[hd-found].token)) {
+ rc = keyring_update_keyblock (hd-active[hd-found].u.kr, kb);
++  } else {
++rc = keydb_locate_writable(hd,NULL);
++if (rc) {
++  log_error (_(no writable keyring found: %s\n), g10_errstr (rc));
++  break;
++}
++rc = keyring_insert_keyblock (hd-active[hd-current].u.kr, kb);
++
++  }
+ break;
+ }
+ 
+@@ -680,6 +690,8 @@
+ case KEYDB_RESOURCE_TYPE_NONE: /* ignore */
+   break;
+ case KEYDB_RESOURCE_TYPE_KEYRING:
++if(!keyring_is_writable(all_resources[i].token)) 
++  break; 
+   rc = keyring_rebuild_cache (all_resources[i].token,noisy);
+   if (rc)
+ log_error (_(failed to rebuild keyring cache: %s\n),


signature.asc
Description: Digital signature


Bug#312452: mencal: Support for default configuration file

2005-06-08 Thread Toni Timonen
Package: mencal
Version: 2.3-4
Severity: wishlist
Tags: patch upstream


Hi,

I wrote a patch for mencal to support having ~/.mencalrc read
by default if such file exists.

Patch attached.


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (50, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.9
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages mencal depends on:
ii  perl  5.8.4-8Larry Wall's Practical Extraction 

-- no debconf information

-- 
Toni Timonen toni dot timonen at iki dot fi
NP Solutions Ltd
Helsinki University of Technology
Department of Engineering Physics and Mathematics
diff -rub orig/mencal-2.3/mencal mencal-2.3/mencal
--- orig/mencal-2.3/mencal  2003-07-17 08:53:15.0 +0300
+++ mencal-2.3/mencal   2005-06-08 11:23:39.0 +0300
@@ -229,6 +229,13 @@
   );
   my @confs=();
 
+  #There exists a config file
+  $_ = $ENV{HOME}/.mencalrc;
+  if (-f $_  -r $_) {
+push(@confs,Conf-new());
+$confs[$#confs]-parsefile($_);
+  }
+
   for(my $i=0; $i=$#ARGV; $i++) {
 foreach($ARGV[$i]) {
   /^(-h|--help)$/  Main::usage;


signature.asc
Description: Digital signature


Bug#291180: pidentd: patch for the path of the pidfile

2005-01-22 Thread Toni Timonen
tags 291180 + patch sid
thanks

Hi,

the patch for correct pidfile location was in the previous version,
but was lost with the new upstream release.

It can be fetched back with:
$ zcat pidentd_3.0.16-7.diff.gz | filterdiff -i '*/pidentd.h'

That patch is also attached.


-- 
Toni Timonen toni dot timonen at iki dot fi
NP Solutions Ltd
Helsinki University of Technology
Department of Engineering Physics and Mathematics

--- pidentd-3.0.16.orig/src/pidentd.h
+++ pidentd-3.0.16/src/pidentd.h
@@ -42,7 +42,7 @@
 #endif
 
 #ifndef PATH_PIDFILE
-#define PATH_PIDFILE /etc/identd.pid
+#define PATH_PIDFILE /var/run/identd/identd.pid
 #endif
 
 #ifndef PATH_CFGFILE


signature.asc
Description: Digital signature


Bug#291636: pidentd: patch for the load issue

2005-01-22 Thread Toni Timonen
tags 291636 + sid patch security 
thanks

Hi,

I managed to fix the issue. The original one I had on other(non-SMP)
machine that some java processes doesn't authenticate correctly, and
the problems arised when hammering a port(on a SMP machine; forgot to
mention explicitly, sorry).

The fix for the actual problem was already in 3.0.16-7 (assumably
written by Herbert Xu, basing on the patch made by Paul Szabo. See
#208290 for details), but didn't apply cleanly to the new
upstream version.

I rewrote/merged few parts that had problems applying cleanly. A patch
attached.

PS. As it seems (eg. according to #291180 ) there are few parts
missing from the previous debian diff. You might consider applying
them too. So, for convenience, also a cleanly applying patch
containing those missing parts not directly related to #291636 or
#291180 is also attached.


-- 
Toni Timonen toni dot timonen at iki dot fi
NP Solutions Ltd
Helsinki University of Technology
Department of Engineering Physics and Mathematics
diff -rub us/pidentd-3.0.18/debian/changelog 
try3/pidentd-3.0.18/debian/changelog
--- us/pidentd-3.0.18/debian/changelog  2005-01-21 19:41:09.0 +0200
+++ try3/pidentd-3.0.18/debian/changelog2005-01-22 16:56:25.0 
+0200
@@ -1,3 +1,10 @@
+pidentd (3.0.18-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Reapplied the TCPDIAG support patch.
+
+ -- Toni Timonen [EMAIL PROTECTED]  Sat, 22 Jan 2005 16:56:08 +0200
+
 pidentd (3.0.18-1) unstable; urgency=low
 
   * New upstream release.
diff -rub us/pidentd-3.0.18/src/kernel.c try3/pidentd-3.0.18/src/kernel.c
--- us/pidentd-3.0.18/src/kernel.c  2004-06-13 10:47:52.0 +0300
+++ try3/pidentd-3.0.18/src/kernel.c2005-01-22 16:55:36.0 +0200
@@ -107,7 +107,7 @@
if (debug)
fprintf(stderr, ka_lookup(), attempt = %d, status = %d\n,
attempt, kp-status);
-   if (kp-status  0)
+   if (kp-status = 0)
break;
 
if (attempt  2  (attempt  1) == 1)
diff -rub us/pidentd-3.0.18/src/k_linux.c try3/pidentd-3.0.18/src/k_linux.c
--- us/pidentd-3.0.18/src/k_linux.c 2003-01-09 01:02:26.0 +0200
+++ try3/pidentd-3.0.18/src/k_linux.c   2005-01-22 16:54:45.0 +0200
@@ -17,15 +17,28 @@
 #include stdio.h
 #include syslog.h
 #include errno.h
+#include unistd.h
 
 #include sys/types.h
 #include sys/param.h
 #include sys/socket.h
 #include netinet/in.h
+#include netinet/tcp.h
 #include arpa/inet.h
 
+#include linux/types.h
+#include linux/netlink.h
+#include linux/tcp_diag.h
+
 #include pidentd.h
 
+struct kainfo
+{   
+int nlfd;
+__u32 seq;
+FILE *proc_net_tcp;
+};  
+
 /*
 ** Make sure we are running on a supported OS version
 */
@@ -39,23 +52,85 @@
 int
 ka_open(void **misc)
 {
-FILE *fp;
+struct kainfo *kp;
 
+kp = s_malloc(sizeof(*kp));
 
-while ((fp = fopen(/proc/net/tcp, r)) == NULL  errno == EINTR)
-   ;
+kp-seq = 0;
+kp-nlfd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_TCPDIAG);
+if (kp-nlfd = 0)
+goto out;
 
-if (fp == NULL)
+syslog(LOG_INFO, netlink failed, fallback to /proc/net/tcp: %m);
+kp-proc_net_tcp = fopen(/proc/net/tcp, r);
+
+if (kp-proc_net_tcp == NULL)
 {
syslog(LOG_ERR, fopen(\/proc/net/tcp\, \r\): %m);
return -1;
 }
 
-*misc = (void *) fp;
+out:
+*misc = (void *) kp;
 return 0;
 }
 
 
+static int
+netlink_lookup(struct kainfo *kip, struct kernel *kp)
+{
+int status;
+struct {
+struct nlmsghdr nlh;
+union {
+struct tcpdiagreq req;
+struct tcpdiagmsg rsp;
+} u;
+} buf;
+struct sockaddr_nl addr;
+
+memset(buf, 0, sizeof(buf));
+buf.nlh.nlmsg_len = NLMSG_ALIGN(NLMSG_LENGTH(sizeof(buf.u.req)));
+buf.nlh.nlmsg_type = TCPDIAG_GETSOCK;
+buf.nlh.nlmsg_flags = NLM_F_REQUEST;
+buf.nlh.nlmsg_seq = ++kip-seq;
+buf.u.req.tcpdiag_family = AF_INET;
+
+buf.u.req.id.tcpdiag_dport = kp-remote.sin_port;
+buf.u.req.id.tcpdiag_sport = kp-local.sin_port;
+buf.u.req.id.tcpdiag_dst[0] = kp-remote.sin_addr.s_addr;
+buf.u.req.id.tcpdiag_src[0] = kp-local.sin_addr.s_addr;
+buf.u.req.id.tcpdiag_cookie[0] = TCPDIAG_NOCOOKIE;
+buf.u.req.id.tcpdiag_cookie[1] = TCPDIAG_NOCOOKIE;
+
+status = write(kip-nlfd, buf, buf.nlh.nlmsg_len);
+if (status  0) {
+syslog(LOG_ERR, netlink_lookup: write failed: %m);
+return 3;
+}
+
+do {
+socklen_t alen = sizeof(addr);
+status = recvfrom(kip-nlfd, buf, sizeof(buf), 0,
+  (void *)addr, alen);
+if (status  0) {
+if (errno == ENOBUFS)
+return -1;
+syslog(LOG_ERR, netlink_lookup: recvfrom failed: %m);
+return 3;
+}
+} while (addr.nl_pid || buf.nlh.nlmsg_seq != kip-seq);
+
+if (buf.nlh.nlmsg_type != TCPDIAG_GETSOCK)
+return 0

Bug#291636: pidentd: New version is DoS-able and doesn't work well on load

2005-01-21 Thread Toni Timonen
Package: pidentd
Version: 3.0.18-1
Severity: important

Hi,

the new version 3.0.18-1 has some problems when ran on machines having
enough network traffic.

First symptom that caused me to start looking was that sometimes java
processes don't get authenticated correctly (very annoying when used
with tomcat4 and ident authentication of postgresql).

One way to reproduce the problem:

-Run an irc server.
-Put a torture script running:
$ while [[ 1 ]]; do nc -z -v localhost 6667; done
-Wait a while (15-30 seconds).
-Try eg. indent-authenticate to postgresql server.


Expected result (and behaviour of 3.0.16-7 in the same test):
-Some system load
-Running 7 identd processes
-Some (one or two) zombies can be seen when repeatingly 
 run 'ps -fA | grep ident'.
-ident authentication works for other processes.

Actual result:
-Heavy system load. Some identd processes are running and eating all
 available cpu even after 5 minutes of actual port-hammering.
-More than 100 identd -processes.
-And the most important: authentication stops working.





-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.27-SMP
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages pidentd depends on:
ii  adduser 3.59 Add and remove users and groups
ii  libc6   2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libssl0.9.7 0.9.7e-2 SSL shared libraries
ii  netbase 4.19 Basic TCP/IP networking system
ii  passwd  1:4.0.3-30.7 Change and administer password and

-- no debconf information

-- 
Toni Timonen toni dot timonen at iki dot fi
NP Solutions Ltd
Helsinki University of Technology
Department of Engineering Physics and Mathematics


signature.asc
Description: Digital signature