Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!djh From: djh@cs.mu.oz.au (David Hornsby) Newsgroups: comp.protocols.appletalk Subject: CAP/AUFS bug & patch Message-ID: <6242@munnari.oz.au> Date: 11 Dec 90 07:49:32 GMT Organization: Comp Sci, Melbourne Uni, Australia Lines: 70 priority: low/medium affects: all CAP 5.0 & derived distributions The AFP command FPCreateFile contains a flag to specify a hard or soft create (soft create returns ObjectExists if a file by that name already exists). AUFS never detects a hard create attempt due to an incorrect bit mask. Fortunately (or otherwise) the Mac AppleShare client software ignores the returned error and works around it by rewriting the file forks. AppleShare PC, however, performs differently and a write or copy over an existing file fails with an error. The following patches should be applied to the files netat/afpcmd.h and applications/aufs/afpfile.c (the latter is a fix for a debug print only). Your line numbers will probably vary ... --------------------cut-x-here---------------------- *** afpcmd.h.orig Tue Dec 11 18:12:21 1990 --- afpcmd.h Tue Dec 11 03:42:15 1990 *************** *** 118,124 **** typedef struct { /* FPCreateFile */ byte crf_cmd; /* command */ byte crf_flg; /* flags */ ! #define CRF_HARD 0x01 /* hard create */ word crf_volid; /* volume id */ sdword crf_dirid; /* directory id */ byte crf_ptype; /* path name type */ --- 120,126 ---- typedef struct { /* FPCreateFile */ byte crf_cmd; /* command */ byte crf_flg; /* flags */ ! #define CRF_HARD 0x80 /* hard create */ word crf_volid; /* volume id */ sdword crf_dirid; /* directory id */ byte crf_ptype; /* path name type */ --------------------cut-x-here---------------------- *** afpfile.c.orig Tue Dec 11 18:22:12 1990 --- afpfile.c Tue Dec 11 03:31:59 1990 *************** *** 104,111 **** delf = (crf.crf_flg & CRF_HARD) != 0; if (DBFIL) ! printf("FPCreateFile flg=%s, path=%s, fn=%s\n", ! crf.crf_flg,pathstr(ipdir),file); err = OSCreateFile(ipdir,file,delf); if (err == noErr) /* if success */ --- 106,113 ---- delf = (crf.crf_flg & CRF_HARD) != 0; if (DBFIL) ! printf("FPCreateFile flg=%02x, delf=%d, path=%s, fn=%s\n", ! crf.crf_flg,delf,pathstr(ipdir),file); err = OSCreateFile(ipdir,file,delf); if (err == noErr) /* if success */ --------------------cut-x-here---------------------- - David David Hornsby Professional Officer djh@munnari.OZ.AU Department of Computer Science "The home of Multigate" +61 3 344 4044 The University of Melbourne, Parkville, 3052, Victoria, Australia.