+ if ((vol->v_flags & AFPVOL_RO) == AFPVOL_RO) {
+ LOG(log_note, logtype_afpd, "read-only volume '%s', can't test for EA support, assuming yes", vol->v_localname);
+ return 1;
+ }
+
+ mktemp(eaname);
+
+ become_root();
+
+ if ((sys_setxattr(vol->v_path, eaname, eacontent, 4, 0)) == 0) {
+ sys_removexattr(vol->v_path, eaname);
+ haseas = 1;
+ } else {
+ LOG(log_warning, logtype_afpd, "volume \"%s\" does not support Extended Attributes",
+ vol->v_localname);
+ haseas = 0;
+ }
+
+ unbecome_root();
+
+ return haseas;
+}