Bug#587907: slirp: Crash on amd64 when enabling file logging

2010-07-02 Thread Alexander Block
Package: slirp
Version: 1:1.0.17-3
Severity: important

On amd64 architectures, slirp crashes immediately when file logging is enabled 
with log start.
It happens at the first call to lprint after the log file is opened and ready 
for logging.
The reason is that the va_list object args is used twice in that case, once at
  lprint_ptr += (*lprint_print)(*lprint_arg, format, args);
and once at
  vfprintf(lfd, bptr2, args);

After the first call, args gets invalid because all arguments have been read 
from the va_args structure.
For some reason, this does not happen on i386 versions. Maybe a real copy of 
args is created when the 
function is called in i386.

A patch to fix the crash is attached.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages slirp depends on:
ii  libc6 2.11.2-2   Embedded GNU C Library: Shared lib

slirp recommends no packages.

slirp suggests no packages.

-- no debconf information
--- slirp-1.0.17/src/misc.c	2010-07-02 13:12:16.0 +0200
+++ slirp-1.0.17-changed/src/misc.c	2010-07-02 15:37:19.617074017 +0200
@@ -602,13 +602,17 @@
 #endif
 {
 	va_list args;
+	va_list args2;
 
 #ifdef __STDC__
 va_start(args, format);
+	va_start(args2, format);
 #else
 char *format;
 va_start(args);
+	va_start(args2);
 format = va_arg(args, char *);
+	va_arg(args2, char *); // skip
 #endif
 	/* If we're printing to an sbuf, make sure there's enough room */
 	/* XXX +100? */
@@ -651,10 +655,11 @@
 			else
 			   bptr1++;
 		}
-		vfprintf(lfd, bptr2, args);
+		vfprintf(lfd, bptr2, args2);
 		free(bptr2);
 	}
 	va_end(args);
+	va_end(args2);
 }
 
 void


Bug#511693: ITP: cnetworkmanager -- Command line interface to NetworkManager

2009-01-13 Thread Alexander Block

Package: wnpp
Severity: wishlist
Owner: Alexander Block abl...@blocksoftware.net

* Package name: cnetworkmanager
 Version : 0.8.1
 Upstream Author : Martin Vidner (mvid...@novell.com)
* URL : http://vidner.net/martin/software/cnetworkmanager/
* License : GPL
 Programming Lang: Python
 Description : Command Line Interface for NetworkManager

cnetworkmanager is a command line interface for NetworkManager that allows
you to connect to different kinds of networks from your command line.

-- System Information:
Debian Release: 5.0
 APT prefers testing
 APT policy: (500, 'testing')
Architecture: amd64 (x86_64)




--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#506968: New patch

2008-12-08 Thread Alexander Block

Hello,

attached is a working patch.

Alex
Index: debian/patches/CREDITS
===
--- debian/patches/CREDITS	(revision 11878)
+++ debian/patches/CREDITS	(working copy)
@@ -53,3 +53,7 @@
 14_hardlink_doc.diff:
   Ville Skytta [EMAIL PROTECTED]
   http://cvs.fedoraproject.org/viewcvs/rpms/ccache/F-9/ccache-2.4-hardlink-doc.patch?rev=1.1view=markup
+
+15_hash_compiler_version.diff
+  Alexander Block [EMAIL PROTECTED]
+  http://lists.samba.org/archive/ccache/2008q4/000359.html
Index: debian/patches/15_hash_compiler_version.diff
===
--- debian/patches/15_hash_compiler_version.diff	(revision 0)
+++ debian/patches/15_hash_compiler_version.diff	(revision 0)
@@ -0,0 +1,151 @@
+diff -u ccache-2.4/ccache.c ccache-2.4-changed/ccache.c
+--- ccache.c	2004-09-13 12:38:30.0 +0200
 ccache.c	2008-11-26 15:31:35.0 +0100
+@@ -27,7 +27,7 @@
+ char *cache_dir = NULL;
+ 
+ /* the directory for temporary files */
+-static char *temp_dir = NULL;
++char *temp_dir = NULL;
+ 
+ /* the debug logfile name, if set */
+ char *cache_logfile = NULL;
+@@ -132,7 +132,7 @@
+ /* return a string to be used to distinguish temporary files 
+this also tries to cope with NFS by adding the local hostname 
+ */
+-static const char *tmp_string(void)
++const char *tmp_string(void)
+ {
+ 	static char *ret;
+ 
+@@ -259,6 +259,7 @@
+ 	struct stat st;
+ 	int status;
+ 	int nlevels = 2;
++int do_hash_size_mtime = 1;
+ 	char *input_base;
+ 	char *tmp;
+ 	
+@@ -331,8 +332,16 @@
+ 		hash_string(str_basename(args-argv[0]));
+ 	}
+ 
+-	hash_int(st.st_size);
+-	hash_int(st.st_mtime);
++	/* hash gcc -dumpversion and gcc -dumpmachine */
++  	if (getenv(CCACHE_HASH_COMPILER_VERSION)) {
++		if (hash_gcc_version(args-argv) == 0)
++			do_hash_size_mtime = 0;
++  	} 
++ 
++	if (do_hash_size_mtime) {
++  		hash_int(st.st_size);
++		hash_int(st.st_mtime);
++	}   
+ 
+ 	/* possibly hash the current working directory */
+ 	if (getenv(CCACHE_HASHDIR)) {
+diff -u ccache-2.4/ccache.h ccache-2.4-changed/ccache.h
+--- ccache.h	2004-09-13 12:38:30.0 +0200
 ccache.h	2008-11-26 15:26:46.0 +0100
+@@ -73,6 +73,8 @@
+ void hash_file(const char *fname);
+ char *hash_result(void);
+ void hash_buffer(const char *s, int len);
++int hash_execute_output(char **argv);
++int hash_gcc_version(char **argv);
+ 
+ void cc_log(const char *format, ...);
+ void fatal(const char *msg);
+@@ -119,6 +121,8 @@
+ int snprintf(char *,size_t ,const char *, ...);
+ #endif
+ 
++const char *tmp_string(void);
++
+ void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize);
+ void cleanup_all(const char *dir);
+ void wipe_all(const char *dir);
+diff -u ccache-2.4/ccache.yo ccache-2.4-changed/ccache.yo
+--- ccache.yo	2004-09-13 12:38:30.0 +0200
 ccache.yo	2008-11-26 15:27:50.0 +0100
+@@ -203,6 +203,11 @@
+ strike problems with gdb not using the correct directory then enable
+ this option.
+ 
++dit(bf(CCACHE_HASH_COMPILER_VERSION)) This tells ccache to hash the 
++compiler by using the output of gcc -dumpversion and 
++gcc -dumpmachine. This method can prevent cache misses when the used 
++compiler was rebuilt but not changed.
++
+ dit(bf(CCACHE_UNIFY)) If you set the environment variable CCACHE_UNIFY
+ then ccache will use the C/C++ unifier when hashing the pre-processor
+ output if -g is not used in the compile. The unifier is slower than a
+diff -u ccache-2.4/hash.c ccache-2.4-changed/hash.c
+--- hash.c	2004-09-13 12:38:30.0 +0200
 hash.c	2008-11-26 15:26:46.0 +0100
+@@ -23,6 +23,9 @@
+ 
+ static struct mdfour md;
+ 
++/* found in ccache.c */
++extern char *temp_dir;
++
+ void hash_buffer(const char *s, int len)
+ {
+ 	mdfour_update(md, (unsigned char *)s, len);
+@@ -61,6 +64,51 @@
+ 	close(fd);
+ }
+ 
++int hash_execute_output(char **argv)
++{
++	char *tmp_stdout, *tmp_stderr;
++	char *exe_path, *exe_basename;
++	int status;
++
++	exe_path = strdup(argv[0]); // We need a copy because basename() may change the original
++	exe_basename = basename(exe_path);
++
++	// TODO: I'm not sure if the naming of the temporary files is ok this way. Please 
++	// modify it if required (or delete this TODO)
++	x_asprintf(tmp_stdout, %s/%s.stdout.%s, temp_dir, exe_basename, tmp_string());
++	x_asprintf(tmp_stderr, %s/%s.stderr.%s, temp_dir, exe_basename, tmp_string());
++
++	status = execute(argv, tmp_stdout, tmp_stderr);
++	if (status == 0) {
++		hash_file(tmp_stdout);
++		hash_file(tmp_stderr);
++	}
++	unlink(tmp_stdout);
++	unlink(tmp_stderr);
++ 
++	free(exe_path);
++	free(tmp_stdout);
++	free(tmp_stderr);
++
++	return status;
++}
++
++/* hash gcc version with gcc -dumpversion and gcc -dumpmachine */
++int hash_gcc_version(char **argv)
++{
++	char* tmp_argv[3];
++	tmp_argv[0] = argv[0];
++	tmp_argv[1] = -dumpversion;
++	tmp_argv[2] = NULL;
++	if (hash_execute_output(tmp_argv) == 0) {
++		tmp_argv[1

Bug#506968: Mistake in patch

2008-12-05 Thread Alexander Block
Well after hours of running builds with the patched ccache I discovered 
that my patch is actually not working. I will provide a fixed patch 
today or tomorrow.




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



Bug#507155: ITP: hexec -- Command line tool to hook into exec calls

2008-11-28 Thread Alexander Block
Package: wnpp
Severity: wishlist
Owner: Alexander Block [EMAIL PROTECTED]

* Package name: hexec
  Version : 0.2.0
  Upstream Author : Alexander Block [EMAIL PROTECTED]
* URL : http://sourceforge.net/projects/hexec/
* License : GPL
  Programming Lang: C
  Description : Command line tool to hook into exec calls

hexec can be used to hook into exec system calls. It evaluates
a user defined expression against all hooked exec calls. This
expression can contain simple path checks (e.g. -path */name)
and even complex bash scripts.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)



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



Bug#506917: pbuilder does not work correctly with selinux if selinux-utils is not installed

2008-11-26 Thread Alexander Block



Hmm no idea how to properly check for selinux enablement; perhaps we
 can poke something in /proc or in /selinux?

 Last resort, we could move to a grep /selinux in /proc/mounts.
/selinux is mounted with fs type 'selinuxfs', which I expect to be not 
available when selinux is disabled. Can't you try to mount it always and 
ignore if it fails?


And even if does not fail on a system without /selinux, would this be a 
problem?




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



Bug#506917: pbuilder does not work correctly with selinux if selinux-utils is not installed

2008-11-26 Thread Alexander Block

Hello Junichi,

Is 'not installing selinux-utils' an exception or the norm?  I think
it should be fixed by documenting if it's something exceptional.


regards,
junichi
  


I have a typical KDE desktop environment with like 1600 packages 
installed. And none of these packages has selinux-utils as dependency. 
The problem seems to be that selinux can be enabled (which also means 
it's required in pbuilder chroots) even if none of the selinux packages 
is installed.
If checking for the presence of /usr/sbin/selinuxenabled becomes the 
default way to check for the presence of selinux, it should maybe be 
installed always by default? I think having selinux-utils not installed 
seems to be the norm at the moment.



Alex



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



Bug#506968: ccache: Hash the output of gcc -dumpversion and gcc -dumpmachine

2008-11-26 Thread Alexander Block
Package: ccache
Version: 2.4-16
Severity: wishlist
Tags: patch

Hello,

I have already sent this feature request to [EMAIL PROTECTED] but I have
the feeling the ccache is not maintained by the original developer anymore.

Here is a link to the archived message:
http://lists.samba.org/archive/ccache/2008q4/000359.html

I have already created a patch to implement this feature. The patch is based
on the current Debian svn version and is attached. The patch adds the file
15_hash_compiler_version.diff to the debian/patches folder. Also the CREDITS
file is updated ;)

I've also made some minor fixes in debian/rules. These fixes simply add some
new xxx.unpatched files for proper patch rollback.

The patch does not include changes to the debian/changelog, as I'm not sure
if this part of work lies on my side or the maintainers side.

(Please do not use the patch from the mailing list, as it is not compatible to
the debian version. Use the attached instead.)

Best regards,
Alex

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.27.7-c1 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages ccache depends on:
ii  libc6  2.7-16GNU C Library: Shared libraries
ii  zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime

ccache recommends no packages.

Versions of packages ccache suggests:
pn  distccnone (no description available)

-- no debconf information

*** hash_compiler_version.patch
Index: debian/patches/CREDITS
===
--- debian/patches/CREDITS  (revision 11878)
+++ debian/patches/CREDITS  (working copy)
@@ -53,3 +53,7 @@
 14_hardlink_doc.diff:
   Ville Skytta [EMAIL PROTECTED]
   
http://cvs.fedoraproject.org/viewcvs/rpms/ccache/F-9/ccache-2.4-hardlink-doc.patch?rev=1.1view=markup
+
+15_hash_compiler_version.diff
+  Alexander Block [EMAIL PROTECTED]
+  http://lists.samba.org/archive/ccache/2008q4/000359.html
Index: debian/patches/15_hash_compiler_version.diff
===
--- debian/patches/15_hash_compiler_version.diff(revision 0)
+++ debian/patches/15_hash_compiler_version.diff(revision 0)
@@ -0,0 +1,151 @@
+diff -u ccache-2.4/ccache.c ccache-2.4-changed/ccache.c
+--- ccache.c   2004-09-13 12:38:30.0 +0200
 ccache.c   2008-11-26 15:31:35.0 +0100
+@@ -27,7 +27,7 @@
+ char *cache_dir = NULL;
+ 
+ /* the directory for temporary files */
+-static char *temp_dir = NULL;
++char *temp_dir = NULL;
+ 
+ /* the debug logfile name, if set */
+ char *cache_logfile = NULL;
+@@ -132,7 +132,7 @@
+ /* return a string to be used to distinguish temporary files 
+this also tries to cope with NFS by adding the local hostname 
+ */
+-static const char *tmp_string(void)
++const char *tmp_string(void)
+ {
+   static char *ret;
+ 
+@@ -259,6 +259,7 @@
+   struct stat st;
+   int status;
+   int nlevels = 2;
++int do_hash_size_mtime = 1;
+   char *input_base;
+   char *tmp;
+   
+@@ -331,8 +332,16 @@
+   hash_string(str_basename(args-argv[0]));
+   }
+ 
+-  hash_int(st.st_size);
+-  hash_int(st.st_mtime);
++  /* hash gcc -dumpversion and gcc -dumpmachine */
++  if (getenv(CCACHE_HASH_COMPILER_VERSION)) {
++  if (hash_gcc_version(args-argv) == 0)
++  do_hash_size_mtime = 0;
++  } 
++ 
++  if (do_hash_size_mtime) {
++  hash_int(st.st_size);
++  hash_int(st.st_mtime);
++  }   
+ 
+   /* possibly hash the current working directory */
+   if (getenv(CCACHE_HASHDIR)) {
+diff -u ccache-2.4/ccache.h ccache-2.4-changed/ccache.h
+--- ccache.h   2004-09-13 12:38:30.0 +0200
 ccache.h   2008-11-26 15:26:46.0 +0100
+@@ -73,6 +73,8 @@
+ void hash_file(const char *fname);
+ char *hash_result(void);
+ void hash_buffer(const char *s, int len);
++int hash_execute_output(char **argv);
++int hash_gcc_version(char **argv);
+ 
+ void cc_log(const char *format, ...);
+ void fatal(const char *msg);
+@@ -119,6 +121,8 @@
+ int snprintf(char *,size_t ,const char *, ...);
+ #endif
+ 
++const char *tmp_string(void);
++
+ void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize);
+ void cleanup_all(const char *dir);
+ void wipe_all(const char *dir);
+diff -u ccache-2.4/ccache.yo ccache-2.4-changed/ccache.yo
+--- ccache.yo  2004-09-13 12:38:30.0 +0200
 ccache.yo  2008-11-26 15:27:50.0 +0100
+@@ -203,6 +203,11 @@
+ strike problems with gdb not using the correct directory then enable
+ this option.
+ 
++dit(bf(CCACHE_HASH_COMPILER_VERSION)) This tells ccache to hash the 
++compiler by using the output of gcc -dumpversion and 
++gcc -dumpmachine. This method can prevent

Bug#506917: pbuilder does not work correctly with selinux if selinux-utils is not installed

2008-11-25 Thread Alexander Block
Package: pbuilder
Version: 0.181
Severity: normal

Hello,

While testing my self created debian package with pbuilder, I came across 
the following error message when calling sudo pbuilder build hexec_0.1.1-1.dsc

...
Extracting source
+ echo 'chown pbuilder:pbuilder /tmp/buildd /tmp/buildd/*'
+ chroot /home/ablock/work/pbuilder-cache/build//26610 /bin/bash
+ :
++ basename hexec_0.1.1-1.dsc
+ chroot /home/ablock/work/pbuilder-cache/build//26610 env LOGNAME=pbuilder su 
-p pbuilder
+ echo '( cd tmp/buildd; /usr/bin/dpkg-source -x hexec_0.1.1-1.dsc )'
Password: su: Authentication failure
+ echo 'pbuilder: Failed extracting the source'
pbuilder: Failed extracting the source
+ exit 1
+ umountproc_cleanbuildplace_trap
+ umountproc_cleanbuildplace
+ '[' 1 -ne 0 ']'
+ echo ' - Aborting with an error'
 - Aborting with an error
...

I've done some tests with sudo pbuilder login to figure out what the 
problem is. In the pbuilder shell, root had nearly no rights 
(no su, passwd, ...) and often super user programs did give selinux 
error messages (system_u:system_r:kernel_t:s0 is not authorized to XXX). 
So the problem was selinux.

/usr/lib/pbuilder/pbuilder-modules is looking for /usr/sbin/selinuxenabled
to decide if mounting /selinux is required or not. The problem is, that
/usr/sbin/selinuxenabled is only available if the package selinux-utils 
is installed. selinux-utils was not installed on my machine. When installing
selinux-utils, pbuilder works as expected.

Some suggested solutions:
- Set selinux-utils as dependency for pbuilder
- Mount /selinux always if it is present (ignoring /usr/sbin/selinuxenabled)
- Always try to mount /selinux (even ignoring the presence of /selinux on the 
real root fs)
  I'm not sure what mount will do if you try to call mount -t selinuxfs 
/selinux, but
  I would expect it to fail if the kernel has no selinux support. I'm also not 
sure
  about possible side effects.
- Add a hint to the documentation for users who encounter similar problems.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.27.7-c1 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages pbuilder depends on:
ii  coreutils 6.10-6 The GNU core utilities
ii  debconf [debconf-2.0] 1.5.24 Debian configuration management sy
ii  debianutils   2.30   Miscellaneous utilities specific t
ii  debootstrap   1.0.10 Bootstrap a basic Debian system
ii  gcc   4:4.3.2-2  The GNU C compiler
ii  wget  1.11.4-2   retrieves files from the web

Versions of packages pbuilder recommends:
ii  cowdancer 0.47   Copy-on-write directory tree utili
ii  devscripts2.10.35scripts to make the life of a Debi
ii  fakeroot  1.11   Gives a fake root environment
ii  sudo  1.6.9p17-1 Provide limited super user privile

Versions of packages pbuilder suggests:
pn  pbuilder-uml  none (no description available)

-- debconf information:
  pbuilder/mirrorsite: http://cdn.debian.net/debian
  pbuilder/nomirror:
  pbuilder/rewrite: false



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