From 70e3fcd8744752d6de0b93d089f41c28dca30bde Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 7 Nov 2013 12:29:57 +0100 Subject: [PATCH] Add support for AFP 3.4 --- NEWS | 1 + etc/afpd/auth.c | 5 +++-- etc/afpd/auth.h | 3 ++- libatalk/vfs/ea_sys.c | 7 ++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index e53f6134..f9e4f303 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ Changes in 3.1.1 * FIX: Fix ressource fork name conversion. Bug #534. * FIX: Fix a bug where only the first configured UAM was loaded. Bug #537. +* UPD: Add support for AFP 3.4. From FR #85. Changes in 3.1.0 ================ diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c index b4adf555..8011b56b 100644 --- a/etc/afpd/auth.c +++ b/etc/afpd/auth.c @@ -170,6 +170,7 @@ static int set_auth_switch(const AFPObj *obj, int expired) afp_switch = postauth_switch; switch (obj->afp_version) { + case 34: case 33: case 32: #ifdef HAVE_ACLS @@ -228,8 +229,8 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi return AFPERR_MAXSESS; } - LOG(log_note, logtype_afpd, "%s Login by %s", - afp_versions[afp_version_index].av_name, pwd->pw_name); + LOG(log_note, logtype_afpd, "Login by %s (%s)", + pwd->pw_name, afp_versions[afp_version_index].av_name); if (set_groups(obj, pwd) != 0) return AFPERR_BADUAM; diff --git a/etc/afpd/auth.h b/etc/afpd/auth.h index 2e9d6a58..f53513b6 100644 --- a/etc/afpd/auth.h +++ b/etc/afpd/auth.h @@ -20,7 +20,8 @@ static const struct afp_versions afp_versions[] = { { "AFPX03", 30 }, { "AFP3.1", 31 }, { "AFP3.2", 32 }, - { "AFP3.3", 33 } + { "AFP3.3", 33 }, + { "AFP3.4", 34 } }; /* for GetUserInfo */ diff --git a/libatalk/vfs/ea_sys.c b/libatalk/vfs/ea_sys.c index 374248bc..91e13e36 100644 --- a/libatalk/vfs/ea_sys.c +++ b/libatalk/vfs/ea_sys.c @@ -313,8 +313,13 @@ int sys_set_ea(VFS_FUNC_ARGS_EA_SET) LOG(log_debug, logtype_afpd, "sys_set_ea(\"%s/%s\", ea:'%s'): EA already exists", getcwdpath(), uname, attruname); return AFPERR_EXIST; + case ENOATTR: + case ENOENT: + if ((attr_flag & XATTR_REPLACE) && (vol->v_obj->afp_version >= 34)) + return AFPERR_NOITEM; + return AFPERR_MISC; default: - LOG(log_error, logtype_afpd, "sys_set_ea(\"%s/%s\", ea:'%s', size: %u, flags: %s|%s|%s): %s", + LOG(log_debug, logtype_afpd, "sys_set_ea(\"%s/%s\", ea:'%s', size: %u, flags: %s|%s|%s): %s", getcwdpath(), uname, attruname, attrsize, oflag & O_CREAT ? "XATTR_CREATE" : "-", oflag & O_TRUNC ? "XATTR_REPLACE" : "-", -- 2.39.2