summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/cvs/vms
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1998-02-22 08:23:05 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1998-02-22 08:23:05 +0000
commit8996000ce3abfb3bf3ba9371f93dbb36605526e6 (patch)
tree18978064e57450121f0e4877713ae12ee2980e3e /gnu/usr.bin/cvs/vms
parent8b617ad77948342faf0917e268e4d001047fec35 (diff)
Latest version from Cyclic
Diffstat (limited to 'gnu/usr.bin/cvs/vms')
-rw-r--r--gnu/usr.bin/cvs/vms/ChangeLog54
-rw-r--r--gnu/usr.bin/cvs/vms/config.h12
-rw-r--r--gnu/usr.bin/cvs/vms/filesubr.c5
-rw-r--r--gnu/usr.bin/cvs/vms/getwd.c21
-rw-r--r--gnu/usr.bin/cvs/vms/misc.c42
-rw-r--r--gnu/usr.bin/cvs/vms/misc.h4
-rw-r--r--gnu/usr.bin/cvs/vms/ndir.c3
-rw-r--r--gnu/usr.bin/cvs/vms/ndir.h10
-rw-r--r--gnu/usr.bin/cvs/vms/options.h82
-rw-r--r--gnu/usr.bin/cvs/vms/pwd.c21
-rw-r--r--gnu/usr.bin/cvs/vms/pwd.h17
-rw-r--r--gnu/usr.bin/cvs/vms/stat.c11
-rw-r--r--gnu/usr.bin/cvs/vms/vms.h7
13 files changed, 132 insertions, 157 deletions
diff --git a/gnu/usr.bin/cvs/vms/ChangeLog b/gnu/usr.bin/cvs/vms/ChangeLog
index 26d000dceed..153bde3cd8a 100644
--- a/gnu/usr.bin/cvs/vms/ChangeLog
+++ b/gnu/usr.bin/cvs/vms/ChangeLog
@@ -1,3 +1,57 @@
+Tue Jan 13 13:17:33 1998 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * options.h (DIFF, RCSBIN_DFLT): Remove; no longer used.
+
+Sat Dec 27 16:57:41 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * options.h (HAVE_RCS5): Remove; no longer used.
+
+ * config.h (LINES_CRLF_TERMINATED): Remove; no longer used.
+
+Sat Nov 29 22:21:19 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ See lib/ChangeLog for rationale:
+ * options.h: Remove declaration of getwd
+ * getwd.c: Implement xgetwd not getwd.
+ * stat.c: Call xgetwd not getwd.
+
+Thu Sep 25 15:26:43 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * misc.c, misc.h (fatal, xmalloc, xrealloc): Remove; nowhere used.
+
+ * ndir.c, ndir.h: Change return type of closedir from void to int.
+
+ * config.h (HAVE_NDIR_H): Define.
+ * vms.h: Add comment about the include of ndir.h.
+ * ndir.h: Protect against multiple inclusion.
+
+Tue, 9 Sep 1997 Jim Kingdon
+
+ * config.h: Define HAVE_VPRINTF.
+
+ * pwd.h, vms.h: Define pid_t and mode_t.
+
+Tue Sep 9 18:53:33 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * pwd.h, pwd.c: Remove getpwnam per change to expand_path.
+ * config.h: Define GETPWNAM_MISSING.
+
+ * pwd.c (getpwuid): Declare argument as unsigned int not uid_t.
+
+ * config.h (SYSTEM_GETCALLER): Define.
+ * pwd.c (getpwuid, getpwnam): Always return NULL (see comment
+ for rationale).
+ * options.h: Don't define CVS_BADROOT.
+ * pwd.h: Nuke uid_t and related changes.
+
+ * filesubr.c (fnfold): Further expand comment about how to handle
+ filenames like "y.tab.c".
+
+Sun Sep 7 17:38:58 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * config.h (HAVE_STRDUP): Remove; not used anywhere.
+ * misc.h, misc.c: Remove strdup per change to ../configure.in.
+
Sun Jun 8 23:42:42 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
* config.h (HAVE_MKFIFO): Remove; not used anywhere.
diff --git a/gnu/usr.bin/cvs/vms/config.h b/gnu/usr.bin/cvs/vms/config.h
index a22a3738cf1..63e7d6251e6 100644
--- a/gnu/usr.bin/cvs/vms/config.h
+++ b/gnu/usr.bin/cvs/vms/config.h
@@ -15,9 +15,6 @@
/* More issues with how VMS names files, kind of a kludge. See login.c. */
#define NO_SLASH_AFTER_HOME 1
-/* Only good for NT or DOS with hacked open */
-/* #undef LINES_CRLF_TERMINATED */
-
/* Define to empty if the keyword does not work. */
/* #undef const */
@@ -47,7 +44,7 @@
/* #undef mode_t */
/* Define if you don't have <dirent.h>, but have <ndir.h>. */
-/* #undef NDIR */
+#define HAVE_NDIR_H 1
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
@@ -113,9 +110,6 @@
/* Define if you have the rename function */
#define HAVE_RENAME 1
-/* Define if you have the strdup function */
-#define HAVE_STRDUP 1
-
/* Define if you have the putenv function. */
/* #undef HAVE_PUTENV */
@@ -126,7 +120,7 @@
#define HAVE_VFORK
/* Define if you have the vprintf function. */
-/* #undef HAVE_VPRINTF */
+#define HAVE_VPRINTF
/* Define if you have the <errno.h> header file. */
/* #undef HAVE_ERRNO_H */
@@ -186,6 +180,8 @@ extern void fnfold (char *FILENAME);
#define NO_SOCKET_TO_FD 1
#define START_SERVER_RETURNS_SOCKET 1
#define SEND_NEVER_PARTIAL 1
+#define SYSTEM_GETCALLER() getlogin ()
+#define GETPWNAM_MISSING 1
/* Avoid name conflicts with VMS libraries. */
#define getopt cvs_getopt
diff --git a/gnu/usr.bin/cvs/vms/filesubr.c b/gnu/usr.bin/cvs/vms/filesubr.c
index 1c0e6246d4e..affca1a6d01 100644
--- a/gnu/usr.bin/cvs/vms/filesubr.c
+++ b/gnu/usr.bin/cvs/vms/filesubr.c
@@ -754,7 +754,10 @@ fncmp (const char *n1, const char *n2)
rather than "canonical form"). The idea is that files we create
would get thusly munged, but CVS can cope with their names being
different the same way that the NT port copes with it if the user
- renames a file from "foo" to "FOO". */
+ renames a file from "foo" to "FOO".
+
+ Alternately, this kind of handling could/should go into CVS_FOPEN
+ and friends (if we want to do it like the Mac port, anyway). */
void
fnfold (char *filename)
{
diff --git a/gnu/usr.bin/cvs/vms/getwd.c b/gnu/usr.bin/cvs/vms/getwd.c
index db1e9c56913..7bbdc55e27e 100644
--- a/gnu/usr.bin/cvs/vms/getwd.c
+++ b/gnu/usr.bin/cvs/vms/getwd.c
@@ -1,6 +1,23 @@
+/* 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, 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. */
+
#include <unixlib.h>
-char *getwd(char *pathname)
+#include "cvs.h"
+
+/* Return the current directory, newly allocated, arbitrarily long.
+ Return NULL and set errno on error. */
+char *
+xgetwd ()
{
- return getcwd(pathname, 256, 0);
+ char pathname[256];
+
+ return xstrdup (getcwd (pathname, sizeof (pathname) - 2, 0));
}
diff --git a/gnu/usr.bin/cvs/vms/misc.c b/gnu/usr.bin/cvs/vms/misc.c
index 82e9c70c423..cc564ec1c99 100644
--- a/gnu/usr.bin/cvs/vms/misc.c
+++ b/gnu/usr.bin/cvs/vms/misc.c
@@ -27,42 +27,6 @@
#include <ctype.h>
#include <lib$routines.h>
-/* Print message and force core dump (unix) or traceback (vms)
- * These are taken from other GNU software more-or-less as-is
- */
-void fatal (char *s)
-{
- int *x;
- printf ("%s\n", s);
- lib$signal(44);
-}
-
-/* GNU's lib implementation (alloca.c) is more portable, so I disabled these
- for this distribution (benjamin@cyclic.com) */
-#ifdef USE_VMSLIB_MEMORY_ALLOCATION
-void *xmalloc (int size)
-{
- register void *val;
- /* Avoid failure if malloc (0) returns 0. */
- if (size == 0)
- size = 1;
- val = (void *) malloc (size);
- if (!val) fatal ("xmalloc: can't satisfy request");
- return val;
-}
-
-void *xrealloc (void *block, int size)
-{
- register void *val;
- /* Avoid failure if malloc (0) returns 0. */
- if (size == 0)
- size = 1;
- val = (void *) realloc (block, size);
- if (!val) fatal ("xrealloc: can't satisfy request");
- return val;
-}
-#endif
-
/* See in misc.h why it is done like this. */
void x_free (void *block)
{
@@ -80,12 +44,6 @@ char *downcase (char *s)
return (s);
}
-char *strdup (char *src) {
- char *dst = (char*) xmalloc (strlen(src) + 1);
- strcpy (dst, src);
- return (dst);
-}
-
char *strndup (char *src, int len) {
char *dst = (char *) xmalloc (len + 1);
strncpy (dst, src, len);
diff --git a/gnu/usr.bin/cvs/vms/misc.h b/gnu/usr.bin/cvs/vms/misc.h
index 35a48ccc154..e92596c7556 100644
--- a/gnu/usr.bin/cvs/vms/misc.h
+++ b/gnu/usr.bin/cvs/vms/misc.h
@@ -17,9 +17,6 @@
* GNU General Public License for more details.
*/
-void fatal ();
-void *xmalloc ();
-void *xrealloc ();
void x_free();
/* This is a trick, because the linker wants uppercase symbols, and in
that case, xfree is confused with Xfree, which is bad. */
@@ -29,7 +26,6 @@ void x_free();
* Some string utilities.
*/
char *downcase ();
-char *strdup ();
char *strndup ();
int fixpath ();
diff --git a/gnu/usr.bin/cvs/vms/ndir.c b/gnu/usr.bin/cvs/vms/ndir.c
index a9758eae1dd..99c85121190 100644
--- a/gnu/usr.bin/cvs/vms/ndir.c
+++ b/gnu/usr.bin/cvs/vms/ndir.c
@@ -181,7 +181,7 @@ opendir (infilename, filepattern)
return (DIR *) dirp; /* I had to cast, for VMS sake. */
}
-void
+int
closedir (dirp)
register DIR *dirp; /* stream from opendir */
{
@@ -195,6 +195,7 @@ closedir (dirp)
}
xfree ((char *) dirp);
+ return 0;
}
struct direct dir_static; /* simulated directory contents */
diff --git a/gnu/usr.bin/cvs/vms/ndir.h b/gnu/usr.bin/cvs/vms/ndir.h
index 1bc59f708b6..21ad429f2a7 100644
--- a/gnu/usr.bin/cvs/vms/ndir.h
+++ b/gnu/usr.bin/cvs/vms/ndir.h
@@ -1,9 +1,12 @@
/*
<ndir.h> -- definitions for 4.2BSD-compatible directory access
- last edit: 28-dec-1994 Richard Levitte
+ 28-dec-1994 Richard Levitte
+ See ChangeLog for more recent modification history.
*/
+#ifndef NDIR_H
+
#if 0
#ifndef FAB$C_BID
#include <fab.h>
@@ -52,6 +55,9 @@ extern struct direct *readdir();
extern long telldir();
extern void seekdir();
#endif
-extern void closedir();
+extern int closedir();
#define rewinddir( dirp ) seekdir( dirp, 0L )
+
+#define NDIR_H 1
+#endif /* ndir.h */
diff --git a/gnu/usr.bin/cvs/vms/options.h b/gnu/usr.bin/cvs/vms/options.h
index a53091e0aeb..b2eb89bec3f 100644
--- a/gnu/usr.bin/cvs/vms/options.h
+++ b/gnu/usr.bin/cvs/vms/options.h
@@ -16,18 +16,6 @@
*/
/*
- * CVS provides the most features when used in conjunction with the Version-5
- * release of RCS. Thus, it is the default. This also assumes that GNU diff
- * Version-1.15 is being used as well -- you will have to configure your RCS
- * V5 release separately to make this the case. If you do not have RCS V5 and
- * GNU diff V1.15, comment out this define. You should not try mixing and
- * matching other combinations of these tools.
- */
-#ifndef HAVE_RCS5
-#define HAVE_RCS5
-#endif
-
-/*
* For portability and heterogeneity reasons, CVS is shipped by default using
* my own text-file version of the ndbm database library in the src/myndbm.c
* file. If you want better performance and are not concerned about
@@ -38,23 +26,6 @@
#endif
/*
- * The "diff" program to execute when creating patch output. This "diff"
- * must support the "-c" option for context diffing. Specify a full
- * pathname if your site wants to use a particular diff. If you are
- * using the GNU version of diff (version 1.15 or later), this should
- * be "diff -a".
- *
- * NOTE: this program is only used for the ``patch'' sub-command (and
- * for ``update'' if you are using the server). The other commands
- * use rcsdiff which will use whatever version of diff was specified
- * when rcsdiff was built on your system.
- */
-
-#ifndef DIFF
-#define DIFF "/usr/local/bin/diff -a"
-#endif
-
-/*
* The "patch" program to run when using the CVS server and accepting
* patches across the network. Specify a full pathname if your site
* wants to use a particular patch.
@@ -63,35 +34,6 @@
#define PATCH_PROGRAM "patch"
#endif
-/*
- * By default, RCS programs are executed with the shell or through execlp(),
- * so the user's PATH environment variable is searched. If you'd like to
- * bind all RCS programs to a certain directory (perhaps one not in most
- * people's PATH) then set the default in RCSBIN_DFLT. Note that setting
- * this here will cause all RCS programs to be executed from this directory,
- * unless the user overrides the default with the RCSBIN environment variable
- * or the "-b" option to CVS.
- *
- * If you use the password-authenticating server, then you need to
- * make sure that the server can find the RCS programs to invoke them.
- * The authenticating server starts out running as root, and then
- * switches to run as the appropriate user once authentication is
- * complete. But no actual shell is ever started by that user, so the
- * PATH environment variable may not contain the directory with the
- * RCS binaries, even though if that user logged in normally, PATH
- * would include the directory.
- *
- * One way to solve this problem is to set RCSBIN_DFLT here. An
- * alternative is to make sure that root has the right directory in
- * its path already. Another, probably better alternative is to
- * specify -b in /etc/inetd.conf.
- *
- * This define should be either the empty string ("") or a full pathname to the
- * directory containing all the installed programs from the RCS distribution. */
-#ifndef RCSBIN_DFLT
-#define RCSBIN_DFLT ""
-#endif
-
/* Directory used for storing temporary files, if not overridden by
environment variables or the -T global option. There should be little
need to change this (-T is a better mechanism if you need to use a
@@ -176,18 +118,16 @@
/* #define CVS_FUDGELOCKS */
#endif
-/*
- * When committing a permanent change, CVS and RCS make a log entry of
- * who committed the change. If you are committing the change logged in
- * as "root" (not under "su" or other root-priv giving program), CVS/RCS
- * cannot determine who is actually making the change.
- *
- * As such, by default, CVS disallows changes to be committed by users
- * logged in as "root". You can disable this option by commenting
- * out the lines below.
- */
+/* There is some pretty unixy code in src/commit.c which tries to
+ prevent people from commiting changes as "root" (which would prevent
+ CVS from making a log entry with the actual user). On VMS, I suppose
+ one could say that SYSTEM is equivalent, but I would think that it
+ actually is not necessary; at least at the VMS sites I've worked at
+ people just used their own accounts (turning privileges on and off
+ as desired). */
+
#ifndef CVS_BADROOT
-#define CVS_BADROOT
+/* #define CVS_BADROOT */
#endif
/*
@@ -243,9 +183,5 @@
extern void exit ();
#endif
-#ifndef getwd
-extern char *getwd ();
-#endif
-
#define NO_SOCKET_TO_FD 1
#include "vms.h"
diff --git a/gnu/usr.bin/cvs/vms/pwd.c b/gnu/usr.bin/cvs/vms/pwd.c
index 97b5c5ca1b1..5d81194e1a6 100644
--- a/gnu/usr.bin/cvs/vms/pwd.c
+++ b/gnu/usr.bin/cvs/vms/pwd.c
@@ -4,22 +4,13 @@
static struct passwd pw;
-struct passwd *getpwuid(uid_t uid)
+/* This is only called from one relevant place, lock.c. In that context
+ the code is really trying to figure out who owns a directory. Nothing
+ which has anything to do with getpwuid or anything of the sort can help
+ us on VMS (getuid returns only the group part of the UIC). */
+struct passwd *getpwuid(unsigned int uid)
{
- pw.pw_name = getlogin();
- pw.pw_uid = getuid();
- pw.pw_gid = getgid();
-
- return &pw;
-}
-
-struct passwd *getpwnam(char *name)
-{
- pw.pw_name = getlogin();
- pw.pw_uid = getuid();
- pw.pw_gid = getgid();
-
- return &pw;
+ return NULL;
}
char *getlogin()
diff --git a/gnu/usr.bin/cvs/vms/pwd.h b/gnu/usr.bin/cvs/vms/pwd.h
index 3ca5dbce872..857d75188f7 100644
--- a/gnu/usr.bin/cvs/vms/pwd.h
+++ b/gnu/usr.bin/cvs/vms/pwd.h
@@ -1,17 +1,20 @@
#ifndef _PWD_H
#define _PWD_H
-#include <sys/types.h>
+/* Trying to declare uid_t is a mess. We tried #include <sys/types.h>, which
+ only worked on VAX (VMS 6.2, I think), and we tried defining it here
+ which only worked on alpha, I think. In any event, the VMS C library's
+ concept of uid_t is fundamentally broken anyway (getuid() returns only
+ the group part of the UIC), so we are better off with higher-level
+ hooks like get_homedir and SYSTEM_GETCALLER. */
+
+#define pid_t int
struct passwd {
char *pw_name;
- uid_t pw_uid;
- gid_t pw_gid;
- char *pw_dir;
- };
+};
-struct passwd *getpwuid(uid_t);
-struct passwd *getpwnam(char *);
+struct passwd *getpwuid(/* really uid_t, but see above about declaring it */);
char *getlogin(void);
#else
diff --git a/gnu/usr.bin/cvs/vms/stat.c b/gnu/usr.bin/cvs/vms/stat.c
index af3b5acc3af..661df75c215 100644
--- a/gnu/usr.bin/cvs/vms/stat.c
+++ b/gnu/usr.bin/cvs/vms/stat.c
@@ -12,9 +12,16 @@ struct stat *buffer;
strcpy(statpath, path);
strip_trailing_slashes (statpath);
if(strcmp(statpath, ".") == 0)
- getwd(statpath);
+ {
+ char *wd;
+ wd = xgetwd ();
+ rs = stat (wd, buffer);
+ free (wd);
+ }
+ else
+ rs = stat (statpath, buffer);
- if ((rs = stat (statpath, buffer)) < 0)
+ if (rs < 0)
{
/* If stat() fails try again after appending ".dir" to the filename
this allows you to stat things like "bloogle/CVS" from VMS 6.1 */
diff --git a/gnu/usr.bin/cvs/vms/vms.h b/gnu/usr.bin/cvs/vms/vms.h
index 9cd0b509eb7..d41e196be44 100644
--- a/gnu/usr.bin/cvs/vms/vms.h
+++ b/gnu/usr.bin/cvs/vms/vms.h
@@ -1,5 +1,7 @@
/* Determined from CC RTL function prototypes in online documentation */
+#define mode_t unsigned int
+
#define fork(x) vfork(x)
#include <sys/types.h>
@@ -15,7 +17,12 @@
extern int fnmatch(char *pattern, char *string, int options);
+/* With the define of HAVE_NDIR_H in config.h, lib/system.h and
+ diff/system.h should include ndir.h for us. But I'm too lazy to
+ track down and make _sure_ all bases are covered, so I'm leaving in
+ this include for now. */
#include "ndir.h"
+
#include "pwd.h"
#include "pipe.h"