Your message dated Sun, 14 Oct 2012 22:49:27 +0300
with message-id <[email protected]>
and subject line Bug#310806 Close bts:debian
has caused the Debian Bug report #310806,
regarding afio: enhanced "pipe device" command line patch
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
310806: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=310806
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: afio
Version: 2.5-3-kissg-1
Severity: wishlist
Tags: patch

This patch allows variables in '!' prefixed device (i.e. pipe) names.
- %V will be replaced with current volume number
- %S will be replaced with volume size (in bytes)
- %% stands for % itself

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (101, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.11.10
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages afio depends on:
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an

-- no debconf information
diff -urw afio-2.5-orig/afio.c afio-2.5/afio.c
--- afio-2.5-orig/afio.c	2003-12-20 23:16:13.000000000 +0100
+++ afio-2.5/afio.c	2005-01-04 15:08:56.000000000 +0100
@@ -261,6 +261,7 @@
      STATIC char *arname;	/* Expanded archive name */
      STATIC uint arpad;		/* Final archive block padding boundary */
      STATIC char arspec[PATHSIZE];	/* Specified archive name */
+     STATIC char command_line[PATHSIZE];/* Subprocess command line */
      STATIC ulonglong aruntil;	/* Volume size limit */
      STATIC int roundaruntil=1; /* Round aruntil to multiple of arbsize? */
      STATIC ulonglong maxsizetocompress=200L*1024L*1024L; /* ==0, then no max */
@@ -4166,6 +4167,51 @@
   return (ifd);
 }
 
+STATIC char *
+prepare_command_line (template)
+char *template;
+{
+	int remain, len;
+	char *sptr, *dptr;
+
+	sptr=template;
+	dptr=command_line;
+	remain = sizeof(command_line);
+
+	for (sptr=template,
+			dptr=command_line,
+			remain=sizeof(command_line); remain>=0; sptr++) {
+		*dptr = '\0';
+		if (*sptr == '%') {
+			switch (*++sptr) {
+			case '%':		/* the % char itself */
+				*dptr++ = '%';
+				remain--;
+				break;
+			case 'V':		/* volume number */
+				if (remain < 10) break;	/* length of 2^32 */
+				len = sprintf(dptr,"%lu", arvolume);
+				dptr += len;
+				remain -= len;
+				break;
+			case 'S':		/* volume size */
+				if (remain < 20) break;	/* length of 2^64 */
+				len = sprintf(dptr,"%llu", aruntil);
+				dptr += len;
+				remain -= len;
+				break;
+			}
+		}
+		else {
+			*dptr++ = *sptr;
+			remain--;
+		}
+		if (*sptr == '\0') break;
+	}
+
+	return command_line;
+}
+
 /*
  * pipechld()
  *
@@ -4185,7 +4231,8 @@
   else
     *av++ = "/bin/sh";
   *av++ = "-c";
-  *av++ = arname + 1;
+  prepare_command_line(arname + 1);
+  *av++ = command_line;
   *av = NULL;
   if (mode)
     {
diff -urw afio-2.5-orig/afio.h afio-2.5/afio.h
--- afio-2.5-orig/afio.h	2003-12-20 14:59:42.000000000 +0100
+++ afio-2.5/afio.h	2005-01-04 15:11:05.000000000 +0100
@@ -472,6 +472,7 @@
 int pipechld (int, int *);
 int pipeopen (int );
 void pipewait (void);
+char *prepare_command_line (char *);
 void prsize (FILE *, ulonglong);
 VOIDFN readcheck (char **);
 #ifndef MKDIR

--- End Message ---
--- Begin Message ---
Package: afio
Version: 2.5.1.20120925+git822904b-1

Reason for close:
PAtch included in latest release

--- End Message ---

Reply via email to