unbreak following removal of unistd.h include from sys/file.h

this commit does nothing to improve the crappiness of these ports, just
lets them build again.
This commit is contained in:
sthen 2014-11-19 20:48:00 +00:00
parent 938c9c9072
commit 40ef208661
7 changed files with 120 additions and 76 deletions

View File

@ -1,16 +1,17 @@
$OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
$OpenBSD: patch-src_metamail_mailto_c,v 1.2 2014/11/19 20:48:00 sthen Exp $
--- src/metamail/mailto.c.orig Wed Feb 9 20:30:26 1994
+++ src/metamail/mailto.c Sat Mar 17 10:51:52 2012
@@ -37,6 +37,8 @@ STILL NEED TO DO/SUPPORT:
+++ src/metamail/mailto.c Wed Nov 19 20:46:06 2014
@@ -37,6 +37,9 @@ STILL NEED TO DO/SUPPORT:
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
#include <ctype.h>
#include <config.h>
#include <pwd.h>
@@ -50,8 +52,6 @@ STILL NEED TO DO/SUPPORT:
@@ -50,8 +53,6 @@ STILL NEED TO DO/SUPPORT:
#include <getfiles.h>
#include <time.h>
#include <lib_protos.h>
@ -19,7 +20,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
#endif
#ifdef SYSV
@@ -60,7 +60,7 @@ extern char *getenv();
@@ -60,7 +61,7 @@ extern char *getenv();
#include <unistd.h>
#endif
@ -28,7 +29,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
struct mailpart *CreateNewPart();
/* The main data structure for the multiple parts of the mail */
@@ -195,7 +195,7 @@ tmpname() {
@@ -195,7 +196,7 @@ tmpname() {
sprintf(s, "%s/mm.XXXXXX", tmproot);
}
#endif
@ -37,7 +38,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
return(s);
}
@@ -205,7 +205,7 @@ TildeHelp() {
@@ -205,7 +206,7 @@ TildeHelp() {
FILE *fp;
strcpy(TmpName, tmpname());
@ -46,7 +47,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
if (!fp) fp = stdout;
fprintf(fp, "The following tilde escapes are BSD-mail-compatible:\n");
fprintf(fp, "~? Show help on tilde escapes\n");
@@ -570,6 +570,7 @@ char **argv;
@@ -570,6 +571,7 @@ char **argv;
if (isupper(*sdum)) *sdum = tolower(*sdum);
}
if (strcmp(CharacterSet, "us-ascii")
@ -54,7 +55,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
&& strncmp(CharacterSet, "iso-8859-", 9)) {
fprintf(stderr, "mailto: Unsupported character set: %s\n", CharacterSet);
exit(-1);
@@ -591,7 +592,7 @@ char **argv;
@@ -591,7 +593,7 @@ char **argv;
}
FirstPart = NewPart();
CurrentPart = FirstPart;
@ -63,7 +64,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -678,7 +679,7 @@ char **argv;
@@ -678,7 +680,7 @@ char **argv;
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
@ -72,7 +73,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -717,7 +718,7 @@ char **argv;
@@ -717,7 +719,7 @@ char **argv;
CurrentPart = CurrentPart->next;
CurrentPart->istext = 0;
CurrentPart->content_type = "message/rfc822";
@ -81,7 +82,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
if (!fpout) {
fprintf(stderr, "mailto: Cannot open temporary file %s\n", CurrentPart->filename);
break;
@@ -729,7 +730,7 @@ char **argv;
@@ -729,7 +731,7 @@ char **argv;
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
@ -90,7 +91,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -808,11 +809,11 @@ char **argv;
@@ -808,11 +810,11 @@ char **argv;
char Cmd[TMPFILE_NAME_SIZE + 15];
char *s=tmpname();
fclose(fpout);
@ -104,7 +105,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -969,7 +970,7 @@ char **argv;
@@ -969,7 +971,7 @@ char **argv;
CurrentPart = CurrentPart->next;
CurrentPart->istext = 0;
CurrentPart->content_type = "message/rfc822";
@ -113,7 +114,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
if (!fpout) {
fprintf(stderr, "mailto: Cannot open temporary file %s\n", CurrentPart->filename);
break;
@@ -991,7 +992,7 @@ char **argv;
@@ -991,7 +993,7 @@ char **argv;
CurrentPart->next = NewPart();
CurrentPart->next->prev = CurrentPart;
CurrentPart = CurrentPart->next;
@ -122,7 +123,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
if (!fpout) {
fprintf(stderr, "mailto: Can't open temporary file %s\n", CurrentPart->filename);
cleanexit(-1);
@@ -1130,6 +1131,7 @@ struct mailpart *part;
@@ -1130,6 +1132,7 @@ struct mailpart *part;
if (part->isrich) {
if (strcmp(CharacterSet, "us-ascii")
&& (strncmp(CharacterSet, "iso-8859-", 9)
@ -130,7 +131,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
|| part->encoding_type_needed != ENC_NONE)) {
fprintf(fp, "Content-type: text/richtext; charset=\"%s\"\n", CharacterSet);
} else {
@@ -1140,6 +1142,7 @@ struct mailpart *part;
@@ -1140,6 +1143,7 @@ struct mailpart *part;
WriteCtypeNicely(fp, part->content_type);
if (strcmp(CharacterSet, "us-ascii")
&& (strncmp(CharacterSet, "iso-8859-", 9)
@ -138,7 +139,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
|| part->encoding_type_needed != ENC_NONE)) {
fprintf(fp, "; charset=\"%s\"\n", CharacterSet);
} else fputs("\n", fp);
@@ -1745,6 +1748,7 @@ CreateNewPart() {
@@ -1745,6 +1749,7 @@ CreateNewPart() {
}
printf("\n\nEnter your choice as a number from 0 to %d: ", i);
fflush(stdout);
@ -146,7 +147,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
fgets(LineBuf, sizeof(LineBuf), stdin);
ans = atoi(LineBuf);
if (ans == 0 || ans == 1) {
@@ -1773,7 +1777,7 @@ CreateNewPart() {
@@ -1773,7 +1778,7 @@ CreateNewPart() {
printf("Cannot read %s, data insertion cancelled\n", sdum);
return(NULL);
}
@ -155,7 +156,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
if (!fpo) {
printf("Cannot open temporary file, data insertion cancelled\n");
return(NULL);
@@ -1791,12 +1795,13 @@ CreateNewPart() {
@@ -1791,12 +1796,13 @@ CreateNewPart() {
int ct;
printf("\nEnter the MIME Content-type value for the data from file %s\n (type '?' for a list of locally-valid content-types): ", sdum);
fflush(stdout);
@ -170,7 +171,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
}
if (!strcmp(lc, "text/plain")) break;
if (!strcmp(lc, "application/octet-stream")) break;
@@ -1809,7 +1814,7 @@ CreateNewPart() {
@@ -1809,7 +1815,7 @@ CreateNewPart() {
}
if (mc) break;
printf("The MIME content-type '%s' is not listed in your local mailcap files,\nand may not be a valid MIME type. Do you want to use it anyway [no] ? ", LineBuf);
@ -179,7 +180,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
while (s && *s && isspace((unsigned char) *s)) ++s;
if (s && (*s == 'y' || *s == 'Y')) break;
continue;
@@ -1866,7 +1871,8 @@ CreateNewPart() {
@@ -1866,7 +1872,8 @@ CreateNewPart() {
mp->content_type = mc->contenttype;
mp->encoding_type_needed = WhichEncodingForFile(mp->filename, mp->content_type);
} else {
@ -189,7 +190,7 @@ $OpenBSD: patch-src_metamail_mailto_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
FILE *fp, *fpout;
int inheaders=1, bct=0;
@@ -1936,7 +1942,7 @@ CreateNewPart() {
@@ -1936,7 +1943,7 @@ CreateNewPart() {
mp->encoding_type_needed = ENC_NONE;
}
newfilename = tmpname();

View File

@ -1,16 +1,17 @@
$OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
--- src/metamail/metamail.c.orig Thu Feb 17 02:57:19 1994
+++ src/metamail/metamail.c Sat Nov 30 14:33:18 2013
@@ -20,6 +20,8 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
$OpenBSD: patch-src_metamail_metamail_c,v 1.3 2014/11/19 20:48:00 sthen Exp $
--- src/metamail/metamail.c.orig Thu Feb 17 01:57:19 1994
+++ src/metamail/metamail.c Wed Nov 19 20:45:34 2014
@@ -20,6 +20,9 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
******************************************************* */
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -29,7 +31,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
@@ -29,7 +32,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
#ifdef BORLAND
#define F_OK 0
extern unsigned _stklen = 16384;
@ -19,7 +20,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
#define WRITE_BINARY "w"
#else /* BORLAND */
#ifdef MICROSOFT
@@ -46,12 +48,14 @@ extern char *mktemp(char *);
@@ -46,12 +49,14 @@ extern char *mktemp(char *);
#include <signal.h>
#ifndef AMIGA
@ -37,7 +38,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
#endif /* AMIGA */
#endif /* MICROSOFT */
#endif /* BORLAND */
@@ -100,13 +104,6 @@ extern char **environ, *gets();
@@ -100,13 +105,6 @@ extern char **environ, *gets();
#define CMDSIZE 1200 /* Maximum size of command to execute */
#define LINE_BUF_SIZE 2000
@ -51,7 +52,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
char fileToDelete[MAX_FILE_NAME_SIZE];
char *FindParam();
@@ -302,24 +299,6 @@ char **argv;
@@ -302,24 +300,6 @@ char **argv;
int retcode;
modpath(AUXPATH);
@ -76,7 +77,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
tmproot = getenv("METAMAIL_TMPDIR");
if (!tmproot) tmproot="/tmp";
mailheaders = getenv("MM_HEADERS");
@@ -579,7 +558,7 @@ int nestingdepth;
@@ -579,7 +559,7 @@ int nestingdepth;
int overwriteans = -1;
do {
printf("File %s exists. Do you want to overwrite it (y/n) ?\n", Fname);
@ -85,7 +86,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
if (!s) {
overwriteans = 0;
} else {
@@ -1202,9 +1181,9 @@ char *SquirrelFile;
@@ -1202,9 +1182,9 @@ char *SquirrelFile;
fprintf(outfp, "Content-type: %s", ContentType);
for (j=0; j<CParamsUsed; ++j) {
fprintf(outfp, " ; ");
@ -97,7 +98,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
}
fprintf(outfp, "\n\n");
TranslateInputToOutput(InputFP, outfp, EncodingCode, ContentType);
@@ -1823,7 +1802,7 @@ char *ctype, *progname, *label;
@@ -1823,7 +1803,7 @@ char *ctype, *progname, *label;
} else {
printf("This message contains '%s'-format data.\nDo you want to view it using the '%s' command (y/n) [y] ? ", ctype, ShortCommand(progname));
}
@ -106,7 +107,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
if (!s) return(0); /* EOF */
while (s && *s && isspace((unsigned char) *s)) ++s;
if (*s == 'y' || *s == 'Y' || !*s || *s == '\n') return(1);
@@ -2022,7 +2001,7 @@ int ShowLeadingWhitespace;
@@ -2022,7 +2002,7 @@ int ShowLeadingWhitespace;
if (lc2strcmp(charset, PrevCharset)) {
char *s2, *charsetinuse;
@ -115,7 +116,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
for (s2=PrevCharset; *s2; ++s2) {
if (isupper((unsigned char) *s2)) *s2 = tolower((unsigned char) *s2);
}
@@ -2032,7 +2011,7 @@ int ShowLeadingWhitespace;
@@ -2032,7 +2012,7 @@ int ShowLeadingWhitespace;
}
}
if (ecode == ENCODING_NONE) {
@ -124,7 +125,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
} else {
/* What follows is REALLY bogus, but all my encoding stuff is pipe-oriented right now... */
MkTmpFileName(TmpFile);
@@ -2374,8 +2353,11 @@ char *Prefix;
@@ -2374,8 +2354,11 @@ char *Prefix;
}
int HasSavedTtyState=0;
@ -137,7 +138,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
static struct termio MyTtyStateIn, MyTtyStateOut;
#else
static struct sgttyb MyTtyStateIn, MyTtyStateOut;
@@ -2385,7 +2367,10 @@ static struct sgttyb MyTtyStateIn, MyTtyStateOut;
@@ -2385,7 +2368,10 @@ static struct sgttyb MyTtyStateIn, MyTtyStateOut;
SaveTtyState() {
/* Bogus -- would like a good portable way to reset the terminal state here */
#if !defined(AMIGA) && !defined(MSDOS)
@ -149,7 +150,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
ioctl(fileno(stdin), TCGETA, &MyTtyStateIn);
ioctl(fileno(stdout), TCGETA, &MyTtyStateOut);
#else
@@ -2398,8 +2383,13 @@ SaveTtyState() {
@@ -2398,8 +2384,13 @@ SaveTtyState() {
RestoreTtyState() {
#if !defined(AMIGA) && !defined(MSDOS)
@ -164,7 +165,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
ioctl(fileno(stdout), TCSETA, &MyTtyStateOut);
ioctl(fileno(stdin), TCSETA, &MyTtyStateIn);
}
@@ -2489,14 +2479,14 @@ char *name;
@@ -2489,14 +2480,14 @@ char *name;
{
#ifdef AMIGA
strcpy(name, "T:mmXXXXXX");
@ -182,7 +183,7 @@ $OpenBSD: patch-src_metamail_metamail_c,v 1.2 2013/11/30 15:13:06 jca Exp $
name[0] = 0;
else
if (DoDebug) printf("temp name = \"%s\"\n", name);
@@ -2681,7 +2671,16 @@ PauseForUser() {
@@ -2681,7 +2672,16 @@ PauseForUser() {
StartRawStdin() {
#if !defined(AMIGA) && !defined(MSDOS)

View File

@ -19,7 +19,7 @@ MANDIR = @PREFIX@/man
CC = @CC@
# Compile options.
CFLAGS += ${DEBUG} -DSTRINGS_H -DTIME_H
CFLAGS += ${DEBUG} -DSTRINGS_H -DTIME_H -DHAVE_UNISTD_H
TCLCFLAGS += ${DEBUG} -DSTRINGS_H -DTIME_H
# Lint flags

View File

@ -1,7 +1,23 @@
$OpenBSD: patch-icb_tcl_c,v 1.1 2001/05/14 16:42:54 millert Exp $
--- icb/tcl.c.orig Fri Feb 24 14:20:30 1995
+++ icb/tcl.c Mon May 14 10:33:05 2001
@@ -145,7 +145,7 @@ getrcname()
$OpenBSD: patch-icb_tcl_c,v 1.2 2014/11/19 20:48:00 sthen Exp $
--- icb/tcl.c.orig Fri Feb 24 21:20:30 1995
+++ icb/tcl.c Wed Nov 19 20:36:43 2014
@@ -3,14 +3,11 @@
/* TCL interface */
-#ifdef linux
-#include <unistd.h>
-#endif
-
#include "icb.h"
#include "externs.h"
#include <sys/dir.h>
#include <sys/file.h>
+#include <unistd.h>
Tcl_Interp *interp;
@@ -145,7 +142,7 @@ getrcname()
if ((homedir = getenv("HOME")) == NULL) {
printf("icb: warning - $HOME not set.\r\n");
@ -10,7 +26,7 @@ $OpenBSD: patch-icb_tcl_c,v 1.1 2001/05/14 16:42:54 millert Exp $
}
for (p=names; p && *p; ++p)
@@ -153,12 +153,9 @@ getrcname()
@@ -153,12 +150,9 @@ getrcname()
sprintf(rcpath, "%s/%s", homedir, *p);
rcfile = rcpath;
if (access(rcfile, R_OK)==0)

View File

@ -1,7 +1,25 @@
$OpenBSD: patch-tcl_tclCmdAH_c,v 1.2 2010/05/22 14:23:48 espie Exp $
--- tcl/tclCmdAH.c.orig Fri Feb 24 22:19:53 1995
+++ tcl/tclCmdAH.c Sat May 22 16:16:44 2010
@@ -38,9 +38,17 @@ static char rcsid[] = "$Header: /home/agamotto/mark/pk
$OpenBSD: patch-tcl_tclCmdAH_c,v 1.3 2014/11/19 20:48:00 sthen Exp $
--- tcl/tclCmdAH.c.orig Fri Feb 24 21:19:53 1995
+++ tcl/tclCmdAH.c Wed Nov 19 20:36:11 2014
@@ -19,16 +19,13 @@
static char rcsid[] = "$Header: /home/cvs/ports/net/icb/patches/Attic/patch-tcl_tclCmdAH_c,v 1.3 2014/11/19 20:48:00 sthen Exp $ SPRITE (Berkeley)";
#endif /* not lint */
-#ifdef linux
-#include <unistd.h>
-#endif /* linux */
-
#include <ctype.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/file.h>
@@ -38,9 +35,17 @@ static char rcsid[] = "$Header: /home/agamotto/mark/pk
#include <sys/wait.h>
#include "tclInt.h"
@ -19,7 +37,7 @@ $OpenBSD: patch-tcl_tclCmdAH_c,v 1.2 2010/05/22 14:23:48 espie Exp $
/*
*----------------------------------------------------------------------
@@ -430,7 +438,7 @@ Tcl_ExecCmd(dummy, interp, argc, argv)
@@ -430,7 +435,7 @@ Tcl_ExecCmd(dummy, interp, argc, argv)
int pid = -1; /* -1 means child process doesn't
* exist (yet). Non-zero gives its
* id (0 only in child). */
@ -28,7 +46,7 @@ $OpenBSD: patch-tcl_tclCmdAH_c,v 1.2 2010/05/22 14:23:48 espie Exp $
char *cmdName, *execName;
/*
@@ -501,8 +509,13 @@ Tcl_ExecCmd(dummy, interp, argc, argv)
@@ -501,8 +506,13 @@ Tcl_ExecCmd(dummy, interp, argc, argv)
} else {
char tmp[sizeof(TMP_FILE_NAME) + 1];
strcpy(tmp, TMP_FILE_NAME);
@ -42,7 +60,7 @@ $OpenBSD: patch-tcl_tclCmdAH_c,v 1.2 2010/05/22 14:23:48 espie Exp $
if (stdIn[0] < 0) {
sprintf(interp->result,
"couldn't create input file for \"%.50s\" command: %.50s",
@@ -642,7 +655,7 @@ Tcl_ExecCmd(dummy, interp, argc, argv)
@@ -642,7 +652,7 @@ Tcl_ExecCmd(dummy, interp, argc, argv)
sprintf(interp->result, "command terminated abnormally");
result = TCL_ERROR;
}

View File

@ -1,6 +1,6 @@
# $OpenBSD: Makefile,v 1.33 2013/11/30 20:31:49 jca Exp $
# $OpenBSD: Makefile,v 1.34 2014/11/19 20:48:00 sthen Exp $
NOT_FOR_ARCHS= ${LP64_ARCHS}
#NOT_FOR_ARCHS= ${LP64_ARCHS}
COMMENT= cryptographic file system (user-space NFS server)

View File

@ -1,6 +1,14 @@
--- cfs_fh.c.orig Thu May 3 20:24:59 2001
+++ cfs_fh.c Sat Nov 30 21:44:12 2013
@@ -177,6 +177,13 @@ writeblock(blk,fd,offset,len,key,vect)
--- cfs_fh.c.orig Thu May 3 12:24:59 2001
+++ cfs_fh.c Wed Nov 19 13:42:46 2014
@@ -33,6 +33,7 @@
#include <rpc/rpc.h>
#include <fcntl.h>
#include <stdio.h>
+#include <unistd.h>
#ifdef hpux
#define NO_UTIMES
#include <time.h>
@@ -177,6 +178,13 @@ writeblock(blk,fd,offset,len,key,vect)
perror("write");
return -1;
}
@ -14,7 +22,7 @@
/* iolen may contain CFSBLOCK extra chars */
return(dtov(iolen)-fronterr);
}
@@ -195,30 +202,39 @@ encryptname(key,s)
@@ -195,30 +203,39 @@ encryptname(key,s)
char *s;
{
static char cryptname[NFS_MAXNAMLEN+1];
@ -60,7 +68,7 @@
*/
chksum(s,l)
char *s;
@@ -229,17 +245,47 @@ chksum(s,l)
@@ -229,17 +246,47 @@ chksum(s,l)
u_char bits[8];
acc=0;
@ -111,7 +119,7 @@
/*
* decrypt path component
* leaving "." and ".."
@@ -279,9 +325,7 @@ decryptname(key,s)
@@ -279,9 +326,7 @@ decryptname(key,s)
if (l%CFSBLOCK)
return NULL;
dodecrypt(key,clearstring,l,10241,zerovect);
@ -122,7 +130,7 @@
return clearstring;
}
@@ -359,11 +403,11 @@ isbndry(d)
@@ -359,11 +404,11 @@ isbndry(d)
static fh_u roothandle;
@ -136,7 +144,7 @@
/* something else! Otherwise your FS and CFS can't both run... */
/* static u_char magictest[8]={0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}; */
static u_char magictest[8]="M.Blaze";
@@ -514,10 +558,44 @@ fhuid(f,u)
@@ -514,10 +559,44 @@ fhuid(f,u)
cfsno(err)
int err;
{
@ -183,7 +191,7 @@
}
@@ -732,12 +810,17 @@ fhmkdirent(p,comp,h)
@@ -732,12 +811,17 @@ fhmkdirent(p,comp,h)
{
char path[NFS_MAXPATHLEN+1];
struct stat sb;
@ -202,7 +210,7 @@
if (mkdir(path,0)<0)
return -1;
if (stat(path,&sb)<0)
@@ -766,12 +849,22 @@ fhmkfileent(p,comp,h)
@@ -766,12 +850,22 @@ fhmkfileent(p,comp,h)
u_long i[2];
} buf;
char linkname[NFS_MAXPATHLEN+1];
@ -226,7 +234,7 @@
if ((fd=open(path,O_CREAT|O_WRONLY|O_EXCL,0))<0) {
if (errno==EEXIST) {
@@ -785,7 +878,6 @@ fhmkfileent(p,comp,h)
@@ -785,7 +879,6 @@ fhmkfileent(p,comp,h)
if (fstat(fd,&sb)<0)
return -1;
close(fd);
@ -234,7 +242,7 @@
if (!rs) {
if (p->ins->highsec) { /* create new pert file iff highsec */
/* note that there's a race condition here until the simlink */
@@ -800,8 +892,8 @@ fhmkfileent(p,comp,h)
@@ -800,8 +893,8 @@ fhmkfileent(p,comp,h)
/* hash. but this doesn't really matter since collisions */
/* are rare. we could save all 64 bits, but the encoding */
/* of the link would get messy and large */
@ -245,7 +253,7 @@
if (symlink(vect,linkname) != 0) {
strcpy(linkname,"/NOWHERE/null");
bcopy((char *)zerovect,(char *)vect,8);
@@ -839,6 +931,7 @@ fhlook(p,comp,h)
@@ -839,6 +932,7 @@ fhlook(p,comp,h)
char linkname[NFS_MAXPATHLEN+1];
char vect[NFS_MAXPATHLEN+1];
struct stat sb;
@ -253,7 +261,7 @@
if (p==NULL) {
cfserrno=NFSERR_STALE;
@@ -852,12 +945,20 @@ fhlook(p,comp,h)
@@ -852,12 +946,20 @@ fhlook(p,comp,h)
}
if ((p->parent==0) && (!strcmp(comp,"..")))
return fhrootlook(p->ins->name,h);
@ -276,7 +284,7 @@
if (readlink(linkname,vect,9) != 8) {
bcopy((char *)zerovect,(char *)vect,8);
strcpy(linkname,"/NOWHERE/null");
@@ -980,13 +1081,22 @@ fhdelete(f,s)
@@ -980,13 +1082,22 @@ fhdelete(f,s)
char path[NFS_MAXPATHLEN+1];
char linkname[NFS_MAXPATHLEN+1];
int ret;
@ -301,7 +309,7 @@
/* note that we don't bother to check and see if there's a
handle allocated for this - just wait for the inode to be
reclaimed */
@@ -1001,13 +1111,21 @@ fhdeletedir(f,s)
@@ -1001,13 +1112,21 @@ fhdeletedir(f,s)
char *s;
{
char path[NFS_MAXPATHLEN+1];
@ -325,7 +333,7 @@
}
DIR *
@@ -1055,15 +1173,24 @@ fhdohardlink(f,t,n)
@@ -1055,15 +1174,24 @@ fhdohardlink(f,t,n)
char linkname[NFS_MAXPATHLEN+1];
char vectval[9];
int ret;
@ -352,7 +360,7 @@
unlink(linkname);
if (readlink(f->vectname,vectval,9) == 8) {
vectval[8]='\0';
@@ -1079,12 +1206,17 @@ fhdosymlink(f,n,t)
@@ -1079,12 +1207,17 @@ fhdosymlink(f,n,t)
char *t;
{
char buf[NFS_MAXPATHLEN+1];
@ -371,7 +379,7 @@
return (symlink(t,buf));
}
@@ -1100,15 +1232,32 @@ fhrename(f,fn,t,tn)
@@ -1100,15 +1233,32 @@ fhrename(f,fn,t,tn)
char fblink[NFS_MAXPATHLEN+1];
char tblink[NFS_MAXPATHLEN+1];
char vectval[9];
@ -408,7 +416,7 @@
if (rename(fb,tb)==0) { /* now we have to do a lookup */
unlink(tblink); /* may be a quick race cndtn here */
if (readlink(fblink,vectval,9)==8) {
@@ -1160,7 +1309,8 @@ rootrd(cookie)
@@ -1160,7 +1310,8 @@ rootrd(cookie)
} else while (cookie<(NINSTANCES+2)) {
if (instances[cookie-2] != NULL) {
if (instances[cookie-2]->anon)