[20] in The Cryptographic File System users list

home help back first fref pref prev next nref lref last post

Re: 1.4.0 under Linux?

daemon@ATHENA.MIT.EDU (Sean Sheedy)
Sun Dec 21 23:54:29 1997

From owner-cfs-users@research.att.com	 Sun Dec 21 23:54:23 1997
Received: from rumor.research.att.com (rumor.research.att.com [192.20.225.9]) by bloom-picayune.MIT.EDU (8.7.6/2.3JIK) with SMTP id XAA06058 for <cfs-mtg@bloom-picayune.mit.edu>; Sun, 21 Dec 1997 23:54:21 -0500
Received: from research.att.com ([135.207.30.100]) by rumor; Sun Dec 21 23:51:16 EST 1997
Received: from amontillado.research.att.com ([135.207.24.32]) by research-clone; Sun Dec 21 23:51:22 EST 1997
Received: from nsa.research.att.com (majordomo@nsa.research.att.com [135.207.24.155])
	by amontillado.research.att.com (8.8.7/8.8.7) with ESMTP id XAA25609;
	Sun, 21 Dec 1997 23:51:18 -0500 (EST)
Received: (from majordomo@localhost) by nsa.research.att.com (8.7.3/8.7.3) id XAA20535 for cfs-users-list; Sun, 21 Dec 1997 23:51:26 -0500 (EST)
X-Authentication-Warning: nsa.research.att.com: majordomo set sender to owner-cfs-users@nsa.research.att.com using -f
Received: from research.att.com (research-clone.research.att.com [135.207.30.100]) by nsa.research.att.com (8.7.3/8.7.3) with SMTP id XAA20499 for <cfs-users@nsa.research.att.com>; Sun, 21 Dec 1997 23:51:23 -0500 (EST)
Received: from firefly.rain.com ([206.103.35.38]) by research-clone; Sun Dec 21 23:50:23 EST 1997
Received: from firefly.rain.com (localhost [127.0.0.1]) by firefly.rain.com (8.7.5/8.7.3) with ESMTP id UAA04551; Sun, 21 Dec 1997 20:50:15 -0800
Message-ID: <349DF186.8CE7849D@firefly.rain.com>
Date: Sun, 21 Dec 1997 20:50:15 -0800
From: Sean Sheedy <seans@easystreet.com>
X-Mailer: Mozilla 4.04 [en] (X11; U; Linux 2.0.29 i586)
MIME-Version: 1.0
To: Matt Blaze <mab@research.att.com>
CC: cfs-users@nsa.research.att.com
Subject: Re: 1.4.0 under Linux?
References: <199712161711.MAA25547@nsa.research.att.com>
Content-Type: multipart/mixed; boundary="------------C2AA48EAF3B88858B44909FE"
Sender: owner-cfs-users@research.att.com
Precedence: bulk

This is a multi-part message in MIME format.
--------------C2AA48EAF3B88858B44909FE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Attached are my changes to CFS to allow it to build under Slackware Linux,
kernel version 2.0.29.  These changes remove the need for the
make_with_bad_rpcgen file.  Note that you must add -DLINUX_RPC to your
CFLAGS to turn on the rpcgen workarounds.  Build flags I used were:

CC=gcc
COPT=-O2 -m486 -DPROTOTYPES=1
CFLAGS=$(COPT) -DLINUX_RPC -I$(RINCLUDES)
LIBS=
COMPAT=
RPCOPTS=

Sean

--
Sean Sheedy                                     seans@easystreet.com

Every decent man is ashamed of the government he lives under.
        -- H.L. Mencken



--------------C2AA48EAF3B88858B44909FE
Content-Type: text/plain; charset=us-ascii; name="diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="diff"

*** cfs.c	1997/12/22 04:27:25	1.1
--- cfs.c	1997/12/22 04:29:40
***************
*** 47,52 ****
--- 47,55 ----
  void nfs_program_2();
  void adm_program_2();
  #include <string.h>
+ #elif defined(LINUX_RPC) && defined(PROTOTYPES)
+ void nfs_program_2(struct svc_req *, SVCXPRT *);
+ void adm_program_2(struct svc_req *, SVCXPRT *);
  #else
  int nfs_program_2();
  int adm_program_2();
*** cfs_adm.c	1997/12/22 04:27:31	1.1
--- cfs_adm.c	1997/12/22 04:34:22
***************
*** 36,49 ****
--- 36,62 ----
  }
  
  void *
+ #ifdef LINUX_RPC
+ admproc_null_2_svc(dummy1, dummy2)
+      void *dummy1;
+      SR dummy2;
+ #else
  admproc_null_2()
+ #endif
  {
+ 	return (void *)0;
  }
  
  cfsstat *
+ #ifdef LINUX_RPC
+ admproc_attach_2_svc(ap,rp)
+      cfs_attachargs *ap;
+      SR rp;
+ #else
  admproc_attach_2(ap,rp)
       cfs_attachargs *ap;
       SR *rp;
+ #endif
  {
  	static cfsstat ret;
  	int i;
***************
*** 141,147 ****
  {
  	unsigned int i;
  	char start[9];
- 	FILE *fp;
  
  	for (i=0; i < k->smsize; i+=CFSBLOCK) {
  		sprintf(start,"0%07x",i/CFSBLOCK);
--- 154,159 ----
***************
*** 154,162 ****
--- 166,180 ----
  }
  
  cfsstat *
+ #ifdef LINUX_RPC
+ admproc_detach_2_svc(ap,rp)
+      cfs_detachargs *ap;
+      SR rp;
+ #else
  admproc_detach_2(ap,rp)
       cfs_detachargs *ap;
       SR *rp;
+ #endif
  {
  	static cfsstat ret;
  	int i;
***************
*** 212,218 ****
  
  verify(path,k)
       char *path;
!      cfs_admkey *k;
  {
  	FILE *fp;
  	char fn[1024];
--- 230,236 ----
  
  verify(path,k)
       char *path;
!      cfskey *k;
  {
  	FILE *fp;
  	char fn[1024];
*** cfs_nfs.c	1997/12/22 04:27:39	1.1
--- cfs_nfs.c	1997/12/22 04:35:58
***************
*** 58,64 ****
--- 58,68 ----
  }
  
  void *
+ #ifdef LINUX_RPC
+ nfsproc_null_2_svc(ap,rp)
+ #else
  nfsproc_null_2(ap,rp)
+ #endif
       void *ap;
       SR rp;
  {
***************
*** 72,78 ****
--- 76,86 ----
  readdirres *rootreaddir();
  
  attrstat *
+ #ifdef LINUX_RPC
+ nfsproc_getattr_2_svc(ap,rp)
+ #else
  nfsproc_getattr_2(ap,rp)
+ #endif
       nfs_fh *ap;
       SR rp;
  {
***************
*** 118,124 ****
--- 126,136 ----
  }
  
  attrstat *
+ #ifdef LINUX_RPC
+ nfsproc_setattr_2_svc(ap,rp)
+ #else
  nfsproc_setattr_2(ap,rp)
+ #endif
       sattrargs *ap;
       SR rp;
  {
***************
*** 168,174 ****
--- 180,190 ----
  }
  
  void *
+ #ifdef LINUX_RPC
+ nfsproc_root_2_svc(ap,rp)
+ #else
  nfsproc_root_2(ap,rp)
+ #endif
       void *ap;
       SR rp;
  {
***************
*** 179,185 ****
--- 195,205 ----
  
  /* fix this to deal w/ fs root (instance root should be ok) */
  diropres *
+ #ifdef LINUX_RPC
+ nfsproc_lookup_2_svc(ap,rp)
+ #else
  nfsproc_lookup_2(ap,rp)
+ #endif
       diropargs *ap;
       SR rp;
  {
***************
*** 227,233 ****
  		ret.status=cfsno(errno);
  	else if ((s=encryptname(key,ap->name))==NULL)
  		ret.status=NFSERR_NOENT;
! 	else switch (fhlook(h,s,handle)) {
  	    /* fhlook might update the underlying name associated with the
  	       handle, or delete the handle */
  	    case 0:	/* found it */
--- 247,253 ----
  		ret.status=cfsno(errno);
  	else if ((s=encryptname(key,ap->name))==NULL)
  		ret.status=NFSERR_NOENT;
! 	else switch (fhlook(h,s,(fhdata *)handle)) {
  	    /* fhlook might update the underlying name associated with the
  	       handle, or delete the handle */
  	    case 0:	/* found it */
***************
*** 258,264 ****
--- 278,288 ----
  }
  
  readlinkres *
+ #ifdef LINUX_RPC
+ nfsproc_readlink_2_svc(ap,rp)
+ #else
  nfsproc_readlink_2(ap,rp)
+ #endif
       nfs_fh *ap;
       SR rp;
  {
***************
*** 309,315 ****
--- 333,343 ----
  
  
  readres *
+ #ifdef LINUX_RPC
+ nfsproc_read_2_svc(ap,rp)
+ #else
  nfsproc_read_2(ap,rp)
+ #endif
       readargs *ap;
       SR rp;
  {
***************
*** 370,376 ****
--- 398,408 ----
  
  
  void *
+ #ifdef LINUX_RPC
+ nfsproc_writecache_2_svc(ap,rp)
+ #else
  nfsproc_writecache_2(ap,rp)
+ #endif
       void *ap;
       SR rp;
  {
***************
*** 381,387 ****
--- 413,423 ----
  
  
  attrstat *
+ #ifdef LINUX_RPC
+ nfsproc_write_2_svc(ap,rp)
+ #else
  nfsproc_write_2(ap,rp)
+ #endif
       writeargs *ap;
       SR rp;
  {
***************
*** 442,448 ****
--- 478,488 ----
  
  
  diropres *
+ #ifdef LINUX_RPC
+ nfsproc_create_2_svc(ap,rp)
+ #else
  nfsproc_create_2(ap,rp)
+ #endif
       createargs *ap;
       SR rp;
  {
***************
*** 477,483 ****
  	/* if one already exist, the underlying handle name field gets
  	   updated to reflect its new name */
  	s=encryptname(keyof(h),ap->where.name);
! 	switch (fhmkfileent(h,s,&handle)) {
  	    case 0: /* didnt exist */
  		switch (fhsetattr(h2=geth(&handle),&ap->attributes)) {
  		    case 0:	/* ok */
--- 517,523 ----
  	/* if one already exist, the underlying handle name field gets
  	   updated to reflect its new name */
  	s=encryptname(keyof(h),ap->where.name);
! 	switch (fhmkfileent(h,s,(fhdata *)&handle)) {
  	    case 0: /* didnt exist */
  		switch (fhsetattr(h2=geth(&handle),&ap->attributes)) {
  		    case 0:	/* ok */
***************
*** 545,551 ****
--- 585,595 ----
  
  
  nfsstat *
+ #ifdef LINUX_RPC
+ nfsproc_remove_2_svc(ap,rp)
+ #else
  nfsproc_remove_2(ap,rp)
+ #endif
       diropargs *ap;
       SR rp;
  {
***************
*** 587,593 ****
--- 631,641 ----
  
  
  nfsstat *
+ #ifdef LINUX_RPC
+ nfsproc_rename_2_svc(ap,rp)
+ #else
  nfsproc_rename_2(ap,rp)
+ #endif
       renameargs *ap;
       SR rp;
  {
***************
*** 643,649 ****
--- 691,701 ----
  
  
  nfsstat *
+ #ifdef LINUX_RPC
+ nfsproc_link_2_svc(ap,rp)
+ #else
  nfsproc_link_2(ap,rp)
+ #endif
       linkargs *ap;
       SR rp;
  {
***************
*** 694,700 ****
--- 746,756 ----
  
  
  nfsstat *
+ #ifdef LINUX_RPC
+ nfsproc_symlink_2_svc(ap,rp)
+ #else
  nfsproc_symlink_2(ap,rp)
+ #endif
       symlinkargs *ap;
       SR rp;
  {
***************
*** 743,749 ****
--- 799,809 ----
  }
  
  diropres *
+ #ifdef LINUX_RPC
+ nfsproc_mkdir_2_svc(ap,rp)
+ #else
  nfsproc_mkdir_2(ap,rp)
+ #endif
       createargs *ap;
       SR rp;
  {
***************
*** 753,759 ****
  	int uid;
  	int ht;
  	cfs_fileid *h, *h2;
- 	char *k;
  
  #ifdef DEBUG
  	printf("mkdir:\n");
--- 813,818 ----
***************
*** 776,782 ****
  	   updated to reflect its new name */
  
  	s=encryptname(keyof(h),ap->where.name);
! 	switch (fhmkdirent(h,s,&handle)) {
  	    case 0:
  		switch (fhsetattr(h2=geth(&handle),&ap->attributes)) {
  		    case 0:	/* ok */
--- 835,841 ----
  	   updated to reflect its new name */
  
  	s=encryptname(keyof(h),ap->where.name);
! 	switch (fhmkdirent(h,s,(fhdata *)&handle)) {
  	    case 0:
  		switch (fhsetattr(h2=geth(&handle),&ap->attributes)) {
  		    case 0:	/* ok */
***************
*** 817,823 ****
--- 876,886 ----
  
  
  nfsstat *
+ #ifdef LINUX_RPC
+ nfsproc_rmdir_2_svc(ap,rp)
+ #else
  nfsproc_rmdir_2(ap,rp)
+ #endif
       diropargs *ap;
       SR rp;
  {
***************
*** 864,870 ****
--- 927,937 ----
  /* #define cfsclosedir(x) fhclosedir(x) */
  
  readdirres *
+ #ifdef LINUX_RPC
+ nfsproc_readdir_2_svc(ap,rp)
+ #else
  nfsproc_readdir_2(ap,rp)
+ #endif
       readdirargs *ap;
       SR rp;
  {
***************
*** 877,884 ****
  	static DIR *dp=NULL;
  	static struct dirent *dent;
  	entry **prev;
- 	long loc;
- 	char s1[NFS_MAXNAMLEN+1];
  	char *s;
  	cfskey *key;
  	static long curcookie=0;
--- 944,949 ----
***************
*** 991,997 ****
--- 1056,1066 ----
  }
  
  statfsres *
+ #ifdef LINUX_RPC
+ nfsproc_statfs_2_svc(ap,rp)
+ #else
  nfsproc_statfs_2(ap,rp)
+ #endif
       nfs_fh *ap;
       SR rp;
  {
***************
*** 1155,1161 ****
  	int eof;
  	int ne;
  	int bytes;
- 	cfs_fileid *h;
  	struct dirent *dent;
  	struct dirent *rootrd();
  
--- 1224,1229 ----
***************
*** 1196,1204 ****
  goodsrc(rp)
       SR rp;
  {
- 	struct in_addr ia;
- 	struct in_addr *ip;
- 
  	if (svc_getcaller(rp->rq_xprt)->sin_addr.s_addr != validhost.s_addr) {
  		fprintf(stderr,"bad addr! %x !- %x\n",
  		  svc_getcaller(rp->rq_xprt)->sin_addr.s_addr,validhost.s_addr);
--- 1264,1269 ----

--------------C2AA48EAF3B88858B44909FE--


home help back first fref pref prev next nref lref last post