/*
- $Id: extattrs.c,v 1.6 2009-10-15 10:43:13 didg Exp $
+ $Id: extattrs.c,v 1.7 2009-10-15 15:35:05 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
*/
int afp_listextattr(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
{
- int count, ret, oflag = 0;
+ int count, ret, oflag = 0, adflags = 0;
uint16_t vid, bitmap;
uint32_t did, maxreply, tmpattr;
struct vol *vol;
struct dir *dir;
struct path *s_path;
+ struct stat st;
struct adouble ad, *adp = NULL;
struct ofork *of;
char *uname, *FinderInfo;
adp = &ad;
}
- if ( ad_metadata( uname, 0, adp) < 0 ) {
+ stat(uname, &st);
+ if (S_ISDIR(st.st_mode))
+ adflags = ADFLAGS_DIR;
+
+ if ( ad_metadata( uname, adflags, adp) < 0 ) {
switch (errno) {
case EACCES:
LOG(log_error, logtype_afpd, "afp_listextattr(%s): %s: check resource fork permission?",
/*
- $Id: ea.c,v 1.5 2009-10-15 15:00:55 franklahm Exp $
+ $Id: ea.c,v 1.6 2009-10-15 15:35:05 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
memset(ea, 0, sizeof(struct ea));
ea->vol = vol; /* ea_close needs it */
-
ea->ea_flags = eaflags;
+ /* Dont check for errors, eg when removing the file is already gone */
+ stat(uname, &st);
if (S_ISDIR(st.st_mode))
ea->ea_flags |= EA_DIR;