# usedots -> don't do :hex translation for dot files. note: when
# this option gets set, certain file names
# become illegal. these are .Parent and
+# anything that starts with .Apple.
+# invisibledots -> don't do :hex translation for dot files. note: when
+# this option gets set, certain file names
+# become illegal. these are .Parent and
# anything that starts with .Apple. also, dot
# files created on the unix side are marked
# invisible.
/* -------------------- */
static struct finderinfo *
-unpack_finderinfo(char *upath, struct adouble *adp, struct finderinfo *finfo)
+unpack_finderinfo(struct vol *vol, struct path *path, struct adouble **adp, struct finderinfo *finfo)
{
packed_finder buf;
void *ptr;
- ptr = get_finderinfo(upath, adp, &buf);
+ *adp = adl_lkup(vol, path, *adp);
+ ptr = get_finderinfo(vol, path->u_name, *adp, &buf);
return unpack_buffer(finfo, ptr);
}
/* Check file type ID */
if ((c1.rbitmap & (1<<DIRPBIT_FINFO)) && c2.finfo.f_type != 0) {
- adp = adl_lkup(vol, path, adp);
- finfo = unpack_finderinfo(path->u_name, adp, &finderinfo);
+ finfo = unpack_finderinfo(vol, path, &adp, &finderinfo);
if (finfo->f_type != c1.finfo.f_type)
goto crit_check_ret;
}
/* Check creator ID */
if ((c1.rbitmap & (1<<DIRPBIT_FINFO)) && c2.finfo.creator != 0) {
if (!finfo) {
- adp = adl_lkup(vol, path, adp);
- finfo = unpack_finderinfo(path->u_name, adp, &finderinfo);
+ finfo = unpack_finderinfo(vol, path, &adp, &finderinfo);
}
if (finfo->creator != c1.finfo.creator)
goto crit_check_ret;
/* Check finder info attributes */
if ((c1.rbitmap & (1<<DIRPBIT_FINFO)) && c2.finfo.attrs != 0) {
if (!finfo) {
- adp = adl_lkup(vol, path, adp);
- finfo = unpack_finderinfo(path->u_name, adp, &finderinfo);
+ finfo = unpack_finderinfo(vol, path, &adp, &finderinfo);
}
if ((finfo->attrs & c2.finfo.attrs) != c1.finfo.attrs)
/* Check label */
if ((c1.rbitmap & (1<<DIRPBIT_FINFO)) && c2.finfo.label != 0) {
if (!finfo) {
- adp = adl_lkup(vol, path, adp);
- finfo = unpack_finderinfo(path->u_name, adp, &finderinfo);
+ finfo = unpack_finderinfo(vol, path, &adp, &finderinfo);
}
if ((finfo->label & c2.finfo.label) != c1.finfo.label)
goto crit_check_ret;
/*
- * $Id: directory.c,v 1.82 2005-09-28 09:43:04 didg Exp $
+ * $Id: directory.c,v 1.83 2006-09-19 23:00:49 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
return st->st_ctime == dir->ctime && (dir->d_flags & DIRF_CNID);
}
+/* --------------------- */
+static int invisible_dots(const struct vol *vol, const char *name)
+{
+ return vol_inv_dots(vol) && *name == '.' && strcmp(name, ".") && strcmp(name, "..");
+}
+
/* ------------------------------
(".", curdir)
(name, dir) with curdir:name == dir, from afp_enumerate
case DIRPBIT_ATTR :
if ( isad ) {
ad_getattr(&ad, &ashort);
- } else if (*dir->d_u_name == '.' && strcmp(dir->d_u_name, ".")
- && strcmp(dir->d_u_name, "..")) {
+ } else if (invisible_dots(vol, dir->d_u_name)) {
ashort = htons(ATTRBIT_INVISIBLE);
} else
ashort = 0;
ashort = htons(FINDERINFO_CLOSEDVIEW);
memcpy(data + FINDERINFO_FRVIEWOFF, &ashort, sizeof(ashort));
- /* dot files are by default invisible */
- if (*dir->d_u_name == '.' && strcmp(dir->d_u_name , ".") &&
- strcmp(dir->d_u_name , "..")) {
+ /* dot files are by default visible */
+ if (invisible_dots(vol, dir->d_u_name)) {
ashort = htons(FINDERINFO_INVISIBLE);
- memcpy(data + FINDERINFO_FRFLAGOFF,
- &ashort, sizeof(ashort));
+ memcpy(data + FINDERINFO_FRFLAGOFF, &ashort, sizeof(ashort));
}
}
data += 32;
/*
- * $Id: file.c,v 1.101 2006-09-15 00:09:23 didg Exp $
+ * $Id: file.c,v 1.102 2006-09-19 23:00:49 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
}
/* FIXME path : unix or mac name ? (for now it's unix name ) */
-void *get_finderinfo(const char *upath, struct adouble *adp, void *data)
+void *get_finderinfo(const struct vol *vol, const char *upath, struct adouble *adp, void *data)
{
struct extmap *em;
void *ad_finder = NULL;
else {
memcpy(data, ufinderi, ADEDLEN_FINDERI);
chk_ext = 1;
- if (*upath == '.') { /* make it invisible */
+ if (vol_inv_dots(vol) && *upath == '.') { /* make it invisible */
u_int16_t ashort;
ashort = htons(FINDERINFO_INVISIBLE);
case FILPBIT_ATTR :
if ( adp ) {
ad_getattr(adp, &ashort);
- } else if (*upath == '.') {
+ } else if (vol_inv_dots(vol) && *upath == '.') {
ashort = htons(ATTRBIT_INVISIBLE);
} else
ashort = 0;
break;
case FILPBIT_FINFO :
- get_finderinfo(upath, adp, (char *)data);
+ get_finderinfo(vol, upath, adp, (char *)data);
data += ADEDLEN_FINDERI;
break;
/*
- * $Id: file.h,v 1.18 2005-04-28 20:49:42 bfernhomberg Exp $
+ * $Id: file.h,v 1.19 2006-09-19 23:00:50 didg Exp $
*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
extern int copyfile __P((const struct vol *, const struct vol *, char *, char *, char *, struct adouble *));
extern int deletefile __P((const struct vol *, char *, int));
-extern void *get_finderinfo __P((const char *, struct adouble *, void *));
+extern void *get_finderinfo __P((const struct vol *, const char *, struct adouble *, void *));
extern size_t mtoUTF8 __P((const struct vol *, const char *, size_t , char *, size_t ));
extern int copy_path_name __P((const struct vol *, char *, char *i));
/*
- * $Id: volume.c,v 1.66 2006-09-15 00:05:51 didg Exp $
+ * $Id: volume.c,v 1.67 2006-09-19 23:00:50 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
options[VOLOPT_FLAGS].i_value |= AFPVOL_NOHEX;
else if (strcasecmp(p, "usedots") == 0)
options[VOLOPT_FLAGS].i_value |= AFPVOL_USEDOTS;
+ else if (strcasecmp(p, "invisibledots") == 0)
+ options[VOLOPT_FLAGS].i_value |= AFPVOL_USEDOTS | AFPVOL_INV_DOTS;
else if (strcasecmp(p, "limitsize") == 0)
options[VOLOPT_FLAGS].i_value |= AFPVOL_LIMITSIZE;
/* support for either "dropbox" or "dropkludge" */
volume->v_ad_options |= ADVOL_CACHE;
if ((volume->v_flags & AFPVOL_UNIX_PRIV))
volume->v_ad_options |= ADVOL_UNIXPRIV;
+ if ((volume->v_flags & AFPVOL_INV_DOTS))
+ volume->v_ad_options |= ADVOL_INVDOTS;
if (options[VOLOPT_PASSWORD].c_value)
volume->v_password = strdup(options[VOLOPT_PASSWORD].c_value);
/*
- * $Id: volume.h,v 1.23 2005-06-02 12:32:18 didg Exp $
+ * $Id: volume.h,v 1.24 2006-09-19 23:00:50 didg Exp $
*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#endif /* NO_LARGE_VOL_SUPPORT */
#define AFPVOL_OPEN (1<<0)
-#define AFPVOL_DT (1<<1)
+/* flags for AFS and quota 0xxx0 */
#define AFPVOL_GVSMASK (7<<2)
#define AFPVOL_NONE (0<<2)
#define AFPVOL_AFSGVS (1<<2)
#define AFPVOL_EILSEQ (1 << 20) /* encode illegal sequence 'asis' UCS2, ex "\217-", which is not
a valid SHIFT-JIS char, is encoded as U\217 -*/
-#define AFPVOL_CACHE (1 << 21) /* Use adouble v2 CNID caching, default don't use it */
+#define AFPVOL_CACHE (1 << 21) /* Use adouble v2 CNID caching, default don't use it */
+#define AFPVOL_INV_DOTS (1 << 22) /* dots files are invisible */
/* FPGetSrvrParms options */
#define AFPSRVR_CONFIGINFO (1 << 0)
#define vol_unix_priv(vol) (afp_version >= 30 && ((vol)->v_flags & AFPVOL_UNIX_PRIV))
+#define vol_inv_dots(vol) (((vol)->v_flags & AFPVOL_INV_DOTS) ? 1 : 0)
+
extern struct vol *getvolbyvid __P((const u_int16_t));
extern int ustatfs_getvolspace __P((const struct vol *,
VolSpace *, VolSpace *,
/*
- * $Id: adouble.h,v 1.29 2005-09-28 09:46:37 didg Exp $
+ * $Id: adouble.h,v 1.30 2006-09-19 23:00:50 didg Exp $
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#define ADVOL_CACHE (1 << 1)
/* adouble unix priv */
#define ADVOL_UNIXPRIV (1 << 2)
+/* dot files (.DS_Store) are invisible) */
+#define ADVOL_INVDOTS (1 << 3)
/* lock flags */
#define ADLOCK_CLR (0)
/*
- * $Id: ad_open.c,v 1.35 2005-05-25 18:24:24 didg Exp $
+ * $Id: ad_open.c,v 1.36 2006-09-19 23:00:50 didg Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
* Copyright (c) 1990,1991 Regents of The University of Michigan.
}
/* make things invisible */
- if ((*path == '.') && strcmp(path, ".") && strcmp(path, "..")) {
+ if ((ad->ad_options & ADVOL_INVDOTS) && (*path == '.') && strcmp(path, ".") && strcmp(path, "..")) {
ashort = htons(ATTRBIT_INVISIBLE);
ad_setattr(ad, ashort);
ashort = htons(FINDERINFO_INVISIBLE);
- memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF,
- &ashort, sizeof(ashort));
+ memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF, &ashort, sizeof(ashort));
}
if (stat(path, &st) < 0) {