/*
- * $Id: auth.c,v 1.56 2009-02-16 13:49:20 franklahm Exp $
+ * $Id: auth.c,v 1.57 2009-02-25 16:14:08 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
uam_afpserver_action(72, UAM_AFPSERVER_POSTAUTH, afp_listextattr, NULL);
#endif
case 31:
- uam_afpserver_action(AFP_ENUMERATE_EXT2, UAM_AFPSERVER_POSTAUTH, afp_enumerate_ext2, NULL);
+ uam_afpserver_action(AFP_ENUMERATE_EXT2, UAM_AFPSERVER_POSTAUTH, afp_enumerate_ext2, NULL);
+ uam_afpserver_action(76, UAM_AFPSERVER_POSTAUTH, afp_null, NULL);
+ uam_afpserver_action(78, UAM_AFPSERVER_POSTAUTH, afp_syncdir, NULL);
+ uam_afpserver_action(79, UAM_AFPSERVER_POSTAUTH, afp_syncfork, NULL);
case 30:
uam_afpserver_action(AFP_ENUMERATE_EXT, UAM_AFPSERVER_POSTAUTH, afp_enumerate_ext, NULL);
uam_afpserver_action(AFP_BYTELOCK_EXT, UAM_AFPSERVER_POSTAUTH, afp_bytelock_ext, NULL);
/*
- * $Id: fork.c,v 1.57 2008-12-03 18:35:44 didg Exp $
+ * $Id: fork.c,v 1.58 2009-02-25 16:14:08 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
return( AFP_OK );
}
+/*
+ There is a lot to tell about fsync, fdatasync, F_FULLFSYNC.
+ fsync(2) on OSX is implemented differently than on other platforms.
+ see: http://mirror.linux.org.au/pub/linux.conf.au/2007/video/talks/278.pdf.
+ */
+int afp_syncfork(obj, ibuf, ibuflen, rbuf, rbuflen )
+ AFPObj *obj;
+ char *ibuf, *rbuf _U_;
+ int ibuflen _U_, *rbuflen;
+{
+ struct ofork *ofork;
+ u_int16_t ofrefnum;
+
+ *rbuflen = 0;
+ ibuf += 2;
+
+ memcpy(&ofrefnum, ibuf, sizeof(ofrefnum));
+ ibuf += sizeof( ofrefnum );
+
+ if (NULL == ( ofork == of_find( ofrefnum )) ) {
+ LOG(log_error, logtype_afpd, "afpd_syncfork: of_find(%d) could not locate fork", ofrefnum );
+ return( AFPERR_PARAM );
+ }
+
+ if ( flushfork( ofork ) < 0 ) {
+ LOG(log_error, logtype_afpd, "flushfork(%s): %s", of_name(ofork), strerror(errno) );
+ return AFPERR_MISC;
+ }
+
+ return( AFP_OK );
+}
+
+
/* this is very similar to closefork */
int flushfork( ofork )
struct ofork *ofork;
}
if ( ad_reso_fileno( ofork->of_ad ) != -1 && /* HF */
- (ofork->of_flags & AFPFORK_RSRC)) {
+ (ofork->of_flags & AFPFORK_RSRC)) {
/* read in the rfork length */
ad_refresh(ofork->of_ad);
/*
- * $Id: fork.h,v 1.11 2008-12-03 18:35:44 didg Exp $
+ * $Id: fork.h,v 1.12 2009-02-25 16:14:08 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
extern int afp_bytelock_ext __P((AFPObj *, char *, int, char *, int *));
extern int afp_read_ext __P((AFPObj *, char *, int, char *, int *));
extern int afp_write_ext __P((AFPObj *, char *, int, char *, int *));
+extern int afp_syncfork __P((AFPObj *, char *, int, char *, int *));
#endif
/*
- * $Id: switch.c,v 1.15 2009-02-02 11:55:01 franklahm Exp $
+ * $Id: switch.c,v 1.16 2009-02-25 16:14:08 franklahm Exp $
*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, /* 64 - 71 */
NULL, NULL, NULL, NULL,
- NULL, NULL, afp_syncdir, NULL, /* 72 - 79 */
+ NULL, NULL, NULL, NULL, /* 72 - 79 */
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, /* 80 - 87 */
NULL, NULL, NULL, NULL,