rpms/minicom/devel minicom-2.3-esc.patch, NONE, 1.1 minicom-2.3-staticbuf.patch, NONE, 1.1 minicom-2.3-gotodir.patch, 1.1, 1.2 minicom.spec, 1.31, 1.32 minicom-2.2-esc.patch, 1.1, NONE minicom-2.2-staticbuf.patch, 1.1, NONE

Miroslav Lichvar mlichvar at fedoraproject.org
Fri Aug 29 11:13:07 UTC 2008


Author: mlichvar

Update of /cvs/pkgs/rpms/minicom/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31851

Modified Files:
	minicom-2.3-gotodir.patch minicom.spec 
Added Files:
	minicom-2.3-esc.patch minicom-2.3-staticbuf.patch 
Removed Files:
	minicom-2.2-esc.patch minicom-2.2-staticbuf.patch 
Log Message:
- rediff patches with fuzz


minicom-2.3-esc.patch:

--- NEW FILE minicom-2.3-esc.patch ---
diff -up minicom-2.3/src/vt100.c.esc minicom-2.3/src/vt100.c
--- minicom-2.3/src/vt100.c.esc	2007-10-10 22:18:20.000000000 +0200
+++ minicom-2.3/src/vt100.c	2008-08-29 12:53:35.000000000 +0200
@@ -1040,7 +1040,7 @@ void vt_out(int ch)
         fputc(P_CONVCAP[0] == 'Y' ? vt_inmap[c] : c, capfp);
       c = vt_inmap[c];    /* conversion 04.09.97 / jl */
 #if TRANSLATE
-      if (vt_type == VT100 && vt_asis == 0)
+      if (vt_type == VT100 && vt_trans[vt_charset] && vt_asis == 0)
 	c = vt_trans[vt_charset][c];
 #endif
       /* FIXME: This is wrong, but making it right would require

minicom-2.3-staticbuf.patch:

--- NEW FILE minicom-2.3-staticbuf.patch ---
diff -up minicom-2.3/src/updown.c.staticbuf minicom-2.3/src/updown.c
--- minicom-2.3/src/updown.c.staticbuf	2008-08-29 12:55:48.000000000 +0200
+++ minicom-2.3/src/updown.c	2008-08-29 12:55:48.000000000 +0200
@@ -91,40 +91,83 @@ static void udcatch(int dummy)
  * Translate %b to the current bps rate, and
  *           %l to the current tty port.
  *           %f to the serial port file descriptor
+ *
+ * Caller must free the returned string
  */
 static char *translate(char *s)
 {
-  static char buf[128];
-  char str_portfd[8];     /* kino */
-  int i;
+  char * ptr;
+  char * translation;
+  size_t translation_length;
+  char   str_portfd[8];     /* kino */
+
+  /* determine how many bytes we'll need for the translated version */
+  translation_length = 0;
+  for (ptr = s; *ptr != '\0'; ptr++) {
+    if (*ptr != '%') {
+      translation_length++;
+    }
+    else {
+      switch(*++ptr) {
+
+        case 'l': /* tty port */
+          translation_length += strlen(dial_tty);
+          break;
+
+        case 'b': /* baud rate (bbp) */
+          translation_length += strlen(P_BAUDRATE);
+          break;
+
+        case 'f': /* serial port file descriptor */
+          sprintf(str_portfd, "%d", portfd);
+          translation_length += strlen(str_portfd);
+          break;
+
+        default: /* treat all other escape sequences literally */
+          translation_length += 2;
+          break;
+      }
+    }
+  }
+
+  translation = malloc(translation_length + 1);
+  if (translation == NULL) {
+    do_log("out of memory");
+    return NULL;
+  }
 
-  for (i = 0; *s && i < 127; i++, s++) {
+  /* now copy and translate s into the allocated buffer */
+  for (ptr = translation; *s != '\0'; s++) {
     if (*s != '%') {
-      buf[i] = *s;
+      *ptr++ = *s;
       continue;
     }
-    switch (*++s) {
-      case 'l':
-        strncpy(buf + i, dial_tty, sizeof(buf)-i);
-        i += strlen(dial_tty) - 1;
+    switch(*++s) {
+      case 'l': /* tty port */
+        strcpy(ptr, dial_tty);
+        ptr += strlen(dial_tty);
         break;
-      case 'b':
-        strncpy(buf + i, P_BAUDRATE, sizeof(buf)-i);
-        i += strlen(P_BAUDRATE) - 1;
+
+      case 'b': /* baud rate (bbp) */
+        strcpy(ptr, P_BAUDRATE);
+        ptr += strlen(P_BAUDRATE);
         break;
-      case 'f':
+
+      case 'f': /* serial port file descriptor */
         sprintf(str_portfd, "%d", portfd);
-        strncpy(buf + i, str_portfd, sizeof(buf)-i);
-        i += strlen(str_portfd) - 1;
+        strcpy(ptr, str_portfd);
+        ptr += strlen(str_portfd);
         break;
-      default:
-        buf[i++] = '%';
-        buf[i] = *s;
+
+      default: /* treat all other escape sequences literally */
+        *ptr++ = '%';
+        *ptr++ = *s;
         break;
     }
   }
-  buf[i] = 0;
-  return buf;
+  *ptr = '\0';
+
+  return translation;
 }
 
 /*
@@ -185,7 +228,8 @@ void updown(int what, int nr)
   const char *s  ="";
   int pipefd[2];
   int n, status;
-  char cmdline[128];
+  char * cmdline = NULL;
+  char * translated_cmdline = NULL;
   WIN *win = (WIN *)NULL;
 
   if (mcd(what == 'U' ? P_UPDIR : P_DOWNDIR) < 0)
@@ -217,6 +261,7 @@ void updown(int what, int nr)
 #if 1
   {
     int multiple; /* 0:only directory, 1:one file, -1:any number */
+    size_t cmdline_length;
 
     if (P_MUL(g)=='Y')
       /* need file(s), or just a directory? */
@@ -236,7 +281,13 @@ void updown(int what, int nr)
     }
 
     /* discard directory if "multiple" == 0 */
-    snprintf(cmdline, sizeof(cmdline), "%s %s", P_PPROG(g), multiple == 0? "" : s);
+    cmdline_length = strlen(P_PPROG(g)) + strlen((char*) (multiple == 0 ? "" : s)) + 1; /* + 1 for ' ' */
+    cmdline = malloc(cmdline_length + 1); /* + 1 for NUL */
+    if (cmdline == NULL) {
+      werror(_("Out of memory: could allocate buffer for command line"));
+      return;
+    }
+    snprintf(cmdline, cmdline_length + 1, "%s %s", P_PPROG(g), multiple == 0 ? "" : s);
   }
 #endif
 
@@ -262,6 +313,8 @@ void updown(int what, int nr)
       } else
         mc_wreturn();
       mcd("");
+      if(cmdline)
+        free(cmdline);
       return;
     case 0: /* Child */
       if (P_PIORED(g) == 'Y') {
@@ -280,11 +333,21 @@ void updown(int what, int nr)
       set_privs();
       setgid((gid_t)real_gid);
       setuid((uid_t)real_uid);
-      fastexec(translate(cmdline));
+      translated_cmdline = translate(cmdline);
+      if (translated_cmdline != NULL) {
+        fastexec(translated_cmdline);
+        free(translated_cmdline);
+      }
+      if(cmdline)
+        free(cmdline);
       exit(1);
     default: /* Parent */
       break;
   }
+ 
+  if(cmdline)
+    free(cmdline);
+
   if (win) {
     setcbreak(1);         /* Cbreak, no echo. */
     enab_sig(1, 0);       /* But enable SIGINT */
@@ -388,6 +451,7 @@ void kermit(void)
   char buf[81];
   int fd;
 #endif
+  char * translated_cmdline;
 
   /* Clear screen, set keyboard modes etc. */
   mc_wleave();
@@ -408,7 +472,11 @@ void kermit(void)
       for (n = 0; n < _NSIG; n++)
         signal(n, SIG_DFL);
 
-      fastexec(translate(P_KERMIT));
+      translated_cmdline = translate(P_KERMIT);
+      if (translated_cmdline != NULL) {
+        fastexec(translated_cmdline);
+        free(translated_cmdline);
+      }
       exit(1);
     default: /* Parent */
       break;
@@ -522,6 +590,7 @@ void runscript(int ask, const char *s, c
   char buf[81];
   char scr_lines[5];
   char cmdline[128];
+  char *translated_cmdline;
   char *ptr;
   WIN *w;
   int done = 0;
@@ -627,7 +696,12 @@ void runscript(int ask, const char *s, c
       mc_setenv("LOGIN", scr_user);
       mc_setenv("PASS", scr_passwd);
       mc_setenv("TERMLIN", scr_lines);	/* jl 13.09.97 */
-      fastexec(translate(cmdline));
+      translated_cmdline = translate(cmdline);
+
+      if (translated_cmdline != NULL) {
+        fastexec(translated_cmdline);
+        free(translated_cmdline);
+      }
       exit(1);
     default: /* Parent */
       break;

minicom-2.3-gotodir.patch:

Index: minicom-2.3-gotodir.patch
===================================================================
RCS file: /cvs/pkgs/rpms/minicom/devel/minicom-2.3-gotodir.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- minicom-2.3-gotodir.patch	24 Feb 2008 20:34:38 -0000	1.1
+++ minicom-2.3-gotodir.patch	29 Aug 2008 11:13:07 -0000	1.2
@@ -1,6 +1,7 @@
---- minicom-2.2/src/file.c.gotodir	2005-08-14 22:39:30.000000000 +0200
-+++ minicom-2.2/src/file.c	2007-03-09 10:59:51.000000000 +0100
-@@ -277,6 +277,8 @@
+diff -up minicom-2.3/src/file.c.gotodir minicom-2.3/src/file.c
+--- minicom-2.3/src/file.c.gotodir	2008-08-29 12:41:21.000000000 +0200
++++ minicom-2.3/src/file.c	2008-08-29 12:41:21.000000000 +0200
+@@ -282,6 +282,8 @@ static int new_filedir(GETSDIR_ENTRY *o_
    int initial_y = (76 - (WHAT_NR_OPTIONS * WHAT_WIDTH >= 76
                     ? 74 : WHAT_NR_OPTIONS * WHAT_WIDTH)) / 2;
    size_t i;
@@ -9,7 +10,7 @@
  
    cur      =  0;
    ocur     =  0;
-@@ -290,11 +292,6 @@
+@@ -295,11 +297,6 @@ static int new_filedir(GETSDIR_ENTRY *o_
    dprev    = -1;
    tag_cnt  =  0;
  
@@ -21,7 +22,7 @@
    /*
     * get last directory
     */
-@@ -324,7 +321,30 @@
+@@ -329,7 +326,30 @@ static int new_filedir(GETSDIR_ENTRY *o_
    if (strlen(work_dir) > 1 && work_dir[strlen(work_dir) - 1] == '/')
      work_dir[strlen(work_dir) - 1] = (char)0;
  
@@ -53,8 +54,8 @@
  
    /* All right, draw the file directory! */
  
-@@ -429,7 +449,7 @@
-     wredraw(dsub, 1);
+@@ -435,7 +455,7 @@ static int new_filedir(GETSDIR_ENTRY *o_
+     mc_wredraw(dsub, 1);
    }
  
 -  return 0;


Index: minicom.spec
===================================================================
RCS file: /cvs/pkgs/rpms/minicom/devel/minicom.spec,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- minicom.spec	13 Mar 2008 04:55:27 -0000	1.31
+++ minicom.spec	29 Aug 2008 11:13:07 -0000	1.32
@@ -1,7 +1,7 @@
 Summary: A text-based modem control and terminal emulation program
 Name: minicom
 Version: 2.3
-Release: 2%{?dist}
+Release: 3%{?dist}
 URL: http://alioth.debian.org/projects/minicom/
 License: GPLv2+
 Group: Applications/Communications
@@ -19,8 +19,8 @@
 Patch6: minicom-2.2-spaces.patch
 Patch7: minicom-2.3-gotodir.patch
 Patch8: minicom-2.3-rh.patch
-Patch9: minicom-2.2-esc.patch
-Patch10: minicom-2.2-staticbuf.patch
+Patch9: minicom-2.3-esc.patch
+Patch10: minicom-2.3-staticbuf.patch
 
 %description
 Minicom is a simple text-based modem control and terminal emulation
@@ -67,6 +67,9 @@
 %{_mandir}/man1/*
 
 %changelog
+* Fri Aug 29 2008 Miroslav Lichvar <mlichvar at redhat.com> 2.3-3
+- rediff patches with fuzz
+
 * Thu Mar 13 2008 Lubomir Kundrak <lkundrak at redhat.com> 2.3-2
 - Add ChangeLog to %doc
 


--- minicom-2.2-esc.patch DELETED ---


--- minicom-2.2-staticbuf.patch DELETED ---




More information about the scm-commits mailing list