* FIX: afpd: .volinfo file not created on first volume access if user in rolist
* FIX: afpd: possible crash at startup when registering with Avahi when Avahi is
not running
+* FIX: afpd: return correct user/group type when mapping UUIDs to names
+* FIX: afpd: for directories add DARWIN_ACE_DELETE ACE if DARWIN_ACE_ADD_SUBDIRECTORY
+ is set
* FIX: cnid_dbd: increase BerkeleyDB locks and lockobjs
* FIX: cnid_dbd: implement -d option, deletes CNID db
* FIX: suse: initscript return better status
uuidtype_t uuidtype;
struct stat st;
bstring parent = NULL;
+ int is_dir;
LOG(log_maxdebug, logtype_afpd, "check_acl_access(dir: \"%s\", path: \"%s\", curdir: \"%s\", 0x%08x)",
cfrombstr(dir->d_fullpath), path, getcwdpath(), requested_rights);
goto EC_CLEANUP;
}
- if ((strcmp(path, ".") == 0) && (curdir->d_rights_cache != 0xffffffff)) {
+ is_dir = !strcmp(path, ".");
+
+ if (is_dir && (curdir->d_rights_cache != 0xffffffff)) {
/* its a dir and the cache value is valid */
allowed_rights = curdir->d_rights_cache;
LOG(log_debug, logtype_afpd, "check_access: allowed rights from dircache: 0x%08x", allowed_rights);
EC_ZERO_LOG(solaris_acl_rights(cfrombstr(parent), &st, &parent_rights));
#endif
#ifdef HAVE_POSIX_ACLS
- EC_ZERO_LOG(posix_acl_rights(path, &st, &allowed_rights));
+ EC_ZERO_LOG(posix_acl_rights(path, &st, &parent_rights));
#endif
if (parent_rights & (DARWIN_ACE_WRITE_DATA | DARWIN_ACE_DELETE_CHILD))
allowed_rights |= DARWIN_ACE_DELETE; /* man, that was a lot of work! */
}
+
+ if (is_dir) {
+ /* Without DARWIN_ACE_DELETE set OS X 10.6 refuses to rename subdirectories in a
+ * directory.
+ */
+ if (allowed_rights & DARWIN_ACE_ADD_SUBDIRECTORY)
+ allowed_rights |= DARWIN_ACE_DELETE;
+
+ dir->d_rights_cache = allowed_rights;
+ }
LOG(log_debug, logtype_afpd, "allowed rights: 0x%08x", allowed_rights);
- curdir->d_rights_cache = allowed_rights;
}
if ((requested_rights & allowed_rights) != requested_rights) {
case 2 : /* unicode */
case 4 :
- LOG(log_debug, logtype_afpd, "afp_mapname: gettgrnam for name: %s",ibuf);
+ LOG(log_debug, logtype_afpd, "afp_mapname: getgrnam for name: %s",ibuf);
if (NULL == ( gr = (struct group *)getgrnam( ibuf ))) {
return( AFPERR_NOITEM );
}
id = gr->gr_gid;
- LOG(log_debug, logtype_afpd, "afp_mapname: gettgrnam for name: %s -> id: %d",ibuf, id);
+ LOG(log_debug, logtype_afpd, "afp_mapname: getgrnam for name: %s -> id: %d",ibuf, id);
id = htonl(id);
memcpy( rbuf, &id, sizeof( id ));
*rbuflen = sizeof( id );
typedef unsigned char *uuidp_t;
typedef unsigned char atalk_uuid_t[UUID_BINSIZE];
-typedef enum {UUID_USER = 0,
- UUID_GROUP = 1,
+typedef enum {UUID_USER = 1,
+ UUID_GROUP = 2,
UUID_ENOENT = 4} /* used as bit flag */
uuidtype_t;
#define UUIDTYPESTR_MASK 3