Bug#357336: php: parse_url doesn't parse schema:///path correctly

2006-03-16 Thread Richard Levitte - VMS Whacker
Package: php
Version: 5.1.2-1
Severity: important

Hello,

I'm really trying to use libphp-adodb with a postgres database that
I'm trying to reach through the local socket file.  The logical way to
do that should be to say something like postgres:///dbname.  That's at
least what I can determine when I read the libphp-adodb source.

Unfortunately, doing something like that results in this bug in the
browser:

Warning: parse_url(postgres:///webhost-db) [function.parse-url]:
Unable to parse url in /usr/share/php/adodb/adodb.inc.php on line 3659

Looking at that line, I saw a call to parse_url, so I tried it out:

  : ; php -r 'print_r(parse_url("postgres://foo/bar"));'
  Array
  (
  [scheme] => postgres
  [host] => foo
  [path] => /bar
  )
  
  : ; php -r 'print_r(parse_url("postgres://:/bar"));'
  
  Warning: parse_url(postgres://:/bar): Unable to parse url in Command line 
code on line 1

That says it all, hostless URLs, while being perfectly legal
(file:///path is very common, for example), aren't possible with
parse_url, and that makes it useless for the kind of thing I want to
do.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=sv_SE.utf8, LC_CTYPE=sv_SE.utf8 (charmap=UTF-8)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#367356: ctwm: Remove readme.vms

2006-05-15 Thread Richard Levitte - VMS Whacker
Package: ctwm
Version: 3.7-2.1
Severity: normal


Hi,

I just took a look at the source of this package, and noticed you
reinserted readme.vms.  That file is deprecated in favor of README.VMS,
and the existence of both might lead to confusion.  Please remove
readme.vms from the package, please.

/Richard Levitte (ctwm maintainer)

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-1-686
Locale: LANG=sv_SE.utf8, LC_CTYPE=sv_SE.utf8 (charmap=UTF-8)

Versions of packages ctwm depends on:
ii  libc62.3.6-7 GNU C Library: Shared libraries
ii  libice6  1:1.0.0-3   X11 Inter-Client Exchange library
ii  libjpeg626b-13   The Independent JPEG Group's JPEG 
ii  librplay33.3.2-10Shared libraries for the rplay net
ii  libsm6   1:1.0.0-4   X11 Session Management library
ii  libx11-6 2:1.0.0-6   X11 client-side library
ii  libxext6 1:1.0.0-4   X11 miscellaneous extension librar
ii  libxmu6  1:1.0.1-3   X11 miscellaneous utility library
ii  libxpm4  1:3.5.4.2-3 X11 pixmap library
ii  libxt6   1:1.0.0-4   X11 toolkit intrinsics library
ii  m4   1.4.4-1 a macro processing language
ii  x11-common   1:7.0.10X Window System (X.Org) infrastruc

ctwm recommends no packages.

-- debconf-show failed


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#367968: make greylistd work with courier and courier-perl-filter

2006-05-18 Thread Richard Levitte - VMS Whacker
Package: greylistd
Version: 0.8.3
Severity: wishlist
Tags: patch


Hi,

I took a look at greylistd and decided I wanted to use it with courier
and courier-filter-perl, and ended up hacking the package.  The
attached diff is all the changes I did, and am sending to you in hope
it might be integrated in the package.

I've already tried to mail this to the maintainer directly, but had no
response.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-1-686
Locale: LANG=sv_SE.utf8, LC_CTYPE=sv_SE.utf8 (charmap=UTF-8)

# 
# old_revision [9853692c7b7bdfb92e816f1c5255b67ac7dfc300]
# 
# add_file "program/Greylist.pm"
#  content [fdcc2b84a39699e6b7260d3c38d771d82a857d49]
# 
# add_file "program/greylistd-setup-courierfilter"
#  content [43ede48a12fc0affb52ccc316820614d17c8f716]
# 
# patch "debian/README.Debian"
#  from [ccf9f89d3520e0238cf0eb937da5b6fdc17ecfd1]
#to [9f1dba93d4cc5c6d8f48e70391c7cb0d29b05d4d]
# 
# patch "debian/changelog"
#  from [94317e037f125350774d100abbd1f669e0f9bcbd]
#to [61bd2a67b8f0cea8714dc2b815794e14d6a5dce9]
# 
# patch "debian/config"
#  from [79136866c2ca0e4c6c8561d1c26d656be839a4d6]
#to [fb3caf11055fcc59fb9e165a9aec527bbdb26197]
# 
# patch "debian/control"
#  from [0a6d46857bebe49811917d25cfa592a4acffa8da]
#to [d3744fbfc25db0e8babbdf3f2fbbbd84b1bc5767]
# 
# patch "debian/install"
#  from [0abbd01d375d1bd38fa78a77e07d531717c3538e]
#to [ba1264e8efe0f1964ae49dc860224091ad7c330d]
# 
# patch "debian/postinst"
#  from [27b15c235e7c16a0f117ceb46982a6704b6271c3]
#to [e4a9be022f6d00af2e158f310495a5d986dc184a]
# 
# patch "debian/templates"
#  from [f8317a4490fb460bfb7542322472ff888eb2279a]
#to [d7d82aea11bc1adc629608cc8c1aba7d9db03b49]
# 
#   set "program/greylistd-setup-courierfilter"
#  attr "mtn:execute"
# value "true"
# 

--- program/Greylist.pm fdcc2b84a39699e6b7260d3c38d771d82a857d49
+++ program/Greylist.pm fdcc2b84a39699e6b7260d3c38d771d82a857d49
@@ -0,0 +1,88 @@
+package Courier::Filter::Module::Greylist;
+use base qw(Courier::Filter::Module);
+use Socket;
+
+sub new {
+my ($class, %options) = @_;
+my $conffile = "/etc/greylistd/config";
+my %config = ();
+
+if (-f $conffile) {
+   if (open(GREYCONF,$conffile)) {
+   my $section = "DEFAULT";
+   my $linecnt = 0;
+   while() {
+   $linecnt++;
+   chomp;
+   print STDERR "DEBUG: {$key} = $value\n"
+   if $options{debugging};
+   $config{$section}->{$key} = $value;
+   } else {
+   die "Syntax error in configuration file 
$conffile:\n\"$_\"\n";
+   }
+   }
+   close(GREYCONF);
+   } else {
+   die "Reading configuration file $conffile: $!\n";
+   }
+}
+
+my $sockfile = $config{socket}->{path};
+$sockfile = "/var/run/greylistd/socket" if (!defined $sockfile);
+
+my $module = $class->SUPER::new( %options,
+grey_sock_file => $sockfile );
+return $module;
+}
+
+my %exits = ( "grey"   =>  [ "4.7.1 Temporarily rejected", 451 ],
+ "black"   =>  [ "5.7.1 Rejected", 550 ] );
+
+sub match {
+my ($module, $message) = @_;
+
+socket(GREYSOCK, PF_UNIX, SOCK_STREAM, 0)
+   || die "socket: $!\n";
+connect(GREYSOCK, sockaddr_un($module->{grey_sock_file}))
+   || die "connect to " . $module->{grey_sock_file} . ": $!\n";
+
+my $addr = $message->remote_host;
+#if (defined $module->{netmask}) {
+#  my $netmask = $module->{netmask};
+#  $netmask = 0 if $netmask < 0;
+#  $netmask = 32 if $module->{netmask} > 32;
+
+#  my $shift = 32 - $module->{netmask};
+#  $addr = inet_ntoa((inet_aton($addr) >> $shift) << $shift);
+
+#  print STDERR "DEBUG: address: ",$message->remote_host," -> ",$addr,"\n";
+#}
+
+my $mess = "update "
+   .$addr." "
+   .$message->sender." "
+   .$message->recipients;
+send GREYSOCK,$mess,0;
+print STDERR "DEBUG: >$mess\n" if $module->{debugging};
+my $reply = "";
+recv GREYSOCK,$reply,1024,0;
+print STDERR "DEBUG: <$reply\n" if $module->{debugging};
+
+close(GREYSOCK);
+
+$firstword = (split(/\s+/,$reply))[0];
+$retval = $exits{$firstword};
+return @$retval if (defined $retval);
+return undef;
+}

--- program/greylistd-setup-courierfilter   
43ede48a12fc0affb52ccc316820614d17c8f716
+++ program/greylistd-setup-courierfilter   
43ede48a12fc0affb52ccc316820614d17c8f716
@@ -0,0 +1,156 @@
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+use File::Basename;
+
+my $default_pureperlfilterconf = "/etc/courier/filters/pureperlfilter.conf";
+
+sub usage {
+my $progname = shift @_;
+my $mes

Bug#318833: libpopt-dev: Incorrect handling of leftovers together with poptStuffArgs (buffer overrun and memory leak)

2005-07-18 Thread Richard Levitte - VMS Whacker
Package: libpopt-dev
Version: 1.7-5
Severity: important
Tags: patch

Hi,

it seems like poptStuffArgs() hasn't been tested very thoroughly.  If
used twice with the same context, it will invariably cause memory
corruption and possibly memory leaks or a crash.

The proper fix is to change the allocation of leftOvers so it adapts
to the input on the fly instead of trying to pre-allocate it in one
go.

Patch attached.

Cheers,
Richard

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-1-686
Locale: LANG=sv_SE, LC_CTYPE=sv_SE (charmap=ISO-8859-1)

Versions of packages libpopt-dev depends on:
ii  libc6-dev [libc-dev]2.3.2.ds1-22 GNU C Library: Development Librari
ii  libpopt01.7-5lib for parsing cmdline parameters

libpopt-dev recommends no packages.

-- no debconf information
--- popt.c
+++ popt.c
@@ -168,7 +168,8 @@
 if (!(flags & POPT_CONTEXT_KEEP_FIRST))
con->os->next = 1;  /* skip argv[0] */
 
-con->leftovers = calloc( (argc + 1), sizeof(*con->leftovers) );
+con->allocLeftovers = argc + 1;
+con->leftovers = calloc( con->allocLeftovers, sizeof(*con->leftovers) );
 /[EMAIL PROTECTED] [EMAIL PROTECTED]/  /* FIX: W2DO? */
 con->options = options;
 /[EMAIL PROTECTED] [EMAIL PROTECTED]/
@@ -742,7 +743,19 @@
return 0;
}
if (con->leftovers != NULL) /* XXX can't happen */
-   con->leftovers[con->numLeftovers++] = origOptString;
+   /* One might think we can never overflow the leftovers
+  array.  Actually, that's true, as long as you don't
+  use poptStuffArgs()... */
+   if ((con->numLeftovers + 1) >= (con->allocLeftovers)) {
+   con->allocLeftovers += 10;
+   con->leftovers =
+   realloc(con->leftovers,
+   sizeof(*con->leftovers) * 
con->allocLeftovers);
+   }
+   con->leftovers[con->numLeftovers++]
+   = xstrdup(origOptString); /* so a free of a stuffed
+argv doesn't give us a
+dangling pointer */
continue;
}
 
@@ -1076,7 +1089,11 @@
 }
 con->execs = _free(con->execs);
 
+for (i = 0; i < con->numLeftovers; i++) {
+   con->leftovers[i] = _free(&con->leftovers[i]);
+}
 con->leftovers = _free(con->leftovers);
+
 con->finalArgv = _free(con->finalArgv);
 con->appName = _free(con->appName);
 con->otherHelp = _free(con->otherHelp);
--- poptint.h
+++ poptint.h
@@ -65,6 +65,7 @@
 /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/
 const char ** leftovers;
 int numLeftovers;
+int allocLeftovers;
 int nextLeftover;
 /[EMAIL PROTECTED]@*/
 const struct poptOption * options;


Bug#388543: backupninja: dup backend does not work properly

2006-09-20 Thread Richard Levitte - VMS Whacker
Package: backupninja
Severity: important
Tags: patch

Hello,

the dup backend fails to give duplicity an sftp command.  If you use a 
separate identity file, duplicity will therefore fail, since it uses 
sftp as part of its ssh/scp backend.

The included patch adds the possibility to give sftpoptions in the dup 
configuration file.


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-2-686
Locale: LANG=sv_SE.utf8, LC_CTYPE=sv_SE.utf8 (charmap=UTF-8)

--- examples/example.dupae500c0f943b4baf0dbce5d46feab55740945d9c
+++ examples/example.dup8ffd6bfe6bd687619b1eb11d8623dacda72f7520
@@ -108,6 +108,9 @@ sshoptions = -i /root/.ssh/id_dsa_duplic
 # passed directly to ssh and scp
 sshoptions = -i /root/.ssh/id_dsa_duplicity
 
+# passed directly to sftp
+sftpoptions = -o IdentityFile=/root/.ssh/id_dsa_duplicity
+
 # put the backups under this directory
 destdir = /backups
 

--- handlers/dup0dcb23b46d7b6057700fcd136fd774c447718c94
+++ handlers/dup4349efd020d03bf277427b22fbe78fc4d7555be2
@@ -24,6 +24,7 @@ getconf sshoptions
 getconf incremental yes
 getconf keep 60
 getconf sshoptions
+getconf sftpoptions
 getconf bandwidthlimit 0
 getconf desthost
 getconf destdir
@@ -72,7 +73,7 @@ scpoptions="$sshoptions"
 scpoptions="$sshoptions"
 [ "$bandwidthlimit" == 0 ] || scpoptions="$scpoptions -l $bandwidthlimit"
 
-execstr="$options --no-print-statistics --scp-command 'scp $scpoptions' 
--ssh-command 'ssh $sshoptions' "
+execstr="$options --no-print-statistics --scp-command 'scp $scpoptions' 
--ssh-command 'ssh $sshoptions' --sftp-command 'sftp $sftpoptions' "
 
 # deal with symmetric or asymmetric (public/private key pair) encryption
 if [ -n "$encryptkey" ]; then


Bug#388543: backupninja: dup backend does not work properly

2006-09-25 Thread Richard Levitte - VMS Whacker
micah> Thanks for the bug report, and the patch. I think that this is a problem
micah> with duplicity 0.4.2 and newer. I believe that this has already been
micah> fixed in the upstream svn trunk[1]. Please have a look at the latest
micah> version[2] and try it out to see if it does solve this problem.

The upstreams version does NOT solve the problem.  sftp does not take
the same options as ssh (for example `-i key', which is my original
problem), and the version of the dup handler that you pointed at
assumes it does (it simply makes $sftpoptions a copy of $sshoptions if
duplicity is version 0.4.2 or higher).  As far as I understand, that's
the main reason why duplicity has a specific option to specify sftp
options to use.

(this means that we can blame sftp as well :-))

So I'm sorry, I'm not satisfied with the upstream "fix".

Cheers,
Richard


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#388543: backupninja: dup backend does not work properly

2006-09-27 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Wed, 27 Sep 2006 08:59:45 +0200, intrigeri 
<[EMAIL PROTECTED]> said:

intrigeri> I tend to think I'm simply going to keep the current code, and 
clearly
intrigeri> state (in the example.dup file and in NEWS.Debian) that the 
sshoptions
intrigeri> option has to be fed in a scp *and* sftp-compatible way, using the
intrigeri> "-o" workaround for example.

That's acceptable.

Thanks for your time.

Cheers,
Richard

-- 
Richard Levitte [EMAIL PROTECTED]
http://richard.levitte.org/

"When I became a man I put away childish things, including
 the fear of childishness and the desire to be very grown up."
-- C.S. Lewis


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#410795: minimalist leaves 'From ' lines when such are present

2007-02-13 Thread Richard Levitte - VMS Whacker
Package: minimalist
Version: 2.5.3-2
Severity: normal
Tags: patch

minimalist fails to remove the 'From ' line on incoming messages, then 
adds headers on top of that line.  The result is that some MTAs, upon 
seeing the 'From ' line, decide that this is where the message body 
starts, and thereby ignore the rest of the headers entirely.  Thus has 
serious implications, since the clients will therefor not see the From:, 
To: and Cc: headers, and will display incorrect information, reply to 
incorrect senders and so on.

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=sv_SE.utf8, LC_CTYPE=sv_SE.utf8 (charmap=UTF-8)

Versions of packages minimalist depends on:
ii  perl [perl5]  5.8.8-7Larry Wall's Practical Extraction 

minimalist recommends no packages.

-- no debconf information
# 
# old_revision [f6ff0c7deb14d672c9b93d788369969e42742d06]
# 
# patch "debian/changelog"
#  from [5cdab6b3d68c94fa579704d0e92cefb5ba9db533]
#to [9bc723cbc7acbb937bc76ab5daac13d8498c53f3]
# 
# patch "minimalist.pl"
#  from [19a87284c5879e886b971359a43b1b5c199ee708]
#to [f165a7b7c5c05690e4eb0c70454f28ef51d7b281]
# 

--- debian/changelog5cdab6b3d68c94fa579704d0e92cefb5ba9db533
+++ debian/changelog9bc723cbc7acbb937bc76ab5daac13d8498c53f3
@@ -1,3 +1,9 @@
+minimalist (2.5.3-2+RL20070213) unstable; urgency=low
+
+  * Change minimalist.pl to remove 'From ' lines unconditionally.
+
+ -- Richard Levitte <[EMAIL PROTECTED]>  Tue, 13 Feb 2007 12:59:59 +0100
+
 minimalist (2.5.3-2) unstable; urgency=low
 
   * Use nobody:nogroup for /var/spool/minimalist again.

--- minimalist.pl   19a87284c5879e886b971359a43b1b5c199ee708
+++ minimalist.pl   f165a7b7c5c05690e4eb0c70454f28ef51d7b281
@@ -598,6 +598,9 @@ _EOF_
chomp ($header);
$header .= "\nPrecedence: list\n";  # For vacation and similar 
programs
 
+   # Remove original From_ line unconditionally
+   $header =~ s/^From .*\n//i;
+
# Remove original Reply-To unconditionally, set configured one if it is
$header =~ s/(^|\n)reply-to:\s+.*\n([ \t]+.*\n)*/$1/ig;
if ($reply_to_list eq 'yes') { $header .= "Reply-To: $to_gecos <[EMAIL 
PROTECTED]>\n"; }