edmoy@violet.berkeley.edu (Edward Moy) (06/03/89)
[New Patches to CAP - part 1 of 2] CAP is a set of UNIX programs from Columbia University that allow UNIX machines to act as AppleShare file servers and LaserWriter spoolers. It also provides a set of libraries for programmer to write their own AppleTalk applications. CAP requires a Kinetic FastPath running the KIP code from Stanford or the K-Star code from Kinetics, which both encapsulate the AppleTalk packets in UDP before putting them on the ethernet. --- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # # README # Configure.diff # abasp.c.diff # abatp.c.diff # abkip.c.diff # afpc.c.diff # afpcmd.h.diff # afpdid.c.diff # afpdir.c.diff # afpdt.c.diff # afposenum.c.diff # afposfi.c.diff # afps.h.diff # afpserver.c.diff # atalkdbm.c.diff # atis.c.diff # papof.c.diff # # This archive created: Sat Jun 3 07:29:27 1989 # By: Roger L. Long (bytebug@dhw68k.cts.com) # export PATH; PATH=/bin:$PATH echo shar: extracting "'README'" '(1318 characters)' if test -f 'README' then echo shar: will not over-write existing file "'README'" else sed 's/^X//' << \SHAR_EOF > 'README' XThe patches included in this distribution contain the following: X X1) In AUFS, #ifdef SIZESERVER lines that allow 4.3BSD systems to show volume Xinfo (previously distributed as sizeserver.shar; needs additional code to Xuse this). X X2) In AUFS, #ifdef NOCASEMATCH lines that fixes the case sensitivity of UNIX X(Mac filesystems are case-insensitive). There is some performance degradation, Xespecially when the filename to search for has modified case, like the way XHyperCard 1.2.1 changes the case of letters in a stack name. X X3) CAP now compilies under GCC. Various changes were made to fix incompatibil- Xities with the preprocessors, as well as to silence various warning messages. XThe -DGNUCC flags needs to be given to the compiler. X X4) On NeXT machines (with GCC), Configure has been modified so that "next" can Xbe given as an OS type. It automatically adds -DGNUCC to the C compilier Xflags. (I don't know how to detect a NeXT machine in the Configure script, Xespecially since the entire filesystem may change between 0.8 and 0.9.) X X5) Various minor code enhancements, with no change in functionality. X XEdward Moy Principal Programmer - Macintosh & Unix XWorkstation Support Services Workstation Software Support Group XUniversity of California XBerkeley, CA 94720 X Xedmoy@violet.Berkeley.EDU Xucbvax!violet!edmoy SHAR_EOF if test 1318 -ne "`wc -c < 'README'`" then echo shar: error transmitting "'README'" '(should have been 1318 characters)' fi fi # end of overwriting check echo shar: extracting "'Configure.diff'" '(2258 characters)' if test -f 'Configure.diff' then echo shar: will not over-write existing file "'Configure.diff'" else sed 's/^X//' << \SHAR_EOF > 'Configure.diff' X*** Configure.orig Thu Feb 9 21:01:00 1989 X--- Configure Thu Feb 9 21:01:50 1989 X*************** X*** 141,146 X "aux") valid=1;; X "pyr") valid=1;; X "sunos") valid=1;; X "?"|*) X if [ "${os}" != "?" ]; then X echo "unknown type ${os}, valid are:" X X--- 141,147 ----- X "aux") valid=1;; X "pyr") valid=1;; X "sunos") valid=1;; X+ "next") valid=1;; X "?"|*) X if [ "${os}" != "?" ]; then X echo "unknown type ${os}, valid are:" X*************** X*** 152,157 X echo " aux - A/UX"; X echo " pyr - pyramid"; X echo " sunos - suns"; X ;; X esac X done X X--- 153,159 ----- X echo " aux - A/UX"; X echo " pyr - pyramid"; X echo " sunos - suns"; X+ echo " next - NeXT/MACH"; X ;; X esac X done X*************** X*** 299,304 X # "aux" - A/UX X # "pyr" - pyramid (in BSD universe) X # "sunos" - SunOS X # Warning: hpux, pyr are hardcoded in some of the makefiles (sorry) X X # MAJOR CONFIGURATION X X--- 301,307 ----- X # "aux" - A/UX X # "pyr" - pyramid (in BSD universe) X # "sunos" - SunOS X+ # "next" - NeXT/MACH X # Warning: hpux, pyr are hardcoded in some of the makefiles (sorry) X X # MAJOR CONFIGURATION X*************** X*** 448,453 X os,[hpux],[HP-UX (for 9000 series)], X os,[bsd],[Standard BSD], X os,[pyr],[Pyramid in BSD universe], X [Unknown])) X define([cflags],ifdef([selfdefinetypes],[-O -D_TYPES],[-O])) X define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000])) X X--- 451,457 ----- X os,[hpux],[HP-UX (for 9000 series)], X os,[bsd],[Standard BSD], X os,[pyr],[Pyramid in BSD universe], X+ os,[next],[NeXT/MACH], X [Unknown])) X define([cflags],ifdef([selfdefinetypes],[-O -D_TYPES],[-O])) X define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000])) X*************** X*** 453,458 X define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000])) X ifelse(os,[pyr],[ X define([cflags],concat(cflags,[ -q]))]) X # was used for nbp, but found we needed more... leave in case X define([nbpflags],[]) X X X--- 457,464 ----- X define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000])) X ifelse(os,[pyr],[ X define([cflags],concat(cflags,[ -q]))]) X+ ifelse(os,[next],[ X+ define([cflags],concat(cflags,[ -DGNUCC]))]) X # was used for nbp, but found we needed more... leave in case X define([nbpflags],[]) X SHAR_EOF if test 2258 -ne "`wc -c < 'Configure.diff'`" then echo shar: error transmitting "'Configure.diff'" '(should have been 2258 characters)' fi fi # end of overwriting check echo shar: extracting "'abasp.c.diff'" '(2206 characters)' if test -f 'abasp.c.diff' then echo shar: will not over-write existing file "'abasp.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'abasp.c.diff' X*** lib/cap/abasp.c.orig Thu May 19 12:16:31 1988 X--- lib/cap/abasp.c Fri Jan 27 14:50:59 1989 X*************** X*** 25,33 X #include "abasp.h" X X int aspInit(); X! SPGetParms(); X! SPInit(); X! SPGetNetworkInfo(); X private void handle_aspserver(); X private void asp_doopensess(); X private void sessopenreply(); X X--- 25,33 ----- X #include "abasp.h" X X int aspInit(); X! int SPGetParms(); X! int SPInit(); X! int SPGetNetworkInfo(); X private void handle_aspserver(); X private void asp_doopensess(); X private void sessopenreply(); X*************** X*** 31,41 X private void handle_aspserver(); X private void asp_doopensess(); X private void sessopenreply(); X! SPGetSession(); X! SPCloseSession(); X! SPGetRequest(); X! SPCmdReply(); X! SPWrtReply(); X private int spreply(); X SPWrtContinue(); X SPNewStatus(); X X--- 31,41 ----- X private void handle_aspserver(); X private void asp_doopensess(); X private void sessopenreply(); X! int SPGetSession(); X! int SPCloseSession(); X! int SPGetRequest(); X! int SPCmdReply(); X! int SPWrtReply(); X private int spreply(); X int SPWrtContinue(); X int SPNewStatus(); X*************** X*** 37,45 X SPCmdReply(); X SPWrtReply(); X private int spreply(); X! SPWrtContinue(); X! SPNewStatus(); X! SPAttention(); X X SPGetStatus(); X SPOpenSession(); X X--- 37,45 ----- X int SPCmdReply(); X int SPWrtReply(); X private int spreply(); X! int SPWrtContinue(); X! int SPNewStatus(); X! int SPAttention(); X X int SPGetStatus(); X int SPOpenSession(); X*************** X*** 41,48 X SPNewStatus(); X SPAttention(); X X! SPGetStatus(); X! SPOpenSession(); X private void handle_aspclient(); X SPCommand(); X SPWrite(); X X--- 41,48 ----- X int SPNewStatus(); X int SPAttention(); X X! int SPGetStatus(); X! int SPOpenSession(); X private void handle_aspclient(); X int SPCommand(); X int SPWrite(); X*************** X*** 44,51 X SPGetStatus(); X SPOpenSession(); X private void handle_aspclient(); X! SPCommand(); X! SPWrite(); X private void asp_do_write(); X X private void handle_asp_sndreq(); X X--- 44,51 ----- X int SPGetStatus(); X int SPOpenSession(); X private void handle_aspclient(); X! int SPCommand(); X! int SPWrite(); X private void asp_do_write(); X X private void handle_asp_sndreq(); SHAR_EOF if test 2206 -ne "`wc -c < 'abasp.c.diff'`" then echo shar: error transmitting "'abasp.c.diff'" '(should have been 2206 characters)' fi fi # end of overwriting check echo shar: extracting "'abatp.c.diff'" '(448 characters)' if test -f 'abatp.c.diff' then echo shar: will not over-write existing file "'abatp.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'abatp.c.diff' X*** lib/cap/abatp.c.orig Thu May 19 12:16:35 1988 X--- lib/cap/abatp.c Fri Jan 27 14:49:11 1989 X*************** X*** 83,88 X {(caddr_t)&atph, atpSize}, /* atp */ X {(caddr_t)atpdata, atpMaxData} /* atp user data */ X }; X X /* X * ATPSndRequest X X--- 83,90 ----- X {(caddr_t)&atph, atpSize}, /* atp */ X {(caddr_t)atpdata, atpMaxData} /* atp user data */ X }; X+ private delete_tcb_skt(); X+ private int ATPWrite(); X X /* X * ATPSndRequest SHAR_EOF if test 448 -ne "`wc -c < 'abatp.c.diff'`" then echo shar: error transmitting "'abatp.c.diff'" '(should have been 448 characters)' fi fi # end of overwriting check echo shar: extracting "'abkip.c.diff'" '(710 characters)' if test -f 'abkip.c.diff' then echo shar: will not over-write existing file "'abkip.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'abkip.c.diff' X*** lib/cap/abkip.c.orig Thu May 19 12:16:50 1988 X--- lib/cap/abkip.c Fri Jan 27 14:55:42 1989 X*************** X*** 278,284 X return(ddpSktErr); X for (i=0; i < 128; i++,ipskt++,(*skt)++) { X lsin.sin_port = htons(ipskt); X! if ((err = bind(fd, (caddr_t)&lsin, sizeof(lsin))) == 0) X break; X if (rskt != 0) /* bind failed and wanted exact? */ X return(err); /* yes... */ X X--- 278,284 ----- X return(ddpSktErr); X for (i=0; i < 128; i++,ipskt++,(*skt)++) { X lsin.sin_port = htons(ipskt); X! if ((err = bind(fd, (struct sockaddr *)&lsin, sizeof(lsin))) == 0) X break; X if (rskt != 0) /* bind failed and wanted exact? */ X return(err); /* yes... */ SHAR_EOF if test 710 -ne "`wc -c < 'abkip.c.diff'`" then echo shar: error transmitting "'abkip.c.diff'" '(should have been 710 characters)' fi fi # end of overwriting check echo shar: extracting "'afpc.c.diff'" '(1428 characters)' if test -f 'afpc.c.diff' then echo shar: will not over-write existing file "'afpc.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpc.c.diff' X*** lib/afpc/afpc.c.orig Thu May 19 12:17:22 1988 X--- lib/afpc/afpc.c Thu Jan 26 15:36:31 1989 X*************** X*** 286,292 X { X char lbuf[sizeof(FlushPkt)+1]; X int len; X! extern PackEntry ProtoFVP[]; X X len = htonPackX(ProtoCFP, fv, lbuf); X X X--- 286,292 ----- X { X char lbuf[sizeof(FlushPkt)+1]; X int len; X! extern PackEntry ProtoCFP[]; X X len = htonPackX(ProtoCFP, fv, lbuf); X X*************** X*** 319,325 X char lbuf[sizeof(GetAPPLPkt)+1]; X char buf[sizeof(GetAPPLReplyPkt)+1]; X int rlen, comp, len; X! extern PackEntry ProtoGAP[], ProtoGAPR[]; X X len = htonPackX(ProtoGAP, gap, lbuf); X SPCommand(srn,lbuf,len,buf,sizeof(GetAPPLReplyPkt),cr,&rlen,-1,&comp); X X--- 319,325 ----- X char lbuf[sizeof(GetAPPLPkt)+1]; X char buf[sizeof(GetAPPLReplyPkt)+1]; X int rlen, comp, len; X! extern PackEntry ProtoGAP[], ProtoGAPR[], ProtoFileAttr[]; X X len = htonPackX(ProtoGAP, gap, lbuf); X SPCommand(srn,lbuf,len,buf,sizeof(GetAPPLReplyPkt),cr,&rlen,-1,&comp); X*************** X*** 714,720 X word *refnum; X dword *cr; X { X! extern PackEntry ProtoOFkP[]; X byte lbuf[sizeof(OpenForkPkt)], buf[sizeof(FileDirParm)+20], *p; X int rlen, comp, len; X word bitmap; X X--- 714,720 ----- X word *refnum; X dword *cr; X { X! extern PackEntry ProtoOFkP[], ProtoFileAttr[]; X byte lbuf[sizeof(OpenForkPkt)], buf[sizeof(FileDirParm)+20], *p; X int rlen, comp, len; X word bitmap; SHAR_EOF if test 1428 -ne "`wc -c < 'afpc.c.diff'`" then echo shar: error transmitting "'afpc.c.diff'" '(should have been 1428 characters)' fi fi # end of overwriting check echo shar: extracting "'afpcmd.h.diff'" '(3235 characters)' if test -f 'afpcmd.h.diff' then echo shar: will not over-write existing file "'afpcmd.h.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpcmd.h.diff' X*** netat/afpcmd.h.orig Thu May 19 12:16:16 1988 X--- netat/afpcmd.h Fri Jan 27 12:52:44 1989 X*************** X*** 624,629 X /* Pack(pointer, type of data, scalar result field) */ X #define PACK(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0} X /* Paks(pointer, type of data, array result field) */ X #define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0} X /* Both require that a "type of data" field type P_BMAP be set first */ X /* pakb(pointer, type of data, scalar result field, bit of bitmap */ X X--- 624,632 ----- X /* Pack(pointer, type of data, scalar result field) */ X #define PACK(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0} X /* Paks(pointer, type of data, array result field) */ X+ #ifdef GNUCC X+ #define PAKS(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0} X+ #else GNUCC X #define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0} X #endif GNUCC X /* Both require that a "type of data" field type P_BMAP be set first */ X*************** X*** 625,630 X #define PACK(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0} X /* Paks(pointer, type of data, array result field) */ X #define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0} X /* Both require that a "type of data" field type P_BMAP be set first */ X /* pakb(pointer, type of data, scalar result field, bit of bitmap */ X #define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X X--- 628,634 ----- X #define PAKS(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0} X #else GNUCC X #define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0} X+ #endif GNUCC X /* Both require that a "type of data" field type P_BMAP be set first */ X /* pakb(pointer, type of data, scalar result field, bit of bitmap */ X #define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X*************** X*** 629,634 X /* pakb(pointer, type of data, scalar result field, bit of bitmap */ X #define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X /* pksb(pointer, type of data, array result field, bit of bitmap */ X #define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b} X X /* Pack even - to mark that we should be on even boundary */ X X--- 633,641 ----- X /* pakb(pointer, type of data, scalar result field, bit of bitmap */ X #define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X /* pksb(pointer, type of data, array result field, bit of bitmap */ X+ #ifdef GNUCC X+ #define PKSB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X+ #else GNUCC X #define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b} X #endif GNUCC X X*************** X*** 630,635 X #define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X /* pksb(pointer, type of data, array result field, bit of bitmap */ X #define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b} X X /* Pack even - to mark that we should be on even boundary */ X #define PACKEVEN() {P_EVEN, 0, 0, 0} X X--- 637,643 ----- X #define PKSB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X #else GNUCC X #define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b} X+ #endif GNUCC X X /* Pack even - to mark that we should be on even boundary */ X #define PACKEVEN() {P_EVEN, 0, 0, 0} SHAR_EOF if test 3235 -ne "`wc -c < 'afpcmd.h.diff'`" then echo shar: error transmitting "'afpcmd.h.diff'" '(should have been 3235 characters)' fi fi # end of overwriting check echo shar: extracting "'afpdid.c.diff'" '(1305 characters)' if test -f 'afpdid.c.diff' then echo shar: will not over-write existing file "'afpdid.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpdid.c.diff' X*** applications/aufs/afpdid.c.orig Thu May 19 12:19:31 1988 X--- applications/aufs/afpdid.c Thu Jan 26 18:19:33 1989 X*************** X*** 85,90 X int xd_idsize; /* size of idirs array */ X } ExtDir; X X /* X * nfind scans and finds whether a particular directory "dir" has a X * subdirectory by the name "nam" X X--- 85,93 ----- X int xd_idsize; /* size of idirs array */ X } ExtDir; X X+ private char *ipathstr(); X+ private sdword NewEDirid(); X+ X /* X * nfind scans and finds whether a particular directory "dir" has a X * subdirectory by the name "nam" X*************** X*** 112,118 X char *name; X { X IDirP dir; X- sdword NewEDirid(); X X dir = (IDirP) malloc(sizeof(IDir)); X dir->name = (char *) malloc((unsigned) strlen(name)+1); X X--- 115,120 ----- X char *name; X { X IDirP dir; X X dir = (IDirP) malloc(sizeof(IDir)); X dir->name = (char *) malloc((unsigned) strlen(name)+1); X*************** X*** 162,168 X IDirP cd; X { X static char paths[MAXPATHLEN]; X- char *ipathstr(); X X if (lastcd == cd) /* same as last request? */ X return(paths); /* yes.. just return old paths */ X X--- 164,169 ----- X IDirP cd; X { X static char paths[MAXPATHLEN]; X X if (lastcd == cd) /* same as last request? */ X return(paths); /* yes.. just return old paths */ SHAR_EOF if test 1305 -ne "`wc -c < 'afpdid.c.diff'`" then echo shar: error transmitting "'afpdid.c.diff'" '(should have been 1305 characters)' fi fi # end of overwriting check echo shar: extracting "'afpdir.c.diff'" '(459 characters)' if test -f 'afpdir.c.diff' then echo shar: will not over-write existing file "'afpdir.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpdir.c.diff' X*** applications/aufs/afpdir.c.orig Thu May 19 12:19:33 1988 X--- applications/aufs/afpdir.c Thu Jan 26 18:17:19 1989 X*************** X*** 43,48 X #include "afpntoh.h" X #include "afps.h" /* common server header */ X X /* X * OSErr FPGetDirParms(byte *p,byte *r,int *rl) X * X X--- 43,50 ----- X #include "afpntoh.h" X #include "afps.h" /* common server header */ X X+ private int EnumPack(); X+ X /* X * OSErr FPGetDirParms(byte *p,byte *r,int *rl) X * SHAR_EOF if test 459 -ne "`wc -c < 'afpdir.c.diff'`" then echo shar: error transmitting "'afpdir.c.diff'" '(should have been 459 characters)' fi fi # end of overwriting check echo shar: extracting "'afpdt.c.diff'" '(391 characters)' if test -f 'afpdt.c.diff' then echo shar: will not over-write existing file "'afpdt.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpdt.c.diff' X*** applications/aufs/afpdt.c.orig Thu May 19 12:19:36 1988 X--- applications/aufs/afpdt.c Thu Jan 26 18:15:43 1989 X*************** X*** 81,86 X #define REMOVEAPPLIDB 0 X #define REMOVEICONIDB 1 X X /* X * PrintINode(AVLUData *node) X * X X--- 81,88 ----- X #define REMOVEAPPLIDB 0 X #define REMOVEICONIDB 1 X X+ private ReadIDesk(), ReadADesk(); X+ X /* X * PrintINode(AVLUData *node) X * SHAR_EOF if test 391 -ne "`wc -c < 'afpdt.c.diff'`" then echo shar: error transmitting "'afpdt.c.diff'" '(should have been 391 characters)' fi fi # end of overwriting check echo shar: extracting "'afposenum.c.diff'" '(7261 characters)' if test -f 'afposenum.c.diff' then echo shar: will not over-write existing file "'afposenum.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afposenum.c.diff' X*** applications/aufs/afposenum.c.orig Thu May 19 12:19:54 1988 X--- applications/aufs/afposenum.c Fri Dec 9 11:13:30 1988 X*************** X*** 29,34 X #include <sys/time.h> X #include <netat/appletalk.h> X #include <netat/afp.h> X #include "afps.h" X #include "afpdt.h" X #include "afpgc.h" X X--- 29,35 ----- X #include <sys/time.h> X #include <netat/appletalk.h> X #include <netat/afp.h> X+ #include <strings.h> X #include "afps.h" X #include "afpdt.h" X #include "afpgc.h" X*************** X*** 57,62 X private void EC_Free(); X private iselect(); X X /* X * int iselect(struct direct *d) X * X X--- 58,68 ----- X private void EC_Free(); X private iselect(); X X+ #ifdef NOCASEMATCH X+ private noCaseDir(); X+ private searchDirectory(); X+ #endif NOCASEMATCH X+ X /* X * int iselect(struct direct *d) X * X*************** X*** 426,433 X X OSfname(r,idir,fn,typ) X IDirP idir; X! char *fn,*r; X! int typ; X { X char *p; X X X--- 432,439 ----- X X OSfname(r,idir,fn,typ) X IDirP idir; X! register char *fn,*r; X! register int typ; X { X register char *p; X X*************** X*** 429,435 X char *fn,*r; X int typ; X { X! char *p; X X for (p = pathstr(idir); *p != '\0';) /* copy the directory */ X *r++ = *p++; X X--- 435,441 ----- X register char *fn,*r; X register int typ; X { X! register char *p; X X for (p = pathstr(idir); *p != '\0';) /* copy the directory */ X *r++ = *p++; X*************** X*** 434,442 X for (p = pathstr(idir); *p != '\0';) /* copy the directory */ X *r++ = *p++; X X- if (typ != F_DATA) X- *r++ = '/'; X- X if (typ == F_RSRC || typ == F_FNDR) /* append directory names */ X for (p = ((typ == F_RSRC) ? RFDIRFN : FIDIRFN); *p != '\0'; ) X *r++ = *p++; X X--- 440,445 ----- X for (p = pathstr(idir); *p != '\0';) /* copy the directory */ X *r++ = *p++; X X if (typ == F_RSRC || typ == F_FNDR) /* append directory names */ X for (p = ((typ == F_RSRC) ? RFDIR : FIDIR); *p != '\0'; ) X *r++ = *p++; X*************** X*** 438,444 X *r++ = '/'; X X if (typ == F_RSRC || typ == F_FNDR) /* append directory names */ X! for (p = ((typ == F_RSRC) ? RFDIRFN : FIDIRFN); *p != '\0'; ) X *r++ = *p++; X X if (*fn != '\0') /* add slash */ X X--- 441,447 ----- X *r++ = *p++; X X if (typ == F_RSRC || typ == F_FNDR) /* append directory names */ X! for (p = ((typ == F_RSRC) ? RFDIR : FIDIR); *p != '\0'; ) X *r++ = *p++; X X if (*fn != '\0') { /* add slash */ X*************** X*** 441,447 X for (p = ((typ == F_RSRC) ? RFDIRFN : FIDIRFN); *p != '\0'; ) X *r++ = *p++; X X! if (*fn != '\0') /* add slash */ X *r++ = '/'; /* if not null file */ X while (*fn != '\0') X *r++ = *fn++; X X--- 444,450 ----- X for (p = ((typ == F_RSRC) ? RFDIR : FIDIR); *p != '\0'; ) X *r++ = *p++; X X! if (*fn != '\0') { /* add slash */ X *r++ = '/'; /* if not null file */ X while (*fn != '\0') X *r++ = *fn++; X*************** X*** 443,450 X X if (*fn != '\0') /* add slash */ X *r++ = '/'; /* if not null file */ X! while (*fn != '\0') X! *r++ = *fn++; X *r = '\0'; X } X X X--- 446,454 ----- X X if (*fn != '\0') { /* add slash */ X *r++ = '/'; /* if not null file */ X! while (*fn != '\0') X! *r++ = *fn++; X! } X *r = '\0'; X } X X*************** X*** 447,452 X *r++ = *fn++; X *r = '\0'; X } X- X X X X--- 451,456 ----- X } X *r = '\0'; X } X X toResFork(str, fn) X register char *str; X*************** X*** 449,452 X } X X X X X--- 452,462 ----- X *r = '\0'; X } X X+ toResFork(str, fn) X+ register char *str; X+ char *fn; X+ { X+ register char *fp, *tp; X X if(*fn) { /* a real file */ X if(fp = rindex(str, '/')) /* skip over last slash */ X*************** X*** 450,452 X X X X X--- 458,617 ----- X { X register char *fp, *tp; X X+ if(*fn) { /* a real file */ X+ if(fp = rindex(str, '/')) /* skip over last slash */ X+ fp++; X+ else X+ fp = str; X+ str = fp; X+ fp = str + strlen(str); X+ tp = fp + DIRRFLEN; X+ *tp = 0; X+ while(fp > str) /* move filename, leaving space for .resource */ X+ *--tp = *--fp; X+ fp = DIRRF; X+ while(*fp) X+ *str++ = *fp++; X+ } else /* a directory */ X+ strcat(str,RFDIR); /* just append .resource */ X+ } X+ X+ toFinderInfo(str, fn) X+ register char *str; X+ char *fn; X+ { X+ register char *fp, *tp; X+ X+ if(*fn) { /* a real file */ X+ if(fp = rindex(str,'/')) /* skip over last slash */ X+ fp++; X+ else X+ fp = str; X+ str = fp; X+ fp = str + strlen(str); X+ tp = fp + DIRFILEN; X+ *tp = 0; X+ while(fp > str) /* move filename, leaving space for .finderinfo */ X+ *--tp = *--fp; X+ fp = DIRFI; X+ while(*fp) X+ *str++ = *fp++; X+ } else /* a directory */ X+ strcat(str,FIDIR); /* just append .finderinfo */ X+ } X+ X+ #ifdef NOCASEMATCH X+ #include <sys/file.h> X+ #include <ctype.h> X+ X+ /* X+ * searchDirectory(dir, name) X+ * Do a case insensitive search for name in dir, and write the true name X+ * of the file in name. X+ */ X+ X+ private X+ searchDirectory(dir, name) X+ char *dir, *name; X+ { X+ register char *fp, *tp; X+ register DIR *dp; X+ register struct direct *d; X+ register int len; X+ char lname[BUFSIZ], dname[BUFSIZ]; X+ X+ if((dp = opendir(dir)) == NULL) X+ return(0); X+ len = 0; X+ for(fp = name, tp = lname ; *fp ; fp++) { X+ *tp++ = isupper(*fp) ? tolower(*fp) : *fp; X+ len++; X+ } X+ *tp = 0; X+ while(d = readdir(dp)) { X+ if(d->d_namlen != len) X+ continue; X+ for(fp = d->d_name, tp = dname ; *fp ; fp++) X+ *tp++ = isupper(*fp) ? tolower(*fp) : *fp; X+ *tp = 0; X+ if(strcmp(dname, lname) == 0) { X+ strcpy(name, d->d_name); X+ closedir(dp); X+ return(1); X+ } X+ } X+ closedir(dp); X+ return(0); X+ } X+ X+ /* X+ * noCaseDir(path) X+ * Recursively verify the components of path. X+ */ X+ X+ private X+ noCaseDir(path) X+ register char *path; X+ { X+ register char *last; X+ register int status; X+ X+ if(access(path, F_OK) >= 0) X+ return(1); X+ if(last = rindex(path, '/')) { X+ if(last == path) X+ return(searchDirectory("/", last + 1)); X+ else { X+ *last++ = 0; X+ status = 0; X+ if(noCaseDir(path)) X+ status = searchDirectory(path, last); X+ *--last = '/'; X+ return(status); X+ } X+ } X+ return(searchDirectory(".", path)); X+ } X+ X+ /* X+ * noCaseFind(path) X+ * noCaseFind() calls noCaseDir() and searchDirectory() recursively to X+ * take path (case insensitive) and converts it to (case sensitive) newpath X+ * corresponding to the true Unix filename. This is mainly to fix X+ * HyperCard doing funny things to stack names. X+ */ X+ X+ void X+ noCaseFind(path) X+ register char *path; X+ { X+ register char *last; X+ X+ if(last = rindex(path, '/')) { X+ if(last == path) X+ searchDirectory("/", last + 1); X+ else { X+ *last++ = 0; X+ if(noCaseDir(path)) X+ searchDirectory(path, last); X+ *--last = '/'; X+ } X+ } else X+ searchDirectory(".", path); X+ } X+ X+ /* X+ * noCaseMatch(path) X+ * noCaseMatch() tests path first and will call noCaseFind() is path X+ * doesn't exist. X+ */ X+ X+ void X+ noCaseMatch(path) X+ register char *path; X+ { X+ if(access(path, F_OK) >= 0) X+ return; X+ noCaseFind(path); X+ } X+ #endif NOCASEMATCH SHAR_EOF if test 7261 -ne "`wc -c < 'afposenum.c.diff'`" then echo shar: error transmitting "'afposenum.c.diff'" '(should have been 7261 characters)' fi fi # end of overwriting check echo shar: extracting "'afposfi.c.diff'" '(6644 characters)' if test -f 'afposfi.c.diff' then echo shar: will not over-write existing file "'afposfi.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afposfi.c.diff' X*** applications/aufs/afposfi.c.orig Thu May 19 12:19:56 1988 X--- applications/aufs/afposfi.c Thu Jan 26 18:22:52 1989 X*************** X*** 63,68 X private void fc_flush_start(); X private void fc_flush_end(); X private FileInfo *os_getfi(); X X #define FICacheSize 128 X /* Each cache entry has a lifetime that it goes through before it must */ X X--- 63,69 ----- X private void fc_flush_start(); X private void fc_flush_end(); X private FileInfo *os_getfi(); X+ private fc_readent(); X X #define FICacheSize 128 X /* Each cache entry has a lifetime that it goes through before it must */ X*************** X*** 104,109 X X OSfname(path, pdir, "", F_FNDR); /* get directory */ X if (stat(path, &stb) < 0) { X fcf_val_dir = NILDIR; X fcf_val_time = 0; X return; /* nothing else we can do */ X X--- 105,118 ----- X X OSfname(path, pdir, "", F_FNDR); /* get directory */ X if (stat(path, &stb) < 0) { X+ #ifdef NOCASEMATCH X+ noCaseFind(path); X+ if (stat(path, &stb) < 0) { X+ fcf_val_dir = NILDIR; X+ fcf_val_time = 0; X+ return; /* nothing else we can do */ X+ } X+ #else NOCASEMATCH X fcf_val_dir = NILDIR; X fcf_val_time = 0; X return; /* nothing else we can do */ X*************** X*** 107,112 X fcf_val_dir = NILDIR; X fcf_val_time = 0; X return; /* nothing else we can do */ X } X fcf_val_dir = pdir; X fcf_val_time = stb.st_mtime; /* remember */ X X--- 116,122 ----- X fcf_val_dir = NILDIR; X fcf_val_time = 0; X return; /* nothing else we can do */ X+ #endif NOCASEMATCH X } X fcf_val_dir = pdir; X fcf_val_time = stb.st_mtime; /* remember */ X*************** X*** 142,147 X if (fcf_val_dir == fe->fe_pdir && X (fcf_val_time > fe->fe_mtime) && X (fcf_val_time > fe->fe_vtime)) { X if (stat(path, &stb) < 0) X return; /* nothing else we can do */ X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X X--- 152,164 ----- X if (fcf_val_dir == fe->fe_pdir && X (fcf_val_time > fe->fe_mtime) && X (fcf_val_time > fe->fe_vtime)) { X+ #ifdef NOCASEMATCH X+ if (stat(path, &stb) < 0) { X+ noCaseFind(path); X+ if (stat(path, &stb) < 0) X+ return; /* nothing else we can do */ X+ } X+ #else NOCASEMATCH X if (stat(path, &stb) < 0) X return; /* nothing else we can do */ X #endif NOCASEMATCH X*************** X*** 144,149 X (fcf_val_time > fe->fe_vtime)) { X if (stat(path, &stb) < 0) X return; /* nothing else we can do */ X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X fe->fe_okay = FALSE; /* make entry as bad */ X } X X--- 161,167 ----- X #else NOCASEMATCH X if (stat(path, &stb) < 0) X return; /* nothing else we can do */ X+ #endif NOCASEMATCH X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X fe->fe_okay = FALSE; /* make entry as bad */ X } X*************** X*** 167,172 X if ((fe->fe_pdir->flags & DID_FINDERINFO) == 0) /* always okay */ X return(fe->fe_okay); X OSfname(path, fe->fe_pdir, fe->fe_fnam, F_FNDR); X if (stat(path, &stb) < 0) X return(fe->fe_okay); /* nothing else we can do */ X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X X--- 185,197 ----- X if ((fe->fe_pdir->flags & DID_FINDERINFO) == 0) /* always okay */ X return(fe->fe_okay); X OSfname(path, fe->fe_pdir, fe->fe_fnam, F_FNDR); X+ #ifdef NOCASEMATCH X+ if (stat(path, &stb) < 0) { X+ noCaseFind(path); X+ if (stat(path, &stb) < 0) X+ return(fe->fe_okay); /* nothing else we can do */ X+ } X+ #else NOCASEMATCH X if (stat(path, &stb) < 0) X return(fe->fe_okay); /* nothing else we can do */ X #endif NOCASEMATCH X*************** X*** 169,174 X OSfname(path, fe->fe_pdir, fe->fe_fnam, F_FNDR); X if (stat(path, &stb) < 0) X return(fe->fe_okay); /* nothing else we can do */ X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X return(FALSE); /* bad entry */ X } X X--- 194,200 ----- X #else NOCASEMATCH X if (stat(path, &stb) < 0) X return(fe->fe_okay); /* nothing else we can do */ X+ #endif NOCASEMATCH X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X return(FALSE); /* bad entry */ X } X*************** X*** 253,258 X printf("fc_readent: reading %s\n",path); X X fd = open(path,O_RDONLY); X if (fd >= 0) { X OSLockFileforRead(fd); X err = fstat(fd, &stb); X X--- 279,290 ----- X printf("fc_readent: reading %s\n",path); X X fd = open(path,O_RDONLY); X+ #ifdef NOCASEMATCH X+ if(fd < 0) { X+ noCaseFind(path); X+ fd = open(path,O_RDONLY); X+ } X+ #endif NOCASEMATCH X if (fd >= 0) { X OSLockFileforRead(fd); X err = fstat(fd, &stb); X*************** X*** 309,314 X X /* convert name to internal name */ X OSfname(path,fe->fe_pdir,fe->fe_fnam,F_DATA); /* create plain name */ X if (stat(path,&stb) != 0) /* check if it exists */ X return(aeObjectNotFound); /* no... */ X if (S_ISDIR(stb.st_mode)) { X X--- 341,353 ----- X X /* convert name to internal name */ X OSfname(path,fe->fe_pdir,fe->fe_fnam,F_DATA); /* create plain name */ X+ #ifdef NOCASEMATCH X+ if (stat(path,&stb) != 0) { /* check if it exists */ X+ noCaseFind(path); X+ if (stat(path,&stb) != 0) /* check if it exists */ X+ return(aeObjectNotFound); /* no... */ X+ } X+ #else NOCASEMATCH X if (stat(path,&stb) != 0) /* check if it exists */ X return(aeObjectNotFound); /* no... */ X #endif NOCASEMATCH X*************** X*** 311,316 X OSfname(path,fe->fe_pdir,fe->fe_fnam,F_DATA); /* create plain name */ X if (stat(path,&stb) != 0) /* check if it exists */ X return(aeObjectNotFound); /* no... */ X if (S_ISDIR(stb.st_mode)) { X fi->fi_comln = 0; X } else { X X--- 350,356 ----- X #else NOCASEMATCH X if (stat(path,&stb) != 0) /* check if it exists */ X return(aeObjectNotFound); /* no... */ X+ #endif NOCASEMATCH X if (S_ISDIR(stb.st_mode)) { X fi->fi_comln = 0; X } else { X*************** X*** 352,358 X printf("WriteFA: writing %s\n",path); X X needu++; X! if ((fd = open(path,O_WRONLY)) < 0) { /* open for write */ X if (errno != ENOENT) { X printf("WriteFA: error openning %s errno=%d\n",path,errno); X return; X X--- 392,405 ----- X printf("WriteFA: writing %s\n",path); X X needu++; X! fd = open(path,O_WRONLY); X! #ifdef NOCASEMATCH X! if(fd < 0) { X! noCaseFind(path); X! fd = open(path,O_WRONLY); X! } X! #endif NOCASEMATCH X! if (fd < 0) { /* open for write */ X if (errno != ENOENT) { X printf("WriteFA: error openning %s errno=%d\n",path,errno); X return; SHAR_EOF if test 6644 -ne "`wc -c < 'afposfi.c.diff'`" then echo shar: error transmitting "'afposfi.c.diff'" '(should have been 6644 characters)' fi fi # end of overwriting check echo shar: extracting "'afps.h.diff'" '(895 characters)' if test -f 'afps.h.diff' then echo shar: will not over-write existing file "'afps.h.diff'" else sed 's/^X//' << \SHAR_EOF > 'afps.h.diff' X*** applications/aufs/afps.h.orig Thu May 19 12:20:07 1988 X--- applications/aufs/afps.h Thu Dec 1 11:08:02 1988 X*************** X*** 182,187 X char *OSEnumGet(); X int OSEnumInit(); X void OSEnumDone(); X X /* Portable library functions */ X X X--- 182,191 ----- X char *OSEnumGet(); X int OSEnumInit(); X void OSEnumDone(); X+ #ifdef NOCASEMATCH X+ void noCaseFind(); X+ void noCaseMatch(); X+ #endif NOCASEMATCH X X /* Portable library functions */ X X*************** X*** 197,202 X X #define RFDIR "/.resource" X #define FIDIR "/.finderinfo" X X /* Finder info bits */ X #define DEFCMNT "This is a Unix\252 created file." X X--- 201,211 ----- X X #define RFDIR "/.resource" X #define FIDIR "/.finderinfo" X+ X+ #define DIRRF ".resource/" X+ #define DIRFI ".finderinfo/" X+ #define DIRRFLEN 10 X+ #define DIRFILEN 12 X X /* Finder info bits */ X #define DEFCMNT "This is a Unix\252 created file." SHAR_EOF if test 895 -ne "`wc -c < 'afps.h.diff'`" then echo shar: error transmitting "'afps.h.diff'" '(should have been 895 characters)' fi fi # end of overwriting check echo shar: extracting "'afpserver.c.diff'" '(460 characters)' if test -f 'afpserver.c.diff' then echo shar: will not over-write existing file "'afpserver.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpserver.c.diff' X*** applications/aufs/afpserver.c.orig Thu May 19 12:20:09 1988 X--- applications/aufs/afpserver.c Thu Jan 26 18:13:56 1989 X*************** X*** 167,172 X X #define NumEntries (sizeof(Entries)/sizeof(AFPDispEntry)) X X IniServer() /* ini disp entries */ X { X int i; X X--- 167,174 ----- X X #define NumEntries (sizeof(Entries)/sizeof(AFPDispEntry)) X X+ private DumpBuf(), clockstart(), clockend(); X+ X IniServer() /* ini disp entries */ X { X int i; SHAR_EOF if test 460 -ne "`wc -c < 'afpserver.c.diff'`" then echo shar: error transmitting "'afpserver.c.diff'" '(should have been 460 characters)' fi fi # end of overwriting check echo shar: extracting "'atalkdbm.c.diff'" '(557 characters)' if test -f 'atalkdbm.c.diff' then echo shar: will not over-write existing file "'atalkdbm.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'atalkdbm.c.diff' X*** lib/cap/atalkdbm.c.orig Thu May 19 12:17:05 1988 X--- lib/cap/atalkdbm.c Fri Jan 27 14:52:15 1989 X*************** X*** 37,42 X #define HAVE_ZONE -1 /* our zone was set */ X #define CONFIGURED 1 /* set when configured */ X X /* X * Set zone name - sets alternate atalk configuration file: atalk.<zonename> X * X X--- 37,44 ----- X #define HAVE_ZONE -1 /* our zone was set */ X #define CONFIGURED 1 /* set when configured */ X X+ static int name_toipaddr(); X+ X /* X * Set zone name - sets alternate atalk configuration file: atalk.<zonename> X * SHAR_EOF if test 557 -ne "`wc -c < 'atalkdbm.c.diff'`" then echo shar: error transmitting "'atalkdbm.c.diff'" '(should have been 557 characters)' fi fi # end of overwriting check echo shar: extracting "'atis.c.diff'" '(2688 characters)' if test -f 'atis.c.diff' then echo shar: will not over-write existing file "'atis.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'atis.c.diff' X*** etc/atis.c.orig Thu May 19 12:17:32 1988 X--- etc/atis.c Fri Jan 27 12:27:46 1989 X*************** X*** 103,108 X void atis_end(); X void atis_debuginc(); X void atis_undebug(); X X void X nbp_reload() X X--- 103,109 ----- X void atis_end(); X void atis_debuginc(); X void atis_undebug(); X+ private int nbpcpy(), c2pkt_ename(), pkt2c_ename(); X X void X nbp_reload() X*************** X*** 121,127 X } else log(L_UERR|1, "dump file open failed"); X log(1, "loaded %d entries",cnt); X sigsetmask(mask); X! (void)signal(SIGHUP, nbp_reload); X } X X void X X--- 122,128 ----- X } else log(L_UERR|1, "dump file open failed"); X log(1, "loaded %d entries",cnt); X sigsetmask(mask); X! (void)signal(SIGHUP, (int (*)())nbp_reload); X } X X void X*************** X*** 142,148 X } else log(L_UERR|1, "dump file (write) open failed"); X log(1, "Dumped %d entries",cnt); X sigsetmask(mask); X! (void)signal(SIGQUIT, nbp_dump); X } X X void X X--- 143,149 ----- X } else log(L_UERR|1, "dump file (write) open failed"); X log(1, "Dumped %d entries",cnt); X sigsetmask(mask); X! (void)signal(SIGQUIT, (int (*)())nbp_dump); X } X X void X*************** X*** 161,167 X log(0, "DEBUGGING OFF"); X if (tempdebugfile) X nologfile(); X! signal(SIGEMT, atis_debuginc); X sigsetmask(mask); X } X X X--- 162,168 ----- X log(0, "DEBUGGING OFF"); X if (tempdebugfile) X nologfile(); X! signal(SIGEMT, (int (*)())atis_debuginc); X sigsetmask(mask); X } X X*************** X*** 176,182 X if (dlevel < L_LVLMAX) X dlevel++; X log(0, "DEBUG LEVEL %d", dlevel); X! signal(SIGIOT, atis_debuginc); X sigsetmask(mask); X } X X X--- 177,183 ----- X if (dlevel < L_LVLMAX) X dlevel++; X log(0, "DEBUG LEVEL %d", dlevel); X! signal(SIGIOT, (int (*)())atis_debuginc); X sigsetmask(mask); X } X X*************** X*** 354,364 X abInit(TRUE); /* init driver */ X nbpInit(); /* init NBP */ X nbptab_init(); X! (void)signal(SIGHUP, nbp_reload); X! (void)signal(SIGQUIT, nbp_dump); X! (void)signal(SIGTERM, atis_end); X! (void)signal(SIGIOT, atis_debuginc); X! (void)signal(SIGEMT, atis_undebug); X X log(0, "Reply num max for lkup reply is %d (based on %d)", X NUMREPLYMAX, NBPTUPSIZE); X X--- 355,365 ----- X abInit(TRUE); /* init driver */ X nbpInit(); /* init NBP */ X nbptab_init(); X! (void)signal(SIGHUP, (int (*)())nbp_reload); X! (void)signal(SIGQUIT, (int (*)())nbp_dump); X! (void)signal(SIGTERM, (int (*)())atis_end); X! (void)signal(SIGIOT, (int (*)())atis_debuginc); X! (void)signal(SIGEMT, (int (*)())atis_undebug); X X log(0, "Reply num max for lkup reply is %d (based on %d)", X NUMREPLYMAX, NBPTUPSIZE); SHAR_EOF if test 2688 -ne "`wc -c < 'atis.c.diff'`" then echo shar: error transmitting "'atis.c.diff'" '(should have been 2688 characters)' fi fi # end of overwriting check echo shar: extracting "'papof.c.diff'" '(470 characters)' if test -f 'papof.c.diff' then echo shar: will not over-write existing file "'papof.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'papof.c.diff' X*** applications/papif/papof.c.orig Thu May 19 12:18:50 1988 X--- applications/papif/papof.c Fri Jan 27 12:05:02 1989 X*************** X*** 54,60 X X while (1) { X #ifdef BANNER X! if ((bannerfile = fopen(BANNERFILE, "w")) < 0) { X perror("Can't open .banner"); X exit(8); X } X X--- 54,60 ----- X X while (1) { X #ifdef BANNER X! if ((bannerfile = fopen(BANNERFILE, "w")) == NULL) { X perror("Can't open .banner"); X exit(8); X } SHAR_EOF if test 470 -ne "`wc -c < 'papof.c.diff'`" then echo shar: error transmitting "'papof.c.diff'" '(should have been 470 characters)' fi fi # end of overwriting check # End of shell archive exit 0 --- end of part 1 ---
edmoy@violet.berkeley.edu (Edward Moy) (06/05/89)
[New Patches to CAP - part 2 of 2] --- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # # afpos.c.diff # # This archive created: Sat Jun 3 07:29:31 1989 # By: Roger L. Long (bytebug@dhw68k.cts.com) # export PATH; PATH=/bin:$PATH echo shar: extracting "'afpos.c.diff'" '(41043 characters)' if test -f 'afpos.c.diff' then echo shar: will not over-write existing file "'afpos.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpos.c.diff' X*** applications/aufs/afpos.c.orig Mon Jun 27 12:26:51 1988 X--- applications/aufs/afpos.c Thu Jan 26 18:10:22 1989 X*************** X*** 112,118 X # ifdef Q_GETQUOTA X # define Q_GETDLIM Q_GETQUOTA X # else X! You have turned on quotas and aren't using the bsd or sun quota system X # endif /*Q_GETQUOTA*/ X # endif /* Q_GETDLIM */ X #endif /* USEQUOTA */ X X--- 112,118 ----- X # ifdef Q_GETQUOTA X # define Q_GETDLIM Q_GETQUOTA X # else X! /* You have turned on quotas and aren't using the bsd or sun quota system */ X # endif /*Q_GETQUOTA*/ X # endif /* Q_GETDLIM */ X #endif /* USEQUOTA */ X*************** X*** 135,140 X #include "afppasswd.h" /* in case we are using privates */ X #include "afposncs.h" X #include "afpgc.h" X X #ifdef MAXBSIZE X # define IOBSIZE MAXBSIZE /* set to max buf entry size by if there */ X X--- 135,146 ----- X #include "afppasswd.h" /* in case we are using privates */ X #include "afposncs.h" X #include "afpgc.h" X+ #ifdef SIZESERVER X+ #include <setjmp.h> X+ #include <signal.h> X+ #include <sys/socket.h> X+ #include "sizeserver.h" X+ #endif SIZESERVER X X #ifdef MAXBSIZE X # define IOBSIZE MAXBSIZE /* set to max buf entry size by if there */ X*************** X*** 282,287 X private OSErr ItoEErr(); X private int filemode(); X private char *syserr(); X X /* X * Enable OS Dependent functions X X--- 288,296 ----- X private OSErr ItoEErr(); X private int filemode(); X private char *syserr(); X+ #ifdef SIZESERVER X+ private void getvolsize(); X+ #endif SIZESERVER X X /* X * Enable OS Dependent functions X*************** X*** 545,550 X char path[MAXPATHLEN]; X X OSfname(path,ipdir,file,F_DATA); /* create data fork name */ X X if (DBOSI) X printf("OSDelete file=%s\n",path); X X--- 554,562 ----- X char path[MAXPATHLEN]; X X OSfname(path,ipdir,file,F_DATA); /* create data fork name */ X+ #ifdef NOCASEMATCH X+ noCaseMatch(path); X+ #endif NOCASEMATCH X X if (DBOSI) X printf("OSDelete file=%s\n",path); X*************** X*** 667,672 X int typ; X { X char path[MAXPATHLEN]; X X OSfname(path,pdir,file,typ); /* build unix file name */ X return(unix_unlink(path)); /* do the work... */ X X--- 679,687 ----- X int typ; X { X char path[MAXPATHLEN]; X+ #ifdef NOCASEMATCH X+ register int i; X+ #endif NOCASEMATCH X X OSfname(path,pdir,file,typ); /* build unix file name */ X #ifdef NOCASEMATCH X*************** X*** 669,674 X char path[MAXPATHLEN]; X X OSfname(path,pdir,file,typ); /* build unix file name */ X return(unix_unlink(path)); /* do the work... */ X } X X X--- 684,696 ----- X #endif NOCASEMATCH X X OSfname(path,pdir,file,typ); /* build unix file name */ X+ #ifdef NOCASEMATCH X+ if((i = unix_unlink(path)) != noErr) { X+ noCaseMatch(path); X+ i = unix_unlink(path); X+ } X+ return(i); /* do the work... */ X+ #else NOCASEMATCH X return(unix_unlink(path)); /* do the work... */ X #endif NOCASEMATCH X } X*************** X*** 670,675 X X OSfname(path,pdir,file,typ); /* build unix file name */ X return(unix_unlink(path)); /* do the work... */ X } X X X X--- 692,698 ----- X return(i); /* do the work... */ X #else NOCASEMATCH X return(unix_unlink(path)); /* do the work... */ X+ #endif NOCASEMATCH X } X X X*************** X*** 743,748 X IDirP fpdir,tpdir; /* from and to parent dirs */ X char *from,*to; /* from and to file names */ X { X char fpath[MAXPATHLEN]; X char tpath[MAXPATHLEN]; X struct stat stb; X X--- 766,773 ----- X IDirP fpdir,tpdir; /* from and to parent dirs */ X char *from,*to; /* from and to file names */ X { X+ char f_path[MAXPATHLEN]; X+ char t_path[MAXPATHLEN]; X char fpath[MAXPATHLEN]; X char tpath[MAXPATHLEN]; X struct stat stb; X*************** X*** 748,753 X struct stat stb; X int err,cerr; X int mo; X X OSfname(fpath,fpdir,from,F_DATA); /* build data file name */ X OSfname(tpath,tpdir,to,F_DATA); /* for from and to files */ X X--- 773,781 ----- X struct stat stb; X int err,cerr; X int mo; X+ #ifdef NOCASEMATCH X+ register char *pp; X+ #endif NOCASEMATCH X X OSfname(f_path,fpdir,from,F_DATA); /* build data file name */ X OSfname(t_path,tpdir,to,F_DATA); /* for from and to files */ X*************** X*** 749,756 X int err,cerr; X int mo; X X! OSfname(fpath,fpdir,from,F_DATA); /* build data file name */ X! OSfname(tpath,tpdir,to,F_DATA); /* for from and to files */ X X if (DBOSI) X printf("OSRename from=%s, to=%s\n",fpath,tpath); X X--- 777,784 ----- X register char *pp; X #endif NOCASEMATCH X X! OSfname(f_path,fpdir,from,F_DATA); /* build data file name */ X! OSfname(t_path,tpdir,to,F_DATA); /* for from and to files */ X X if (DBOSI) X printf("OSRename from=%s, to=%s\n",f_path,t_path); X*************** X*** 753,759 X OSfname(tpath,tpdir,to,F_DATA); /* for from and to files */ X X if (DBOSI) X! printf("OSRename from=%s, to=%s\n",fpath,tpath); X X if ((fpdir->flags & DID_FINDERINFO) && (tpdir->flags & DID_FINDERINFO) == 0) X return(aeCantMove); X X--- 781,787 ----- X OSfname(t_path,tpdir,to,F_DATA); /* for from and to files */ X X if (DBOSI) X! printf("OSRename from=%s, to=%s\n",f_path,t_path); X X if ((fpdir->flags & DID_FINDERINFO) && (tpdir->flags & DID_FINDERINFO) == 0) X return(aeCantMove); X*************** X*** 761,766 X return(aeCantMove); X X /* must be able to stat destination */ X if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr) X return(err); X mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid); X X--- 789,801 ----- X return(aeCantMove); X X /* must be able to stat destination */ X+ #ifdef NOCASEMATCH X+ if ((err = unix_stat(pp = pathstr(tpdir), &stb)) != noErr) { X+ noCaseFind(pp); X+ if ((err = unix_stat(pp, &stb)) != noErr) X+ return(err); X+ } X+ #else NOCASEMATCH X if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr) X return(err); X #endif NOCASEMATCH X*************** X*** 763,768 X /* must be able to stat destination */ X if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr) X return(err); X mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid); X X if ((err = unix_stat(fpath,&stb)) != noErr) X X--- 798,804 ----- X #else NOCASEMATCH X if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr) X return(err); X+ #endif NOCASEMATCH X mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid); X X #ifdef NOCASEMATCH X*************** X*** 765,771 X return(err); X mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid); X X! if ((err = unix_stat(fpath,&stb)) != noErr) X return(err); X X err = unix_rename(fpath,tpath); /* give unix the args */ X X--- 801,815 ----- X #endif NOCASEMATCH X mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid); X X! #ifdef NOCASEMATCH X! if ((err = unix_stat(f_path,&stb)) != noErr) { X! noCaseFind(f_path); X! if ((err = unix_stat(f_path,&stb)) != noErr) X! return(err); X! } X! noCaseMatch(t_path); X! #else NOCASEMATCH X! if ((err = unix_stat(f_path,&stb)) != noErr) X return(err); X #endif NOCASEMATCH X X*************** X*** 767,772 X X if ((err = unix_stat(fpath,&stb)) != noErr) X return(err); X X err = unix_rename(fpath,tpath); /* give unix the args */ X if (err != noErr) /* if an error on data files */ X X--- 811,817 ----- X #else NOCASEMATCH X if ((err = unix_stat(f_path,&stb)) != noErr) X return(err); X+ #endif NOCASEMATCH X X err = unix_rename(f_path,t_path); /* give unix the args */ X if (err != noErr) /* if an error on data files */ X*************** X*** 768,774 X if ((err = unix_stat(fpath,&stb)) != noErr) X return(err); X X! err = unix_rename(fpath,tpath); /* give unix the args */ X if (err != noErr) /* if an error on data files */ X return(err); /* then give up */ X X X--- 813,819 ----- X return(err); X #endif NOCASEMATCH X X! err = unix_rename(f_path,t_path); /* give unix the args */ X if (err != noErr) /* if an error on data files */ X return(err); /* then give up */ X X*************** X*** 775,782 X if (!S_ISDIR(stb.st_mode)) { /* directories have no rsrc fork */ X unix_chmod(tpath, mo); /* file: try to reset protection */ X if (fpdir->flags & DID_RESOURCE) { X! OSfname(fpath,fpdir,from,F_RSRC); /* build resource file names */ X! OSfname(tpath,tpdir,to,F_RSRC); X err = unix_rename(fpath,tpath); /* give unix a shot at it */ X /* allow non-existant resource */ X if (err != noErr && err != aeObjectNotFound) { /* error on rename? */ X X--- 820,829 ----- X if (!S_ISDIR(stb.st_mode)) { /* directories have no rsrc fork */ X unix_chmod(tpath, mo); /* file: try to reset protection */ X if (fpdir->flags & DID_RESOURCE) { X! strcpy(fpath, f_path); X! strcpy(tpath, t_path); X! toResFork(fpath,from); /* build resource file names */ X! toResFork(tpath,to); X err = unix_rename(fpath,tpath); /* give unix a shot at it */ X /* allow non-existant resource */ X if (err != noErr && err != aeObjectNotFound) { /* error on rename? */ X*************** X*** 783,791 X if (DBOSI) X printf("os_rename: failed %s for %s -> %s\n", X afperr(err),fpath,tpath); X! OSfname(fpath,fpdir,from,F_DATA); /* try to rebuild */ X! OSfname(tpath,tpdir,to,F_DATA); X! cerr = unix_rename(tpath,fpath); /* rename back to orignal */ X if (cerr != noErr && DBOSI) X printf("os_rename: cleanup failed\n"); X unix_chmod(tpath, stb.st_mode&0777); /* file:try to reset protection */ X X--- 830,836 ----- X if (DBOSI) X printf("os_rename: failed %s for %s -> %s\n", X afperr(err),fpath,tpath); X! cerr = unix_rename(t_path,f_path); /* rename back to orignal */ X if (cerr != noErr && DBOSI) X printf("os_rename: cleanup failed\n"); X unix_chmod(t_path, stb.st_mode&0777); /* file:try to reset protection */ X*************** X*** 788,794 X cerr = unix_rename(tpath,fpath); /* rename back to orignal */ X if (cerr != noErr && DBOSI) X printf("os_rename: cleanup failed\n"); X! unix_chmod(tpath, stb.st_mode&0777); /* file:try to reset protection */ X return(err); X } X } X X--- 833,839 ----- X cerr = unix_rename(t_path,f_path); /* rename back to orignal */ X if (cerr != noErr && DBOSI) X printf("os_rename: cleanup failed\n"); X! unix_chmod(t_path, stb.st_mode&0777); /* file:try to reset protection */ X return(err); X } X } X*************** X*** 795,802 X } X X if (fpdir->flags & DID_FINDERINFO) { X! OSfname(fpath,fpdir,from,F_FNDR); /* build finder info file names */ X! OSfname(tpath,tpdir,to,F_FNDR); X err = unix_rename(fpath,tpath); /* give unix a shot at it */ X if (err != noErr && DBOSI) { X printf("os_rename: failed %s for %s -> %s\n", afperr(err),fpath,tpath); X X--- 840,849 ----- X } X X if (fpdir->flags & DID_FINDERINFO) { X! strcpy(fpath, f_path); X! strcpy(tpath, t_path); X! toFinderInfo(fpath,from); /* build finder info file names */ X! toFinderInfo(tpath,to); X err = unix_rename(fpath,tpath); /* give unix a shot at it */ X if (err != noErr && DBOSI) { X printf("os_rename: failed %s for %s -> %s\n", afperr(err),fpath,tpath); X*************** X*** 1047,1052 X /* want path/name */ X X OSfname(path, pdir, name, F_DATA); /* get path/name */ X switch (typ) { X case F_RSRC: X strcat(path, "/"); X X--- 1094,1102 ----- X /* want path/name */ X X OSfname(path, pdir, name, F_DATA); /* get path/name */ X+ #ifdef NOCASEMATCH X+ noCaseMatch(path); X+ #endif NOCASEMATCH X switch (typ) { X case F_RSRC: X strcat(path, RFDIR); X*************** X*** 1049,1056 X OSfname(path, pdir, name, F_DATA); /* get path/name */ X switch (typ) { X case F_RSRC: X! strcat(path, "/"); X! strcat(path, RFDIRFN); X break; X case F_FNDR: X strcat(path, "/"); X X--- 1099,1105 ----- X #endif NOCASEMATCH X switch (typ) { X case F_RSRC: X! strcat(path, RFDIR); X break; X case F_FNDR: X strcat(path, FIDIR); X*************** X*** 1053,1060 X strcat(path, RFDIRFN); X break; X case F_FNDR: X! strcat(path, "/"); X! strcat(path, FIDIRFN); X break; X } X if (DBOSI) X X--- 1102,1108 ----- X strcat(path, RFDIR); X break; X case F_FNDR: X! strcat(path, FIDIR); X break; X } X if (DBOSI) X*************** X*** 1090,1095 X X if (pdir->flags & DID_FINDERINFO) { X OSfname(path,pdir,name,F_FNDR); /* create finderinfo for folder */ X err = unix_create(path,TRUE,mo); /* do delete if exists... */ X os_mkdir(pdir,name,mo,F_FNDR); /* create the finderinfo directory */ X } X X--- 1138,1146 ----- X X if (pdir->flags & DID_FINDERINFO) { X OSfname(path,pdir,name,F_FNDR); /* create finderinfo for folder */ X+ #ifdef NOCASEMATCH X+ noCaseMatch(path); X+ #endif NOCASEMATCH X err = unix_create(path,TRUE,mo); /* do delete if exists... */ X os_mkdir(pdir,name,mo,F_FNDR); /* create the finderinfo directory */ X } X*************** X*** 1130,1135 X printf("OSFileDirInfo on %s\n",path); X X if (stat(path,&buf) != 0) { /* file exists? */ X if (idir) /* was in directory tree? */ X Idrdirid(ipdir, idir); /* invalidate the entry then */ X return(aeObjectNotFound); /* no... */ X X--- 1181,1194 ----- X printf("OSFileDirInfo on %s\n",path); X X if (stat(path,&buf) != 0) { /* file exists? */ X+ #ifdef NOCASEMATCH X+ noCaseFind(path); /* case-insensitive */ X+ if (stat(path,&buf) != 0) { /* file exists? */ X+ if (idir) /* was in directory tree? */ X+ Idrdirid(ipdir, idir); /* invalidate the entry then */ X+ return(aeObjectNotFound); /* no... */ X+ } X+ #else NOCASEMATCH X if (idir) /* was in directory tree? */ X Idrdirid(ipdir, idir); /* invalidate the entry then */ X return(aeObjectNotFound); /* no... */ X*************** X*** 1133,1138 X if (idir) /* was in directory tree? */ X Idrdirid(ipdir, idir); /* invalidate the entry then */ X return(aeObjectNotFound); /* no... */ X } X X /* pick out the earliest date for mac creation time */ X X--- 1192,1198 ----- X if (idir) /* was in directory tree? */ X Idrdirid(ipdir, idir); /* invalidate the entry then */ X return(aeObjectNotFound); /* no... */ X+ #endif NOCASEMATCH X } X X /* pick out the earliest date for mac creation time */ X*************** X*** 1155,1161 X return(OSDirInfo(ipdir,fn,fdp,&buf,volid)); /* fill in */ X } X fdp->fdp_flg = 0; /* otherwise a file */ X! return(OSFileInfo(ipdir,fn,fdp,&buf)); /* fill in */ X } X X X X--- 1215,1221 ----- X return(OSDirInfo(ipdir,fn,fdp,&buf,volid)); /* fill in */ X } X fdp->fdp_flg = 0; /* otherwise a file */ X! return(OSFileInfo(ipdir,fn,fdp,&buf,path)); /* fill in */ X } X X X*************** X*** 1222,1227 X IDirP idirid; X { X char path[MAXPATHLEN]; X struct stat stb; X IDirP pdir; X int i; X X--- 1282,1288 ----- X IDirP idirid; X { X char path[MAXPATHLEN]; X+ char p_ath[MAXPATHLEN]; X struct stat stb; X IDirP pdir; X int i; X*************** X*** 1226,1233 X IDirP pdir; X int i; X X! OSfname(path,idirid,"",F_DATA); X! if (stat(path, &stb) == 0) { X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_DATA; X #ifndef NOLSTAT X X--- 1287,1301 ----- X IDirP pdir; X int i; X X! OSfname(p_ath,idirid,"",F_DATA); X! i = stat(p_ath, &stb); X! #ifdef NOCASEMATCH X! if(i != 0) { X! noCaseFind(p_ath); X! i = stat(p_ath, &stb); X! } X! #endif NOCASEMATCH X! if (i == 0) { X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_DATA; X #ifndef NOLSTAT X*************** X*** 1231,1237 X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_DATA; X #ifndef NOLSTAT X! if (lstat(path, &stb) != 0) { /* shouldn't fail! */ X idirid->flags = DID_VALID; X return; X } X X--- 1299,1305 ----- X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_DATA; X #ifndef NOLSTAT X! if (lstat(p_ath, &stb) != 0) { /* shouldn't fail! */ X idirid->flags = DID_VALID; X return; X } X*************** X*** 1249,1256 X idirid->flags |= ((i << DID_SYMLINKS_SHIFT) & DID_SYMLINKS); X } X /* don't follow symbolic links here! */ X! OSfname(path,idirid,"",F_FNDR); X! if (lstat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_FINDERINFO; X OSfname(path,idirid,"",F_RSRC); X X--- 1317,1325 ----- X idirid->flags |= ((i << DID_SYMLINKS_SHIFT) & DID_SYMLINKS); X } X /* don't follow symbolic links here! */ X! strcpy(path,p_ath); X! toFinderInfo(path,""); X! if (lstat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_FINDERINFO; X strcpy(path,p_ath); X*************** X*** 1253,1260 X if (lstat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_FINDERINFO; X! OSfname(path,idirid,"",F_RSRC); X! if (lstat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_RESOURCE; X #else X X--- 1322,1330 ----- X if (lstat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_FINDERINFO; X! strcpy(path,p_ath); X! toResFork(path,""); X! if (lstat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_RESOURCE; X #else X*************** X*** 1259,1266 X idirid->flags |= DID_RESOURCE; X #else X /* no symolic links then */ X! OSfname(path,idirid,"",F_FNDR); X! if (stat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_FINDERINFO; X OSfname(path,idirid,"",F_RSRC); X X--- 1329,1337 ----- X idirid->flags |= DID_RESOURCE; X #else X /* no symolic links then */ X! strcpy(path,p_ath); X! toFinderInfo(path,""); X! if (stat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_FINDERINFO; X strcpy(path,p_ath); X*************** X*** 1263,1270 X if (stat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_FINDERINFO; X! OSfname(path,idirid,"",F_RSRC); X! if (stat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_RESOURCE; X #endif X X--- 1334,1342 ----- X if (stat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_FINDERINFO; X! strcpy(path,p_ath); X! toResFork(path,""); X! if (stat(path, &stb) == 0) X if (S_ISDIR(stb.st_mode)) X idirid->flags |= DID_RESOURCE; X #endif X*************** X*** 1273,1279 X } X X export OSErr X! OSFileInfo(ipdir,fn,fdp,buf) X IDirP ipdir; X char *fn; X FileDirParm *fdp; X X--- 1345,1351 ----- X } X X export OSErr X! OSFileInfo(ipdir,fn,fdp,buf,rpath) X IDirP ipdir; X char *fn,*rpath; X FileDirParm *fdp; X*************** X*** 1275,1281 X export OSErr X OSFileInfo(ipdir,fn,fdp,buf) X IDirP ipdir; X! char *fn; X FileDirParm *fdp; X struct stat *buf; X { X X--- 1347,1353 ----- X export OSErr X OSFileInfo(ipdir,fn,fdp,buf,rpath) X IDirP ipdir; X! char *fn,*rpath; X FileDirParm *fdp; X struct stat *buf; X { X*************** X*** 1280,1286 X struct stat *buf; X { X struct stat stb; X- char rpath[MAXPATHLEN]; X word bm; X X fdp->fdp_fbitmap &= FP_AUFS_VALID; /* truncate to aufs supported */ X X--- 1352,1357 ----- X struct stat *buf; X { X struct stat stb; X word bm; X X fdp->fdp_fbitmap &= FP_AUFS_VALID; /* truncate to aufs supported */ X*************** X*** 1300,1306 X fdp->fdp_parms.fp_parms.fp_rflen = 0; X X if (bm & FP_RFLEN) { X! OSfname(rpath,ipdir,fn,F_RSRC); /* convert to rsrc name */ X if (stat(rpath,&stb) != 0) /* to figure size of resource fork */ X return(noErr); X if (DBFIL) X X--- 1371,1377 ----- X fdp->fdp_parms.fp_parms.fp_rflen = 0; X X if (bm & FP_RFLEN) { X! toResFork(rpath,fn); /* convert to rsrc name */ X if (stat(rpath,&stb) != 0) /* to figure size of resource fork */ X return(noErr); X if (DBFIL) X*************** X*** 1322,1327 X { X char path[MAXPATHLEN]; X struct stat stb; X X OSfname(path, ipdir, fn, type); X return(unix_stat(path, &stb)); X X--- 1393,1401 ----- X { X char path[MAXPATHLEN]; X struct stat stb; X+ #ifdef NOCASEMATCH X+ register int i; X+ #endif NOCASEMATCH X X OSfname(path, ipdir, fn, type); X #ifdef NOCASEMATCH X*************** X*** 1324,1329 X struct stat stb; X X OSfname(path, ipdir, fn, type); X return(unix_stat(path, &stb)); X } X X X--- 1398,1410 ----- X #endif NOCASEMATCH X X OSfname(path, ipdir, fn, type); X+ #ifdef NOCASEMATCH X+ if((i = unix_stat(path, &stb)) != noErr) { X+ noCaseFind(path); X+ i = unix_stat(path, &stb); X+ } X+ return(i); X+ #else NOCASEMATCH X return(unix_stat(path, &stb)); X #endif NOCASEMATCH X } X*************** X*** 1325,1330 X X OSfname(path, ipdir, fn, type); X return(unix_stat(path, &stb)); X } X X export OSErr X X--- 1406,1412 ----- X return(i); X #else NOCASEMATCH X return(unix_stat(path, &stb)); X+ #endif NOCASEMATCH X } X X export OSErr X*************** X*** 1340,1345 X X OSfname(path,ipdir,fn,F_DATA); /* unix file name */ X if ((err = unix_stat(path,&stb)) != noErr) { X /* can't find it !!! */ X if (idir) X Idrdirid(ipdir, idir); /* remove from tree */ X X--- 1422,1436 ----- X X OSfname(path,ipdir,fn,F_DATA); /* unix file name */ X if ((err = unix_stat(path,&stb)) != noErr) { X+ #ifdef NOCASEMATCH X+ noCaseFind(path); X+ if ((err = unix_stat(path,&stb)) != noErr) { X+ /* can't find it !!! */ X+ if (idir) X+ Idrdirid(ipdir, idir); /* remove from tree */ X+ return(err); X+ } X+ #else NOCASEMATCH X /* can't find it !!! */ X if (idir) X Idrdirid(ipdir, idir); /* remove from tree */ X*************** X*** 1344,1349 X if (idir) X Idrdirid(ipdir, idir); /* remove from tree */ X return(err); X } X X if (S_ISDIR(stb.st_mode)) /* if a directory */ X X--- 1435,1441 ----- X if (idir) X Idrdirid(ipdir, idir); /* remove from tree */ X return(err); X+ #endif NOCASEMATCH X } X X if (S_ISDIR(stb.st_mode)) /* if a directory */ X*************** X*** 1378,1383 X FileDirParm *fdp; X { X u_short EtoIAccess(); X char path[MAXPATHLEN]; X int own,grp,err; /* owner and group ids */ X DirParm *dp = &fdp->fdp_parms.dp_parms; X X--- 1470,1476 ----- X FileDirParm *fdp; X { X u_short EtoIAccess(); X+ char p_ath[MAXPATHLEN]; X char path[MAXPATHLEN]; X int own,grp,err; /* owner and group ids */ X DirParm *dp = &fdp->fdp_parms.dp_parms; X*************** X*** 1395,1402 X flags = ipdir->flags; /* should use to prevent overworking */ X if (own != -1 || grp != -1) { X /* error recovery? do all just in case */ X! OSfname(path,ipdir,fn,F_DATA); /* change unix name */ X! if ((err = unix_chown(path,own,grp)) != noErr) X return(err); X OSfname(path,ipdir,fn,F_RSRC); /* change unix name */ X if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound) X X--- 1488,1502 ----- X flags = ipdir->flags; /* should use to prevent overworking */ X if (own != -1 || grp != -1) { X /* error recovery? do all just in case */ X! OSfname(p_ath,ipdir,fn,F_DATA); /* change unix name */ X! #ifdef NOCASEMATCH X! if ((err = unix_chown(p_ath,own,grp)) != noErr) { X! noCaseFind(p_ath); X! if ((err = unix_chown(p_ath,own,grp)) != noErr) X! return(err); X! } X! #else NOCASEMATCH X! if ((err = unix_chown(p_ath,own,grp)) != noErr) X return(err); X #endif NOCASEMATCH X strcpy(path,p_ath); X*************** X*** 1398,1404 X OSfname(path,ipdir,fn,F_DATA); /* change unix name */ X if ((err = unix_chown(path,own,grp)) != noErr) X return(err); X! OSfname(path,ipdir,fn,F_RSRC); /* change unix name */ X if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound) X return(err); X OSfname(path,ipdir,fn,F_FNDR); /* create unix name */ X X--- 1498,1506 ----- X #else NOCASEMATCH X if ((err = unix_chown(p_ath,own,grp)) != noErr) X return(err); X! #endif NOCASEMATCH X! strcpy(path,p_ath); X! toResFork(path,fn); X if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound) X return(err); X strcpy(path,p_ath); X*************** X*** 1401,1407 X OSfname(path,ipdir,fn,F_RSRC); /* change unix name */ X if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound) X return(err); X! OSfname(path,ipdir,fn,F_FNDR); /* create unix name */ X if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound) X return(err); X EModified(ipdir); X X--- 1503,1510 ----- X toResFork(path,fn); X if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound) X return(err); X! strcpy(path,p_ath); X! toFinderInfo(path,fn); X if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound) X return(err); X EModified(ipdir); X*************** X*** 1473,1478 X printf("os_chmod: setting %o for %s\n",mode,path); X X err = unix_chmod(path,mode); /* and set for the directory */ X if (err != noErr) X return(err); X X X--- 1576,1588 ----- X printf("os_chmod: setting %o for %s\n",mode,path); X X err = unix_chmod(path,mode); /* and set for the directory */ X+ #ifdef NOCASEMATCH X+ if (err != noErr) { X+ noCaseFind(path); X+ if((err = unix_chmod(path,mode)) != noErr) X+ return(err); X+ } X+ #else NOCASEMATCH X if (err != noErr) X return(err); X #endif NOCASEMATCH X*************** X*** 1475,1480 X err = unix_chmod(path,mode); /* and set for the directory */ X if (err != noErr) X return(err); X X EModified(idir); X return(noErr); X X--- 1585,1591 ----- X #else NOCASEMATCH X if (err != noErr) X return(err); X+ #endif NOCASEMATCH X X EModified(idir); X return(noErr); X*************** X*** 1510,1517 X case F_DATA: X break; X case F_RSRC: X! path[pl] = '/'; X! strcpy(path+pl+1, RFDIRFN); X break; X case F_FNDR: X path[pl] = '/'; X X--- 1621,1627 ----- X case F_DATA: X break; X case F_RSRC: X! strcpy(path+pl, RFDIR); X break; X case F_FNDR: X strcpy(path+pl, FIDIR); X*************** X*** 1514,1521 X strcpy(path+pl+1, RFDIRFN); X break; X case F_FNDR: X! path[pl] = '/'; X! strcpy(path+pl+1, FIDIRFN); X break; X } X if (DBOSI) X X--- 1624,1630 ----- X strcpy(path+pl, RFDIR); X break; X case F_FNDR: X! strcpy(path+pl, FIDIR); X break; X } X if (DBOSI) X*************** X*** 1522,1527 X printf("os_chmod: setting %o for %s\n",mode,path); X X dirp = opendir(path); X if (dirp == NULL) { X if (DBOSI) X printf("os_chmod: opendir failed on %s\n",path); X X--- 1631,1637 ----- X printf("os_chmod: setting %o for %s\n",mode,path); X X dirp = opendir(path); X+ #ifdef NOCASEMATCH X if (dirp == NULL) { X noCaseFind(path); X if((dirp = opendir(path)) == NULL) { X*************** X*** 1523,1528 X X dirp = opendir(path); X if (dirp == NULL) { X if (DBOSI) X printf("os_chmod: opendir failed on %s\n",path); X return; X X--- 1633,1647 ----- X dirp = opendir(path); X #ifdef NOCASEMATCH X if (dirp == NULL) { X+ noCaseFind(path); X+ if((dirp = opendir(path)) == NULL) { X+ if (DBOSI) X+ printf("os_chmod: opendir failed on %s\n",path); X+ return; X+ } X+ } X+ #else NOCASEMATCH X+ if (dirp == NULL) { X if (DBOSI) X printf("os_chmod: opendir failed on %s\n",path); X return; X*************** X*** 1527,1532 X printf("os_chmod: opendir failed on %s\n",path); X return; X } X X pl = strlen(path); /* length of the path */ X path[pl++] = '/'; /* add component terminator */ X X--- 1646,1652 ----- X printf("os_chmod: opendir failed on %s\n",path); X return; X } X+ #endif NOCASEMATCH X X pl = strlen(path); /* length of the path */ X path[pl++] = '/'; /* add component terminator */ X*************** X*** 1706,1711 X err = access(path,imode); X if (err == 0) X return(noErr); X switch (errno) { X case ENOTDIR: X return(aeDirNotFound); X X--- 1826,1836 ----- X err = access(path,imode); X if (err == 0) X return(noErr); X+ #ifdef NOCASEMATCH X+ noCaseFind(path); X+ if(access(path,imode) == 0) X+ return(noErr); X+ #endif NOCASEMATCH X switch (errno) { X case ENOTDIR: X return(aeDirNotFound); X*************** X*** 1834,1839 X return(noErr); X } X #endif X v->v_size = 0x1000000; /* some random number */ X v->v_free = 0x1000000; /* same random number */ X return(noErr); /* all ok */ X X--- 1959,1967 ----- X return(noErr); X } X #endif X+ #ifdef SIZESERVER X+ getvolsize(path, &v->v_size, &v->v_free); X+ #else SIZESERVER X v->v_size = 0x1000000; /* some random number */ X v->v_free = 0x1000000; /* same random number */ X #endif SIZESERVER X*************** X*** 1836,1841 X #endif X v->v_size = 0x1000000; /* some random number */ X v->v_free = 0x1000000; /* same random number */ X return(noErr); /* all ok */ X } X X X--- 1964,1970 ----- X #else SIZESERVER X v->v_size = 0x1000000; /* some random number */ X v->v_free = 0x1000000; /* same random number */ X+ #endif SIZESERVER X return(noErr); /* all ok */ X } X X*************** X*** 1839,1844 X return(noErr); /* all ok */ X } X X #ifdef USEGETMNT X /* get info on path using buf when there is ambiguity (ultrix 2.0 or before) */ X /* fill in info on v */ X X--- 1968,2043 ----- X return(noErr); /* all ok */ X } X X+ #ifdef SIZESERVER X+ static jmp_buf gotpipe; X+ X+ private void X+ getvolsize(path, ntot, nfree) X+ char *path; X+ sdword *ntot, *nfree; X+ { X+ register int i; X+ int mask, socket[2]; X+ struct volsize vs; X+ static int server = -1, server1, servmask; X+ static struct timeval servtimeout = {0, 500000L}; X+ X+ if(setjmp(gotpipe)) { X+ if(server >= 0) X+ close(server); X+ server = -1; X+ unknown: X+ *ntot = 0x1000000; X+ *nfree = 0x1000000; X+ return; X+ } X+ if(server < 0) { X+ register int pid; X+ int catchsigpipe(); X+ X+ if(socketpair(AF_UNIX, SOCK_STREAM, 0, socket) < 0) X+ goto unknown; X+ if((pid = fork()) < 0) { X+ close(socket[0]); X+ close(socket[1]); X+ goto unknown; X+ } X+ if(pid == 0) { /* the child */ X+ close(socket[0]); X+ if(socket[1] != 0) { X+ dup2(socket[1], 0); X+ close(socket[1]); X+ } X+ execl(SIZESERVER, SIZESERVER, 0); X+ _exit(1); X+ } X+ close(socket[1]); X+ server = socket[0]; X+ server1 = server + 1; X+ servmask = 1 << server; X+ signal(SIGPIPE, catchsigpipe); X+ } X+ for(i = 3 ; ; ) { X+ if(i-- <= 0) X+ goto unknown; X+ lseek(server, 0L, 2); X+ write(server, path, strlen(path) + 1); X+ mask = servmask; X+ if(select(server1, &mask, NULL, NULL, &servtimeout) < 1) X+ goto unknown; X+ if(read(server, (char *)&vs, sizeof(vs)) == sizeof(vs)) X+ break; X+ } X+ *ntot = vs.total; X+ *nfree = vs.free; X+ } X+ X+ catchsigpipe() X+ { X+ longjmp(gotpipe, 1); X+ } X+ #endif SIZESERVER X+ X #ifdef USEGETMNT X /* get info on path using buf when there is ambiguity (ultrix 2.0 or before) */ X /* fill in info on v */ X*************** X*** 2064,2069 X IDirP spdir,dpdir; /* source and destination parents */ X char *sfile,*dfile; /* source and destination file names */ X { X char spath[MAXPATHLEN]; X char dpath[MAXPATHLEN]; X struct stat stb; X X--- 2263,2270 ----- X IDirP spdir,dpdir; /* source and destination parents */ X char *sfile,*dfile; /* source and destination file names */ X { X+ char s_path[MAXPATHLEN]; X+ char d_path[MAXPATHLEN]; X char spath[MAXPATHLEN]; X char dpath[MAXPATHLEN]; X struct stat stb; X*************** X*** 2070,2077 X int mo; X int err; X X! OSfname(spath,spdir,sfile,F_DATA); /* create unix style name for data */ X! OSfname(dpath,dpdir,dfile,F_DATA); /* same for destination */ X X if (DBOSI) X printf("OSCopyFile: %s -> %s\n",spath,dpath); X X--- 2271,2284 ----- X int mo; X int err; X X! OSfname(s_path,spdir,sfile,F_DATA); /* create unix style name for data */ X! #ifdef NOCASEMATCH X! noCaseMatch(s_path); X! #endif NOCASEMATCH X! OSfname(d_path,dpdir,dfile,F_DATA); /* same for destination */ X! #ifdef NOCASEMATCH X! noCaseMatch(d_path); X! #endif NOCASEMATCH X X if (DBOSI) X printf("OSCopyFile: %s -> %s\n",s_path,d_path); X*************** X*** 2074,2080 X OSfname(dpath,dpdir,dfile,F_DATA); /* same for destination */ X X if (DBOSI) X! printf("OSCopyFile: %s -> %s\n",spath,dpath); X X err = unix_stat(dpath,&stb); /* see if destination exists... */ X if (err == noErr) /* yes... it does */ X X--- 2281,2287 ----- X #endif NOCASEMATCH X X if (DBOSI) X! printf("OSCopyFile: %s -> %s\n",s_path,d_path); X X err = unix_stat(d_path,&stb); /* see if destination exists... */ X if (err == noErr) /* yes... it does */ X*************** X*** 2076,2082 X if (DBOSI) X printf("OSCopyFile: %s -> %s\n",spath,dpath); X X! err = unix_stat(dpath,&stb); /* see if destination exists... */ X if (err == noErr) /* yes... it does */ X return(aeObjectExists); /* return error... */ X X X--- 2283,2289 ----- X if (DBOSI) X printf("OSCopyFile: %s -> %s\n",s_path,d_path); X X! err = unix_stat(d_path,&stb); /* see if destination exists... */ X if (err == noErr) /* yes... it does */ X return(aeObjectExists); /* return error... */ X X*************** X*** 2084,2090 X if ((err = unix_stat(pathstr(dpdir), &stb)) != noErr) X return(err); X mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid); X! err = os_copy(spath,dpath, mo); X X if (err != noErr && DBOSI) X printf("OSCopyFile: DATA copy failed %s\n",afperr(err)); X X--- 2291,2297 ----- X if ((err = unix_stat(pathstr(dpdir), &stb)) != noErr) X return(err); X mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid); X! err = os_copy(s_path,d_path, mo); X X if (err != noErr && DBOSI) X printf("OSCopyFile: DATA copy failed %s\n",afperr(err)); X*************** X*** 2092,2099 X if (err != noErr) X return(err); X X! OSfname(spath,spdir,sfile,F_RSRC); /* create unix style name for rsrc */ X! OSfname(dpath,dpdir,dfile,F_RSRC); /* same for destination */ X err = os_copy(spath,dpath,mo); /* do the copy... */ X /* allow object not found */ X if (err != noErr && err != aeObjectNotFound) { /* if failure.... */ X X--- 2299,2308 ----- X if (err != noErr) X return(err); X X! strcpy(spath,s_path); X! toResFork(spath,sfile); /* create unix style name for rsrc */ X! strcpy(dpath,d_path); X! toResFork(dpath,dfile); /* same for destination */ X err = os_copy(spath,dpath,mo); /* do the copy... */ X /* allow object not found */ X if (err != noErr && err != aeObjectNotFound) { /* if failure.... */ X*************** X*** 2103,2110 X return(err); X } X X! OSfname(spath,spdir,sfile,F_FNDR); /* create unix style name for fndr */ X! OSfname(dpath,dpdir,dfile,F_FNDR); /* same for destination */ X err = os_copy(spath,dpath,mo); /* do the copy... */ X /* allow object not found */ X if (err != noErr && err != aeObjectNotFound) { X X--- 2312,2321 ----- X return(err); X } X X! strcpy(spath,s_path); X! toFinderInfo(spath,sfile); /* create unix style name for fndr */ X! strcpy(dpath,d_path); X! toFinderInfo(dpath,dfile); /* same for destination */ X err = os_copy(spath,dpath,mo); /* do the copy... */ X /* allow object not found */ X if (err != noErr && err != aeObjectNotFound) { X*************** X*** 2210,2215 X char *file; X int delf; /* if want to delete existing file */ X { X char path[MAXPATHLEN]; X int err,derr,rerr,cerr,mo; X struct stat stb; X X--- 2421,2427 ----- X char *file; X int delf; /* if want to delete existing file */ X { X+ char p_ath[MAXPATHLEN]; X char path[MAXPATHLEN]; X int err,derr,rerr,cerr,mo; X struct stat stb; X*************** X*** 2214,2220 X int err,derr,rerr,cerr,mo; X struct stat stb; X X! OSfname(path,pdir,file,F_DATA); /* create data file name */ X X if (DBOSI) X printf("OSCreateFile: creating %s with %s\n",path, X X--- 2426,2435 ----- X int err,derr,rerr,cerr,mo; X struct stat stb; X X! OSfname(p_ath,pdir,file,F_DATA); /* create data file name */ X! #ifdef NOCASEMATCH X! noCaseMatch(p_ath); X! #endif NOCASEMATCH X X if (DBOSI) X printf("OSCreateFile: creating %s with %s\n",p_ath, X*************** X*** 2217,2223 X OSfname(path,pdir,file,F_DATA); /* create data file name */ X X if (DBOSI) X! printf("OSCreateFile: creating %s with %s\n",path, X (delf) ? "OverWrite" : "No OverWrite"); X X err = unix_stat(pathstr(pdir),&stb); X X--- 2432,2438 ----- X #endif NOCASEMATCH X X if (DBOSI) X! printf("OSCreateFile: creating %s with %s\n",p_ath, X (delf) ? "OverWrite" : "No OverWrite"); X X err = unix_stat(pathstr(pdir),&stb); X*************** X*** 2226,2233 X mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid); X X /* should never get aeObjectExists if delf was true */ X! OSfname(path,pdir,file,F_DATA); /* create data fork */ X! derr = unix_create(path,delf,mo); /* using user delete flag */ X if (derr != noErr && derr != aeObjectExists) { X if (DBOSI) X printf("OSCreateFile: DATA fork create failed\n"); X X--- 2441,2447 ----- X mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid); X X /* should never get aeObjectExists if delf was true */ X! derr = unix_create(p_ath,delf,mo); /* using user delete flag */ X if (derr != noErr && derr != aeObjectExists) { X if (DBOSI) X printf("OSCreateFile: DATA fork create failed\n"); X*************** X*** 2233,2240 X printf("OSCreateFile: DATA fork create failed\n"); X /* previously under a conditional on delf, but not necessary */ X /* anymore because we don't get here if the object was already there */ X! OSfname(path,pdir,file,F_DATA); X! cerr = unix_unlink(path); /* clean up... */ X if (cerr != noErr && DBOSI) X printf("OSCreateFile: cleanup failed\n"); X return(derr); X X--- 2447,2453 ----- X printf("OSCreateFile: DATA fork create failed\n"); X /* previously under a conditional on delf, but not necessary */ X /* anymore because we don't get here if the object was already there */ X! cerr = unix_unlink(p_ath); /* clean up... */ X if (cerr != noErr && DBOSI) X printf("OSCreateFile: cleanup failed\n"); X return(derr); X*************** X*** 2240,2246 X return(derr); X } X X! OSfname(path,pdir,file,F_RSRC); /* try creating resource fork */ X rerr = unix_create(path,delf,mo); /* ... */ X if (rerr != noErr && rerr != aeObjectExists && rerr != aeObjectNotFound) { X if (DBOSI) X X--- 2453,2460 ----- X return(derr); X } X X! strcpy(path,p_ath); X! toResFork(path,file); /* try creating resource fork */ X rerr = unix_create(path,delf,mo); /* ... */ X if (rerr != noErr && rerr != aeObjectExists && rerr != aeObjectNotFound) { X if (DBOSI) X*************** X*** 2247,2253 X printf("OSCreateFile: RSRC create failed\n"); X /* previously under a conditional on delf, but not necessary */ X /* anymore because we don't get here if the object was already there */ X- OSfname(path,pdir,file,F_RSRC); X cerr = unix_unlink(path); /* clean up... */ X if (cerr != noErr && DBOSI) X printf("OSCreateFile: cleanup failed\n"); X X--- 2461,2466 ----- X printf("OSCreateFile: RSRC create failed\n"); X /* previously under a conditional on delf, but not necessary */ X /* anymore because we don't get here if the object was already there */ X cerr = unix_unlink(path); /* clean up... */ X if (cerr != noErr && DBOSI) X printf("OSCreateFile: cleanup failed\n"); X*************** X*** 2255,2261 X return(rerr); X } X X! OSfname(path,pdir,file,F_FNDR); /* create finder fork */ X err = unix_create(path,TRUE,mo); X /* ignore error here - exactly what should be done? */ X X X--- 2468,2475 ----- X return(rerr); X } X X! strcpy(path,p_ath); X! toFinderInfo(path,file); /* create finder fork */ X err = unix_create(path,TRUE,mo); X /* ignore error here - exactly what should be done? */ X X*************** X*** 2277,2282 X char path[MAXPATHLEN]; X char *ms; X int mo; X X OSfname(path,pdir,file,typ); /* expand name */ X X X--- 2491,2499 ----- X char path[MAXPATHLEN]; X char *ms; X int mo; X+ #ifdef NOCASEMATCH X+ register int i; X+ #endif NOCASEMATCH X X OSfname(path,pdir,file,typ); /* expand name */ X X*************** X*** 2298,2303 X if (DBOSI) X printf("OSOpenFork: Opening %s for %s\n",path,ms); X X return(unix_open(path,mo,fhdl)); X } X X X--- 2515,2527 ----- X if (DBOSI) X printf("OSOpenFork: Opening %s for %s\n",path,ms); X X+ #ifdef NOCASEMATCH X+ if((i = unix_open(path,mo,fhdl)) != noErr) { X+ noCaseFind(path); X+ i = unix_open(path,mo,fhdl); X+ } X+ return(i); X+ #else NOCASEMATCH X return(unix_open(path,mo,fhdl)); X #endif NOCASEMATCH X } X*************** X*** 2299,2304 X printf("OSOpenFork: Opening %s for %s\n",path,ms); X X return(unix_open(path,mo,fhdl)); X } X X X X--- 2523,2529 ----- X return(i); X #else NOCASEMATCH X return(unix_open(path,mo,fhdl)); X+ #endif NOCASEMATCH X } X X SHAR_EOF if test 41043 -ne "`wc -c < 'afpos.c.diff'`" then echo shar: error transmitting "'afpos.c.diff'" '(should have been 41043 characters)' fi fi # end of overwriting check # End of shell archive exit 0 --- end of part 2 ---