From 830646f3725527e5c101f0e53e4c02ba2300df52 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 6 Dec 2014 16:40:31 +0000 Subject: Fix detection of filesystems without extended attribute support on NetBSD. NetBSD (version 6) uses ENOTSUP as the errno code to indicate missing support for extended attribute in the filesystem. This appears to be at odds with other Unixes: https://mail-index.netbsd.org/tech-kern/2011/12/13/msg012185.html We need to detect and handle ENOTSUP to stop the backup daemon from killing itself while trying to read extended attributes from the first file in the backup set. --- lib/backupstore/BackupClientFileAttributes.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/backupstore/BackupClientFileAttributes.cpp b/lib/backupstore/BackupClientFileAttributes.cpp index 53215b7c..e331e107 100644 --- a/lib/backupstore/BackupClientFileAttributes.cpp +++ b/lib/backupstore/BackupClientFileAttributes.cpp @@ -654,9 +654,18 @@ void BackupClientFileAttributes::FillExtendedAttr(StreamableMemBlock &outputBloc } else if(listSize<0) { - if(errno == EOPNOTSUPP || errno == EACCES) + if(errno == EOPNOTSUPP || errno == EACCES +#if HAVE_DECL_ENOTSUP + // NetBSD uses ENOTSUP instead + // https://mail-index.netbsd.org/tech-kern/2011/12/13/msg012185.html + || errno == ENOTSUP +#endif + ) { - // fail silently + // Not supported by OS, or not on this filesystem + BOX_TRACE(BOX_SYS_ERRNO_MESSAGE(errno, + BOX_FILE_MESSAGE(Filename, "Failed to " + "list extended attributes"))); } else if(errno == ERANGE) { @@ -673,7 +682,7 @@ void BackupClientFileAttributes::FillExtendedAttr(StreamableMemBlock &outputBloc else { THROW_SYS_FILE_ERROR("Failed to list extended " - "attributes, skipping them", Filename, + "attributes for unknown reason", Filename, CommonException, OSFileError); } } -- cgit v1.2.3