summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cvs/src/client.c')
-rw-r--r--contrib/cvs/src/client.c60
1 files changed, 41 insertions, 19 deletions
diff --git a/contrib/cvs/src/client.c b/contrib/cvs/src/client.c
index aa897d5..222e7f2 100644
--- a/contrib/cvs/src/client.c
+++ b/contrib/cvs/src/client.c
@@ -78,8 +78,19 @@ static Key_schedule sched;
#ifdef HAVE_GSSAPI
+#ifdef HAVE_GSSAPI_H
+#include <gssapi.h>
+#endif
+#ifdef HAVE_GSSAPI_GSSAPI_H
#include <gssapi/gssapi.h>
+#endif
+#ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
#include <gssapi/gssapi_generic.h>
+#endif
+
+#ifndef HAVE_GSS_C_NT_HOSTBASED_SERVICE
+#define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
+#endif
/* This is needed for GSSAPI encryption. */
static gss_ctx_id_t gcontext;
@@ -949,17 +960,24 @@ call_in_directory (pathname, func, data)
error (1, errno, "could not chdir to %s", toplevel_wd);
newdir = 0;
- /* Create the CVS directory at the top level if needed.
- The isdir seems like an unneeded system call, but it *does*
- need to be called both if the CVS_CHDIR below succeeds (e.g.
- "cvs co .") or if it fails (e.g. basicb-1a in testsuite). */
+ /* Create the CVS directory at the top level if needed. The
+ isdir seems like an unneeded system call, but it *does*
+ need to be called both if the CVS_CHDIR below succeeds
+ (e.g. "cvs co .") or if it fails (e.g. basicb-1a in
+ testsuite). We only need to do this for the "." case,
+ since the server takes care of forcing this directory to be
+ created in all other cases. If we don't create CVSADM
+ here, the call to Entries_Open below will fail. FIXME:
+ perhaps this means that we should change our algorithm
+ below that calls Create_Admin instead of having this code
+ here? */
if (/* I think the reposdirname_absolute case has to do with
things like "cvs update /foo/bar". In any event, the
code below which tries to put toplevel_repos into
CVS/Repository is almost surely unsuited to
the reposdirname_absolute case. */
!reposdirname_absolute
-
+ && (strcmp (dir_name, ".") == 0)
&& ! isdir (CVSADM))
{
char *repo;
@@ -2909,19 +2927,19 @@ handle_wrapper_rcs_option (args, len)
as free-form as it looks. */
p = strchr (args, ' ');
if (p == NULL)
- goto error;
+ goto handle_error;
if (*++p != '-'
|| *++p != 'k'
|| *++p != ' '
|| *++p != '\'')
- goto error;
+ goto handle_error;
if (strchr (p, '\'') == NULL)
- goto error;
+ goto handle_error;
/* Add server-side cvswrappers line to our wrapper list. */
wrap_add (args, 0);
return;
- error:
+ handle_error:
error (0, errno, "protocol error: ignoring invalid wrappers %s", args);
}
@@ -3861,7 +3879,8 @@ connect_to_gserver (sock, hostinfo)
sprintf (buf, "cvs@%s", hostinfo->h_name);
tok_in.length = strlen (buf);
tok_in.value = buf;
- gss_import_name (&stat_min, &tok_in, gss_nt_service_name, &server_name);
+ gss_import_name (&stat_min, &tok_in, GSS_C_NT_HOSTBASED_SERVICE,
+ &server_name);
tok_in_ptr = GSS_C_NO_BUFFER;
gcontext = GSS_C_NO_CONTEXT;
@@ -5442,13 +5461,16 @@ option_with_arg (option, arg)
send_arg (arg);
}
-/*
- * Send a date to the server. This will passed a string which is the
- * result of Make_Date, and looks like YY.MM.DD.HH.MM.SS, where all
- * the letters are single digits. The time will be GMT. getdate on
- * the server can't parse that, so we turn it back into something
- * which it can parse.
- */
+/* Send a date to the server. The input DATE is in RCS format.
+ The time will be GMT.
+
+ We then convert that to the format required in the protocol
+ (including the "-D" option) and send it. According to
+ cvsclient.texi, RFC 822/1123 format is preferred, but for now we
+ use the format that we always have, for
+ conservatism/laziness/paranoia. As far as I know all servers
+ support the RFC 822/1123 format, so probably there would be no
+ particular danger in switching. */
void
client_senddate (date)
@@ -5457,10 +5479,10 @@ client_senddate (date)
int year, month, day, hour, minute, second;
char buf[100];
- if (sscanf (date, DATEFORM, &year, &month, &day, &hour, &minute, &second)
+ if (sscanf (date, SDATEFORM, &year, &month, &day, &hour, &minute, &second)
!= 6)
{
- error (1, 0, "diff_client_senddate: sscanf failed on date");
+ error (1, 0, "client_senddate: sscanf failed on date");
}
sprintf (buf, "%d/%d/%d %d:%d:%d GMT", month, day, year,
OpenPOWER on IntegriCloud