/*
- $Id: ea_sys.c,v 1.7 2010-04-03 07:11:36 franklahm Exp $
+ $Id: ea_sys.c,v 1.8 2010-04-13 08:05:06 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
memset(rbuf, 0, 4);
*rbuflen += 4;
switch(errno) {
- case ELOOP:
+ case OPEN_NOFOLLOW_ERRNO:
/* its a symlink and client requested O_NOFOLLOW */
LOG(log_debug, logtype_afpd, "sys_getextattr_size(%s): encountered symlink with kXAttrNoFollow", uname);
return AFP_OK;
memset(rbuf, 0, 4);
*rbuflen += 4;
switch(errno) {
- case ELOOP:
+ case OPEN_NOFOLLOW_ERRNO:
/* its a symlink and client requested O_NOFOLLOW */
LOG(log_debug, logtype_afpd, "sys_getextattr_content(%s): encountered symlink with kXAttrNoFollow", uname);
return AFP_OK;
}
if (ret == -1) switch(errno) {
- case ELOOP:
+ case OPEN_NOFOLLOW_ERRNO:
/* its a symlink and client requested O_NOFOLLOW */
ret = AFPERR_BADTYPE;
+ goto exit;
+#ifdef HAVE_ATTROPEN /* Solaris */
+ case ENOATTR:
+ ret = AFP_OK;
+ goto exit;
+#endif
default:
LOG(log_error, logtype_afpd, "sys_list_extattr(%s): error opening atttribute dir: %s", uname, strerror(errno));
ret= AFPERR_MISC;
+ goto exit;
}
ptr = buf;
if (ret == -1) {
switch(errno) {
- case ELOOP:
+ case OPEN_NOFOLLOW_ERRNO:
/* its a symlink and client requested O_NOFOLLOW */
- LOG(log_debug, logtype_afpd, "sys_set_ea(%s/%s): encountered symlink with kXAttrNoFollow",
- uname, attruname);
+ LOG(log_debug, logtype_afpd, "sys_set_ea(\"%s/%s\", ea:'%s'): encountered symlink with kXAttrNoFollow",
+ getcwdpath(), uname, attruname);
return AFP_OK;
case EEXIST:
- LOG(log_debug, logtype_afpd, "sys_set_ea(%s/%s): EA already exists",
- uname, attruname);
+ LOG(log_debug, logtype_afpd, "sys_set_ea(\"%s/%s\", ea:'%s'): EA already exists",
+ getcwdpath(), uname, attruname);
return AFPERR_EXIST;
default:
- LOG(log_error, logtype_afpd, "sys_set_ea(%s/%s): error: %s", uname, attruname, strerror(errno));
+ LOG(log_error, 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" : "-",
+ oflag & O_NOFOLLOW ? "O_NOFOLLOW" : "-",
+ strerror(errno));
return AFPERR_MISC;
}
}
if (ret == -1) {
switch(errno) {
- case ELOOP:
+ case OPEN_NOFOLLOW_ERRNO:
/* its a symlink and client requested O_NOFOLLOW */
LOG(log_debug, logtype_afpd, "sys_remove_ea(%s/%s): encountered symlink with kXAttrNoFollow", uname);
return AFP_OK;