From 3c67102b2fbf9e8d8eb81186947d4dad8d3ecdf1 Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Mar 15 2013 13:33:58 +0000 Subject: import cvsps-2.2-0.12.b1.el7.src.rpm --- diff --git a/.cvsps.metadata b/.cvsps.metadata new file mode 100644 index 0000000..a1a2a64 --- /dev/null +++ b/.cvsps.metadata @@ -0,0 +1 @@ +2e2b4504151b6f795c07d01468da7aa0b4dd03fd SOURCES/cvsps-2.2b1.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/cvsps-2.2b1-bufferoverflow.patch b/SOURCES/cvsps-2.2b1-bufferoverflow.patch new file mode 100644 index 0000000..2a82cd4 --- /dev/null +++ b/SOURCES/cvsps-2.2b1-bufferoverflow.patch @@ -0,0 +1,65 @@ +--- cvsps-2.2b1/cvsps.c 2010-09-07 18:13:42.760727491 +0200 ++++ cvsps-2.2b1_/cvsps.c 2010-09-07 18:05:11.083729441 +0200 +@@ -1065,17 +1065,16 @@ static CvsFile * parse_file(const char * + { + CvsFile * retval; + char fn[PATH_MAX]; +- int len = strlen(buff + 10); ++ size_t len = strlen(buff + 10); + char * p; + + /* once a single file has been parsed ok we set this */ + static int path_ok; +- ++ + /* chop the ",v" string and the "LF" */ + len -= 3; + memcpy(fn, buff + 10, len); + fn[len] = 0; +- + if (strncmp(fn, strip_path, strip_path_len) != 0) + { + /* if the very first file fails the strip path, +@@ -1096,10 +1095,10 @@ static CvsFile * parse_file(const char * + + while ((p = strstr(p, repository_path))) + lastp = p++; +- ++ + if (lastp) + { +- int len = strlen(repository_path); ++ size_t len = strlen(repository_path); + memcpy(strip_path, fn, lastp - fn + len + 1); + strip_path_len = lastp - fn + len + 1; + strip_path[strip_path_len] = 0; +@@ -1114,16 +1113,26 @@ static CvsFile * parse_file(const char * + * + * For now just ignore such files + */ +- debug(DEBUG_APPMSG1, "WARNING: file %s doesn't match strip_path %s. ignoring", ++ debug(DEBUG_APPMSG1, "WARNING: file %s doesn't match strip_path %s. ignoring", + fn, strip_path); + return NULL; + } + + ok: +- path_ok = 1; +- ++ /* ++ fix for rhbz#576076 ++ ./cvsps --norc -q --cvs-direct -u -A --root :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot NSS ++ */ ++ if(len <= strip_path_len) ++ { ++ debug(DEBUG_APPMSG1, "WARNING: file %s doesn't match strip_path %s. ignoring", ++ fn, strip_path); ++ return NULL; ++ } + /* remove from beginning the 'strip_path' string */ + len -= strip_path_len; ++ path_ok = 1; ++ + memmove(fn, fn + strip_path_len, len); + fn[len] = 0; + diff --git a/SOURCES/cvsps-2.2b1-dynamic-logbuf.patch b/SOURCES/cvsps-2.2b1-dynamic-logbuf.patch new file mode 100644 index 0000000..03e4e76 --- /dev/null +++ b/SOURCES/cvsps-2.2b1-dynamic-logbuf.patch @@ -0,0 +1,133 @@ +# From: http://ydirson.free.fr/soft/git/cvsps.git + +commit 76a9c2aaa0d2957de0bc8f0c0b994abfd1645a50 +Author: David D. Kilzer +Date: Mon Jun 20 01:04:34 2005 +0200 + + Dynamically allocate the log buffer to prevent warning messages + + On anoncvs.opensource.apple.com (Apple's anonymous CVS server for + WebKit), some very long log entries were included in CVS. I got tired + of cvsps-2.1 truncating them, so I made the 'logbuff' buffer be + dynamically allocated. + +diff --git i/cache.c w/cache.c +index 4c51cf7..01a8ed3 100644 +--- i/cache.c ++++ w/cache.c +@@ -108,10 +108,19 @@ time_t read_cache() + int tag_flags = 0; + char branchbuff[LOG_STR_MAX] = ""; + int branch_add = 0; +- char logbuff[LOG_STR_MAX] = ""; ++ int logbufflen = LOG_STR_MAX + 1; ++ char * logbuff = malloc(logbufflen); + time_t cache_date = -1; + int read_version; + ++ if (logbuff == NULL) ++ { ++ debug(DEBUG_SYSERROR, "could not malloc %d bytes for logbuff in read_cache", logbufflen); ++ exit(1); ++ } ++ ++ logbuff[0] = 0; ++ + if (!(fp = cache_open("r"))) + goto out; + +@@ -299,8 +308,19 @@ time_t read_cache() + else + { + /* Make sure we have enough in the buffer */ +- if (strlen(logbuff)+strlen(buff)= LOG_STR_MAX) ++ { ++ logbufflen += (len >= LOG_STR_MAX ? (len+1) : LOG_STR_MAX); ++ char * newlogbuff = realloc(logbuff, logbufflen); ++ if (newlogbuff == NULL) ++ { ++ debug(DEBUG_SYSERROR, "could not realloc %d bytes for logbuff in read_cache", logbufflen); ++ exit(1); ++ } ++ logbuff = newlogbuff; ++ } ++ strcat(logbuff, buff); + } + break; + case CACHE_NEED_PS_MEMBERS: +@@ -332,6 +352,7 @@ time_t read_cache() + out_close: + fclose(fp); + out: ++ free(logbuff); + return cache_date; + } + +diff --git i/cvsps.c w/cvsps.c +index f0e7d29..db28d7c 100644 +--- i/cvsps.c ++++ w/cvsps.c +@@ -269,7 +269,8 @@ static void load_from_cvs() + PatchSetMember * psm = NULL; + char datebuff[26]; + char authbuff[AUTH_STR_MAX]; +- char logbuff[LOG_STR_MAX + 1]; ++ int logbufflen = LOG_STR_MAX + 1; ++ char * logbuff = malloc(logbufflen); + int loglen = 0; + int have_log = 0; + char cmd[BUFSIZ]; +@@ -277,6 +278,12 @@ static void load_from_cvs() + char use_rep_buff[PATH_MAX]; + char * ltype; + ++ if (logbuff == NULL) ++ { ++ debug(DEBUG_SYSERROR, "could not malloc %d bytes for logbuff in load_from_cvs", logbufflen); ++ exit(1); ++ } ++ + if (!no_rlog && !test_log_file && cvs_check_cap(CAP_HAVE_RLOG)) + { + ltype = "rlog"; +@@ -484,25 +491,22 @@ static void load_from_cvs() + */ + if (have_log || !is_revision_metadata(buff)) + { +- /* if the log buffer is full, that's it. +- * +- * Also, read lines (fgets) always have \n in them +- * (unless truncation happens) +- * which we count on. So if truncation happens, +- * be careful to put a \n on. +- * +- * Buffer has LOG_STR_MAX + 1 for room for \0 if +- * necessary +- */ +- if (loglen < LOG_STR_MAX) ++ /* If the log buffer is full, try to reallocate more. */ ++ if (loglen < logbufflen) + { + int len = strlen(buff); + +- if (len >= LOG_STR_MAX - loglen) ++ if (len >= logbufflen - loglen) + { +- debug(DEBUG_APPMSG1, "WARNING: maximum log length exceeded, truncating log"); +- len = LOG_STR_MAX - loglen; +- buff[len - 1] = '\n'; ++ debug(DEBUG_STATUS, "reallocating logbufflen to %d bytes for file %s", logbufflen, file->filename); ++ logbufflen += (len >= LOG_STR_MAX ? (len+1) : LOG_STR_MAX); ++ char * newlogbuff = realloc(logbuff, logbufflen); ++ if (newlogbuff == NULL) ++ { ++ debug(DEBUG_SYSERROR, "could not realloc %d bytes for logbuff in load_from_cvs", logbufflen); ++ exit(1); ++ } ++ logbuff = newlogbuff; + } + + debug(DEBUG_STATUS, "appending %s to log", buff); diff --git a/SOURCES/cvsps-2.2b1-man.patch b/SOURCES/cvsps-2.2b1-man.patch new file mode 100644 index 0000000..3e6816f --- /dev/null +++ b/SOURCES/cvsps-2.2b1-man.patch @@ -0,0 +1,29 @@ +diff -up cvsps-2.2b1/cvsps.1~ cvsps-2.2b1/cvsps.1 +--- cvsps-2.2b1/cvsps.1~ 2008-04-02 04:18:44.000000000 +0300 ++++ cvsps-2.2b1/cvsps.1 2010-05-18 21:10:39.000000000 +0300 +@@ -11,7 +11,7 @@ to a collection of files, and all commit + single 'cvs commit' command). This information is valuable to seeing the + big picture of the evolution of a cvs project. While cvs tracks revision + information, it is often difficult to see what changes were committed +-'atomically' to the repository. ++\'atomically' to the repository. + .SH OPTIONS + .TP + .B \-h +@@ -83,7 +83,7 @@ some hacks which are not generally appli + disable the use of rlog internally. Note: rlog is + required for stable PatchSet numbering. Use with care. + .TP +-.B \-\-diffs\-opts