/*
- * $Id: adouble.h,v 1.24 2005-04-28 20:49:51 bfernhomberg Exp $
+ * $Id: adouble.h,v 1.29 2005-09-28 09:46:37 didg Exp $
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
char ad_filler[ 16 ];
struct ad_entry ad_eid[ ADEID_MAX ];
struct ad_fd ad_df, ad_hf;
- int ad_flags, ad_inited;
+ int ad_flags;
+ unsigned int ad_inited;
int ad_options;
int ad_refcount; /* used in afpd/ofork.c */
off_t ad_rlen; /* ressource fork len with AFP 3.0
the header parameter size is too small.
*/
+ char *ad_m_name; /* mac name for open fork */
+ int ad_m_namelen;
+
char *(*ad_path)(const char *, int);
int (*ad_mkrf)(char *);
/* adouble v2 cnid cache */
#define ADVOL_NODEV (1 << 0)
#define ADVOL_CACHE (1 << 1)
+/* adouble unix priv */
+#define ADVOL_UNIXPRIV (1 << 2)
/* lock flags */
#define ADLOCK_CLR (0)
extern int ad_stat __P((const char *, struct stat *));
extern int ad_metadata __P((const char *, int, struct adouble *));
-#if 0
-#define ad_metadata(name, flags, adp) ad_open(name, ADFLAGS_HF|(flags), O_RDONLY, 0666, adp)
-#endif
+#define ad_open_metadata(name, flags, mode, adp)\
+ ad_open(name, ADFLAGS_HF|(flags), O_RDWR |(mode), 0666, (adp))
-/* extend header to RW if R or W (W if R for locking),
+#define ad_flush_metadata(adp) ad_flush( (adp), ADFLAGS_HF)
+#define ad_close_metadata(adp) ad_close( (adp), ADFLAGS_HF)
+
+/* build a resource fork mode from the data fork mode:
+ * remove X mode and extend header to RW if R or W (W if R for locking),
*/
#ifndef ATACC
#ifndef __inline__
#endif
static __inline__ mode_t ad_hf_mode (mode_t mode)
{
-#if 0
- mode |= S_IRUSR;
-#endif
+ mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH);
/* fnctl lock need write access */
if ((mode & S_IRUSR))
mode |= S_IWUSR;