SOURCES: cvs-debian-64bit-crash.patch (NEW), cvs-debian-check-meth...

arekm arekm at pld-linux.org
Tue Nov 6 08:40:37 CET 2007


Author: arekm                        Date: Tue Nov  6 07:40:36 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- patches from debian

---- Files affected:
SOURCES:
   cvs-debian-64bit-crash.patch (NONE -> 1.1)  (NEW), cvs-debian-check-method-crash.patch (NONE -> 1.1)  (NEW), cvs-debian-cvsbug.patch (NONE -> 1.1)  (NEW), cvs-debian-cvspass.patch (NONE -> 1.1)  (NEW), cvs-debian-cvsrc.patch (NONE -> 1.1)  (NEW), cvs-debian-date-format.patch (NONE -> 1.1)  (NEW), cvs-debian-dsa-ext-pwd.patch (NONE -> 1.1)  (NEW), cvs-debian-ext-exp.patch (NONE -> 1.1)  (NEW), cvs-debian-extra-tags.patch (NONE -> 1.1)  (NEW), cvs-debian-flag-conflicted-copies.patch (NONE -> 1.1)  (NEW), cvs-debian-homedir.patch (NONE -> 1.1)  (NEW), cvs-debian-import-n-X.patch (NONE -> 1.1)  (NEW), cvs-debian-info.patch (NONE -> 1.1)  (NEW), cvs-debian-keyword-alnum.patch (NONE -> 1.1)  (NEW), cvs-debian-l-opt.patch (NONE -> 1.1)  (NEW), cvs-debian-newlines-commit-template.patch (NONE -> 1.1)  (NEW), cvs-debian-normalize-roots.patch (NONE -> 1.1)  (NEW), cvs-debian-pam.patch (NONE -> 1.1)  (NEW), cvs-debian-parseopts.patch (NONE -> 1.1)  (NEW), cvs-debian-perms.patch (NONE 
 -> 1.1)  (NEW), cvs-debian-rcs2log-sort.patch (NONE -> 1.1)  (NEW), cvs-debian-repouid.patch (NONE -> 1.1)  (NEW), cvs-debian-rsc2log.patch (NONE -> 1.1)  (NEW), cvs-debian-R-warning.patch (NONE -> 1.1)  (NEW), cvs-debian-server-wrapper.patch (NONE -> 1.1)  (NEW), cvs-debian-sparc.patch (NONE -> 1.1)  (NEW), cvs-debian-zlib-read-compressed.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/cvs-debian-64bit-crash.patch
diff -u /dev/null SOURCES/cvs-debian-64bit-crash.patch:1.1
--- /dev/null	Tue Nov  6 08:40:36 2007
+++ SOURCES/cvs-debian-64bit-crash.patch	Tue Nov  6 08:40:29 2007
@@ -0,0 +1,18 @@
+--- cvs-1.12.13.orig/debian/patches/66_64bit_crashfix
++++ cvs-1.12.13/debian/patches/66_64bit_crashfix
+@@ -0,0 +1,15 @@
++# Fix a 64-bit crash in the entries_time() function and another bug in
++# the diff code. Thanks to Gabor Gombas for the patch. Closes:
++# #329127.
++diff -ruN cvs-1.12.13-old/diff/util.c cvs-1.12.13/diff/util.c
++--- cvs-1.12.13-old/diff/util.c	2003-02-03 03:52:38.000000000 +0800
+++++ cvs-1.12.13/diff/util.c	2006-02-26 21:32:22.000000000 +0800
++@@ -235,7 +235,7 @@
++ 	      close (pipes[0]);
++ 	    }
++ 
++-	  execl (PR_PROGRAM, PR_PROGRAM, "-f", "-h", name, 0);
+++	  execl (PR_PROGRAM, PR_PROGRAM, "-f", "-h", name, NULL);
++ 	  pfatal_with_name (PR_PROGRAM);
++ 	}
++       else

================================================================
Index: SOURCES/cvs-debian-check-method-crash.patch
diff -u /dev/null SOURCES/cvs-debian-check-method-crash.patch:1.1
--- /dev/null	Tue Nov  6 08:40:37 2007
+++ SOURCES/cvs-debian-check-method-crash.patch	Tue Nov  6 08:40:29 2007
@@ -0,0 +1,24 @@
+--- cvs-1.12.13.orig/debian/patches/11_check_method_crash
++++ cvs-1.12.13/debian/patches/11_check_method_crash
+@@ -0,0 +1,21 @@
++#
++# Do a basic sanity check on the method in the CVSROOT - don't crash
++# if one is not specified! Bug#274020
++#
++# Patch from Steve McIntyre <steve at einval.com>
++diff -ruN cvs-1.12.13-old/src/root.c cvs-1.12.13/src/root.c
++--- cvs-1.12.13-old/src/root.c	2005-09-25 08:38:29.000000000 +0800
+++++ cvs-1.12.13/src/root.c	2006-02-26 17:48:32.000000000 +0800
++@@ -535,6 +535,12 @@
++ 	    method = "";
++ #endif /* defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT) */
++ 
+++    if (NULL == method)
+++	{
+++	    error (0, 0, "Missing method in CVSROOT.");
+++	    goto error_exit;
+++	}
+++
++ 	/* Now we have an access method -- see if it's valid. */
++ 
++ 	if (!strcasecmp (method, "local"))

================================================================
Index: SOURCES/cvs-debian-cvsbug.patch
diff -u /dev/null SOURCES/cvs-debian-cvsbug.patch:1.1
--- /dev/null	Tue Nov  6 08:40:37 2007
+++ SOURCES/cvs-debian-cvsbug.patch	Tue Nov  6 08:40:30 2007
@@ -0,0 +1,25 @@
+--- cvs-1.12.13.orig/debian/patches/71_cvsbug_tmpfix
++++ cvs-1.12.13/debian/patches/71_cvsbug_tmpfix
+@@ -0,0 +1,22 @@
++# Patch for a tmp race in cvsbug (in the source package; we don't ship
++# the script as part of the package). Closes: #325106
++diff -ruN cvs-1.12.13-old/src/cvsbug.in cvs-1.12.13/src/cvsbug.in
++--- cvs-1.12.13-old/src/cvsbug.in	2003-02-26 05:31:33.000000000 +0800
+++++ cvs-1.12.13/src/cvsbug.in	2006-02-26 22:07:08.000000000 +0800
++@@ -109,14 +109,14 @@
++     /usr/bin/ypcat passwd 2>/dev/null | cat - /etc/passwd | grep "^$LOGNAME:" |
++       cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
++     ORIGINATOR="`cat $TEMP`"
++-    rm -f $TEMP
+++    > $TEMP
++   fi
++ fi
++ 
++ if [ "$ORIGINATOR" = "" ]; then
++   grep "^$LOGNAME:" /etc/passwd | cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
++   ORIGINATOR="`cat $TEMP`"
++-  rm -f $TEMP
+++  > $TEMP
++ fi
++ 
++ if [ -n "$ORGANIZATION" ]; then

================================================================
Index: SOURCES/cvs-debian-cvspass.patch
diff -u /dev/null SOURCES/cvs-debian-cvspass.patch:1.1
--- /dev/null	Tue Nov  6 08:40:37 2007
+++ SOURCES/cvs-debian-cvspass.patch	Tue Nov  6 08:40:30 2007
@@ -0,0 +1,22 @@
+--- cvs-1.12.13.orig/debian/patches/65_login_cvspass_message
++++ cvs-1.12.13/debian/patches/65_login_cvspass_message
+@@ -0,0 +1,19 @@
++# Print a clearer message if ~/.cvspass does not exist when cvs login is
++#  called. Closes: #168163.
++#
++# Patch by Steve McIntyre <steve at einval.com>
++diff -ruN cvs-1.12.13-old/src/login.c cvs-1.12.13/src/login.c
++--- cvs-1.12.13-old/src/login.c	2005-05-14 05:47:28.000000000 +0800
+++++ cvs-1.12.13/src/login.c	2006-02-26 21:31:17.000000000 +0800
++@@ -309,7 +309,10 @@
++     fp = CVS_FOPEN (passfile, "r");
++     if (fp == NULL)
++     {
++-	error (0, errno, "warning: failed to open %s for reading", passfile);
+++    if (errno == ENOENT)
+++        error (0, 0, "CVS password file %s does not exist - creating a new file", passfile);
+++    else
+++        error (0, errno, "warning: failed to open %s for reading", passfile);
++ 	goto process;
++     }
++ 

================================================================
Index: SOURCES/cvs-debian-cvsrc.patch
diff -u /dev/null SOURCES/cvs-debian-cvsrc.patch:1.1
--- /dev/null	Tue Nov  6 08:40:37 2007
+++ SOURCES/cvs-debian-cvsrc.patch	Tue Nov  6 08:40:30 2007
@@ -0,0 +1,40 @@
+--- cvs-1.12.13.orig/debian/patches/62_cvsrc_whitespace
++++ cvs-1.12.13/debian/patches/62_cvsrc_whitespace
+@@ -0,0 +1,37 @@
++# Ignore leading whitespace in .cvsrc files. Closes: #212415. Thanks
++# to James R. Van Zandt for the patch.
++diff -ruN cvs-1.12.13-old/src/cvsrc.c cvs-1.12.13/src/cvsrc.c
++--- cvs-1.12.13-old/src/cvsrc.c	2005-03-16 23:52:14.000000000 +0800
+++++ cvs-1.12.13/src/cvsrc.c	2006-02-26 18:25:18.000000000 +0800
++@@ -41,6 +41,7 @@
++     size_t line_chars_allocated;
++ 
++     char *optstart;
+++    int white_len;
++ 
++     int command_len;
++     int found = 0;
++@@ -96,9 +97,12 @@
++ 	if (line[0] == '#')
++ 	    continue;
++ 
+++    for (white_len=0; isspace(line[white_len]); white_len++)
+++        ;
+++
++ 	/* stop if we match the current command */
++-	if (!strncmp (line, cmdname, command_len)
++-	    && isspace ((unsigned char) *(line + command_len)))
+++	if (!strncmp (line + white_len, cmdname, command_len)
+++	    && isspace ((unsigned char) *(line + white_len + command_len)))
++ 	{
++ 	    found = 1;
++ 	    break;
++@@ -120,7 +124,7 @@
++     if (found)
++     {
++ 	/* skip over command in the options line */
++-	for (optstart = strtok (line + command_len, "\t \n");
+++	for (optstart = strtok (line + white_len + command_len, "\t \n");
++ 	     optstart;
++ 	     optstart = strtok (NULL, "\t \n"))
++ 	{

================================================================
Index: SOURCES/cvs-debian-date-format.patch
diff -u /dev/null SOURCES/cvs-debian-date-format.patch:1.1
--- /dev/null	Tue Nov  6 08:40:37 2007
+++ SOURCES/cvs-debian-date-format.patch	Tue Nov  6 08:40:30 2007
@@ -0,0 +1,154 @@
+--- cvs-1.12.13.orig/debian/patches/67_date_format_option
++++ cvs-1.12.13/debian/patches/67_date_format_option
+@@ -0,0 +1,151 @@
++#
++# Add an extra option to set the DateFormat used in log output.
++#
++# Patch by Steve McIntyre <steve at einval.com>
++diff -ruN cvs-1.12.13-old/doc/cvs.texinfo cvs-1.12.13/doc/cvs.texinfo
++--- cvs-1.12.13-old/doc/cvs.texinfo	2005-09-23 10:02:53.000000000 +0800
+++++ cvs-1.12.13/doc/cvs.texinfo	2006-02-26 23:03:05.000000000 +0800
++@@ -14840,9 +14840,17 @@
++ group to using @code{cvs admin} to change the default keyword
++ substitution mode, lock revisions, unlock revisions, and
++ replace the log message, use @samp{UserAdminOptions=klum}.
++- at end table
++-
++ 
+++ at cindex DateFormat, in CVSROOT/config
+++ at item DateFormat=@var{value}
+++Control the output format of dates from cvs. cvs version 1.12.x
+++changed the default format to use ``iso8601'' dates, which are
+++better for many reasons. However, old scripts/programs written to
+++parse the output of various cvs commands (especially cvs log) may
+++not cope with the change in date format (e.g. gcvs). The default
+++value of DateFormat will be ``iso8601'', but if you need temporary
+++backwards-compatibility set DateFormat=old.
+++ at end table
++ 
++ @c ---------------------------------------------------------------------
++ @node Environment variables
++diff -ruN cvs-1.12.13-old/src/log.c cvs-1.12.13/src/log.c
++--- cvs-1.12.13-old/src/log.c	2005-03-22 21:19:57.000000000 +0800
+++++ cvs-1.12.13/src/log.c	2006-02-26 23:03:05.000000000 +0800
++@@ -1607,8 +1607,12 @@
++ 		  &sec);
++     if (year < 1900)
++ 	year += 1900;
++-    sprintf (buf, "%04d-%02d-%02d %02d:%02d:%02d +0000", year, mon, mday,
++-	     hour, min, sec);
+++    if ('-' == datesep)
+++        sprintf (buf, "%04d%c%02d%c%02d %02d:%02d:%02d +0000", year, datesep,
+++                 mon, datesep, mday, hour, min, sec);
+++    else
+++        sprintf (buf, "%04d%c%02d%c%02d %02d:%02d:%02d", year, datesep,
+++                 mon, datesep, mday, hour, min, sec);
++     cvs_output_tagged ("date", buf);
++ 
++     cvs_output_tagged ("text", ";  author: ");
++diff -ruN cvs-1.12.13-old/src/main.c cvs-1.12.13/src/main.c
++--- cvs-1.12.13-old/src/main.c	2006-02-26 23:03:04.000000000 +0800
+++++ cvs-1.12.13/src/main.c	2006-02-26 23:10:12.000000000 +0800
++@@ -1371,9 +1371,19 @@
++     static char buf[sizeof ("yyyy-mm-dd HH:MM:SS -HHMM")];
++     /* Convert to a time in the local time zone.  */
++     struct tm ltm = *(localtime (&unixtime));
++-
++-    if (!my_strftime (buf, sizeof (buf), "%Y-%m-%d %H:%M:%S %z", &ltm, 0, 0))
++-	return NULL;
+++    char *format = NULL;
+++  
+++    switch (datesep)
+++    {
+++        case '/':
+++            format = "%Y/%m/%d %H:%M:%S";
+++            break;
+++        default:
+++            format = "%Y-%m-%d %H:%M:%S %z";
+++            break;
+++    }
+++    if (my_strftime (buf, sizeof (buf), format, &ltm, 0, 0) == 0)
+++        return NULL;
++ 
++     return xstrdup (buf);
++ }
++@@ -1388,9 +1398,19 @@
++     static char buf[sizeof ("yyyy-mm-dd HH:MM:SS -HHMM")];
++     /* Convert to a time in the local time zone.  */
++     struct tm ltm = *(gmtime (&unixtime));
++-
++-    if (!my_strftime (buf, sizeof (buf), "%Y-%m-%d %H:%M:%S %z", &ltm, 0, 0))
++-	return NULL;
+++    char *format = NULL;
+++  
+++    switch (datesep)
+++    {
+++        case '/':
+++            format = "%Y/%m/%d %H:%M:%S";
+++            break;
+++        default:
+++            format = "%Y-%m-%d %H:%M:%S %z";
+++            break;
+++    }
+++    if (my_strftime (buf, sizeof (buf), format, &ltm, 0, 0) == 0)
+++        return NULL;
++ 
++     return xstrdup (buf);
++ }
++diff -ruN cvs-1.12.13-old/src/parseinfo.c cvs-1.12.13/src/parseinfo.c
++--- cvs-1.12.13-old/src/parseinfo.c	2005-09-06 12:40:37.000000000 +0800
+++++ cvs-1.12.13/src/parseinfo.c	2006-02-26 23:03:05.000000000 +0800
++@@ -626,6 +626,19 @@
++ 		retval->logHistory = xstrdup (p);
++ 	    }
++ 	}
+++    /* grab FreeBSD date format idea */
+++    else if (strcmp (line, "DateFormat") == 0)
+++    {
+++        if (strcmp (p, "old") == 0)
+++        {
+++            datesep = '/';
+++        }
+++        else if (strcmp (p, "iso8601") == 0)
+++        {
+++            datesep = '-';
+++        }
+++    }
+++    /* end grabbing */
++ 	else if (strcmp (line, "RereadLogAfterVerify") == 0)
++ 	{
++ 	    if (!strcasecmp (p, "never"))
++diff -ruN cvs-1.12.13-old/src/rcs.c cvs-1.12.13/src/rcs.c
++--- cvs-1.12.13-old/src/rcs.c	2006-02-26 23:03:04.000000000 +0800
+++++ cvs-1.12.13/src/rcs.c	2006-02-26 23:03:05.000000000 +0800
++@@ -33,6 +33,8 @@
++ # endif
++ #endif
++ 
+++int datesep = '-';
+++
++ /* The RCS -k options, and a set of enums that must match the array.
++    These come first so that we can use enum kflag in function
++    prototypes.  */
++@@ -3537,8 +3539,8 @@
++ 		   &sec);
++     if (year < 1900)
++ 	year += 1900;
++-    sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d", year, mon, mday,
++-	     hour, min, sec);
+++    sprintf (buf, "%04d%c%02d%c%02d %02d:%02d:%02d", year, datesep, mon,
+++             datesep, mday, hour, min, sec);
++     return xstrdup (buf);
++ }
++ 
++diff -ruN cvs-1.12.13-old/src/rcs.h cvs-1.12.13/src/rcs.h
++--- cvs-1.12.13-old/src/rcs.h	2005-03-18 06:36:24.000000000 +0800
+++++ cvs-1.12.13/src/rcs.h	2006-02-26 23:03:05.000000000 +0800
++@@ -254,6 +254,7 @@
++ void RCS_setlocalid (const char *, unsigned int, void **, const char *arg);
++ char *make_file_label (const char *, const char *, RCSNode *);
++ 
+++extern int datesep;
++ extern bool preserve_perms;
++ 
++ /* From import.c.  */

================================================================
Index: SOURCES/cvs-debian-dsa-ext-pwd.patch
diff -u /dev/null SOURCES/cvs-debian-dsa-ext-pwd.patch:1.1
--- /dev/null	Tue Nov  6 08:40:37 2007
+++ SOURCES/cvs-debian-dsa-ext-pwd.patch	Tue Nov  6 08:40:30 2007
@@ -0,0 +1,391 @@
+--- cvs-1.12.13.orig/debian/patches/68_DSA_external_passwd_file
++++ cvs-1.12.13/debian/patches/68_DSA_external_passwd_file
+@@ -0,0 +1,388 @@
++# Add support for overriding lookups in CVSROOT/passwd
++# Specify --password-file <file> on the pserver command line to use it
++# Initial patch from the Debian DSA team, adapted by Steve McIntyre.
++# See README.Debian for more details.
++diff -ruN cvs-1.12.13-old/src/cvs.h cvs-1.12.13/src/cvs.h
++--- cvs-1.12.13-old/src/cvs.h	2005-10-02 16:17:20.000000000 +0100
+++++ cvs-1.12.13/src/cvs.h	2006-08-19 01:20:33.000000000 +0100
++@@ -371,6 +371,7 @@
++ extern int use_editor;
++ extern int cvswrite;
++ extern mode_t cvsumask;
+++extern char *PasswordFileName;
++ 
++ /* Temp dir abstraction.  */
++ /* From main.c.  */
++diff -ruN cvs-1.12.13-old/src/main.c cvs-1.12.13/src/main.c
++--- cvs-1.12.13-old/src/main.c	2006-08-17 00:25:16.000000000 +0100
+++++ cvs-1.12.13/src/main.c	2006-08-19 01:20:03.000000000 +0100
++@@ -43,8 +43,7 @@
++ int noexec = 0;
++ int readonlyfs = 0;
++ int logoff = 0;
++-
++-
+++char *PasswordFileName = NULL;
++ 
++ /***
++  ***
++@@ -519,6 +518,7 @@
++ 	{"help-commands", 0, NULL, 1},
++ 	{"help-synonyms", 0, NULL, 2},
++ 	{"help-options", 0, NULL, 4},
+++	{"password-file", required_argument, NULL, 5},
++ #ifdef SERVER_SUPPORT
++ 	{"allow-root", required_argument, NULL, 3},
++ #endif /* SERVER_SUPPORT */
++@@ -646,6 +646,10 @@
++ 		root_allow_add (optarg, gConfigPath);
++ 		break;
++ #endif /* SERVER_SUPPORT */
+++	    case 5:
+++		/* --password-file */
+++        PasswordFileName = xstrdup(optarg);
+++		break;
++ 	    case 'Q':
++ 		really_quiet = 1;
++ 		/* FALL THROUGH */
++diff -ruN cvs-1.12.13-old/src/Makefile.in cvs-1.12.13/src/Makefile.in
++--- cvs-1.12.13-old/src/Makefile.in	2005-10-03 14:37:18.000000000 +0100
+++++ cvs-1.12.13/src/Makefile.in	2006-08-17 00:28:35.000000000 +0100
++@@ -146,7 +146,7 @@
++ 	ls.$(OBJEXT) main.$(OBJEXT) mkmodules.$(OBJEXT) \
++ 	modules.$(OBJEXT) ms-buffer.$(OBJEXT) myndbm.$(OBJEXT) \
++ 	no_diff.$(OBJEXT) parseinfo.$(OBJEXT) patch.$(OBJEXT) \
++-	rcs.$(OBJEXT) rcscmds.$(OBJEXT) recurse.$(OBJEXT) \
+++	rcs.$(OBJEXT) rcscmds.$(OBJEXT) readpw.$(OBJEXT) recurse.$(OBJEXT) \
++ 	release.$(OBJEXT) remove.$(OBJEXT) repos.$(OBJEXT) \
++ 	root.$(OBJEXT) rsh-client.$(OBJEXT) run.$(OBJEXT) \
++ 	scramble.$(OBJEXT) server.$(OBJEXT) stack.$(OBJEXT) \
++@@ -349,6 +349,7 @@
++ 	patch.c \
++ 	rcs.c \
++ 	rcscmds.c \
+++	readpw.c \
++ 	recurse.c \
++ 	release.c \
++ 	remove.c \
++@@ -543,6 +544,7 @@
++ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/patch.Po at am__quote@
++ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rcs.Po at am__quote@
++ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rcscmds.Po at am__quote@
+++ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/readpw.Po at am__quote@
++ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/recurse.Po at am__quote@
++ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/release.Po at am__quote@
++ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/remove.Po at am__quote@
++diff -ruN cvs-1.12.13-old/src/parseinfo.h cvs-1.12.13/src/parseinfo.h
++--- cvs-1.12.13-old/src/parseinfo.h	2006-08-17 00:25:16.000000000 +0100
+++++ cvs-1.12.13/src/parseinfo.h	2006-08-17 00:58:25.000000000 +0100
++@@ -21,6 +21,7 @@
++     char *HistoryLogPath;
++     char *HistorySearchPath;
++     char *TmpDir;
+++    char *PasswordFileName;
++ 
++     /* Should the logmsg be re-read during the do_verify phase?
++      * RereadLogAfterVerify=no|stat|yes
++diff -ruN cvs-1.12.13-old/src/readpw.c cvs-1.12.13/src/readpw.c
++--- cvs-1.12.13-old/src/readpw.c	1970-01-01 01:00:00.000000000 +0100
+++++ cvs-1.12.13/src/readpw.c	2006-08-19 01:45:26.000000000 +0100
++@@ -0,0 +1,158 @@
+++/*
+++    readpw.c - read the CVS password from an external file
+++    Copyright (c) 2006  Martin Schulze <joey at infodrom.org>
+++
+++    This program is free software; you can redistribute it and/or modify
+++    it under the terms of the GNU General Public License as published by
+++    the Free Software Foundation; either version 2 of the License, or
+++    (at your option) any later version.
+++
+++    This program is distributed in the hope that it will be useful,
+++    but WITHOUT ANY WARRANTY; without even the implied warranty of
+++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+++    GNU General Public License for more details.
+++
+++    You should have received a copy of the GNU General Public License
+++    along with this program; if not, write to the Free Software
+++    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+++*/
+++
+++#include <string.h>
+++#include <stdio.h>
+++#include <errno.h>
+++#include <syslog.h>
+++
+++#define PWFILE "/tmp/work/cvs/cvs.passwd"
+++
+++/*
+++ * Source: control_nextline() in dtaus.c from dtaus
+++ */
+++size_t readline (FILE *f, char **buf, unsigned int len)
+++{
+++  char line[100];
+++  char tmp[100];
+++  char *cp;
+++  int i;
+++
+++  memset (line, 0, sizeof(line));
+++  memset (*buf, 0, len);
+++
+++  cp = line;
+++
+++  while (!strlen(line) && (cp = fgets(line, 100, f))) {
+++    if (strlen(line)) {
+++      if (line[0] != '#') {
+++        if (line[strlen(line)-1] != '\n') {
+++          strcpy(tmp, line);
+++          while (tmp[strlen(tmp)-1] != '\n' && (cp = fgets(tmp, 100, f)));
+++        } else
+++          line[strlen(line)-1] = '\0';
+++        if (line[strlen(line)-1] == '\r')
+++          line[strlen(line)-1] = '\0';
+++        for (i=strlen(line);(line[i-1] == ' '||line[i-1] == '\t')&&i>0; i--)
+++          line[i-1] = '\0';
+++      } else
+++        line[0] = '\0';
+++    }
+++  }
+++  for (cp=line; *cp==' '; cp++);
+++
+++  if (strlen(cp)) {
+++    memcpy(*buf, cp, strlen(cp) >= len ? len-1 : strlen(cp));
+++    return (strlen (cp));
+++  } else
+++    return 0;
+++}
+++
+++#define MAXLINE 100
+++#define PWLEN 20
+++
+++char *getpwline (const char *fname, const char *repository, const char *logname)
+++{
+++  FILE *f;
+++  char buf[MAXLINE], *bp = buf;
+++  static char line[MAXLINE];
+++  int inrepo = 0;
+++  char *cp;
+++
+++  memset (line, 0, sizeof (line));
+++
+++  if ((f = fopen (fname, "r")) == NULL) {
+++    perror ("fopen");
+++    return line;
+++  }
+++
+++  while (readline (f, &bp, 50)) {
+++    if (buf[0] == '/') {
+++        syslog(LOG_ERR, "Looking for repo %s in %s\n", repository, buf);
+++      if (!inrepo && !strcmp (buf, repository))
+++      {
+++          syslog(LOG_ERR, "matched repository %s\n", repository);
+++          inrepo = 1;
+++      }
+++      else if (inrepo)
+++       inrepo = 0;
+++    } else {
+++      if (inrepo) {
+++       if ((cp = strchr (buf, ':')) != NULL) {
+++         if ( (cp - buf) == strlen (logname)
+++              && !strncmp (buf, logname, strlen (logname))) {
+++           memcpy (line, buf, strlen(buf) >= MAXLINE ? MAXLINE-1 : strlen(buf));
+++         }
+++       }
+++      }
+++    }
+++  }
+++  
+++  if (ferror (f))
+++    perror ("ferror");
+++  if (fclose (f) < 0)
+++    perror ("fclose");
+++
+++  return line;
+++}
+++
+++/*
+++*****************************************************************
+++ */
+++#ifdef TEST_READPW
+++
+++void getpasswd (const char *fname, const char *repository, const char *logname, char **pw, char **user)
+++{
+++  char *line;
+++  char *cp, *xp;
+++
+++  memset (*pw, 0, PWLEN);
+++  memset (*user, 0, PWLEN);
+++
+++  line = getpwline(fname, repository, logname);
+++
+++  if (line[0] == '\0')
+++    return;
+++
+++  cp = strchr (line, ':');
+++  cp++;
+++
+++  if ((xp = strchr (cp, ':')) != NULL) {
+++    memcpy (*pw, cp, xp-cp >= PWLEN ? PWLEN-1 : xp-cp);
+++    
+++    xp++;
+++
+++    if (strlen (xp))
+++      memcpy (*user, xp, strlen(xp) >= PWLEN ? PWLEN-1 : strlen(xp));
+++  }
+++}
+++
+++int main ()
+++{
+++  char pw[PWLEN], *ppw = pw;
+++  char cvsuser[PWLEN], *pcu = cvsuser;
+++
+++  getpasswd (PWFILE, "/cvs/debian-doc", "jseidel", &ppw, &pcu);
+++
+++  printf ("%s<:>%s\n", pw, cvsuser);
+++  printf ("XXXXXXXXXXXXX\n");
+++
+++  return 0;
+++}
+++#endif /*TEST_READPW */
++diff -ruN cvs-1.12.13-old/src/server.c cvs-1.12.13/src/server.c
++--- cvs-1.12.13-old/src/server.c	2006-08-17 00:25:16.000000000 +0100
+++++ cvs-1.12.13/src/server.c	2006-08-20 00:31:22.000000000 +0100
++@@ -22,6 +22,8 @@
++ 
++ int server_active = 0;
++ 
+++char *getpwline (const char *fname, const char *repository, const char *logname);
+++
++ #if defined (SERVER_SUPPORT) || defined (CLIENT_SUPPORT)
++ 
++ # include "log-buffer.h"
++@@ -6689,51 +6691,71 @@
++ {
++     int retval = 0;
++     FILE *fp;
++-    char *filename;
+++    char *filename = NULL;
+++    char *cp;
++     char *linebuf = NULL;
++     size_t linebuf_len;
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list