[Box Backup-commit] COMMIT r3443 - in box/trunk: infrastructure/m4 lib/backupstore
subversion at boxbackup.org
subversion at boxbackup.org
Sat Dec 6 16:40:31 GMT 2014
Author: chris
Date: 2014-12-06 16:40:31 +0000 (Sat, 06 Dec 2014)
New Revision: 3443
Modified:
box/trunk/infrastructure/m4/boxbackup_tests.m4
box/trunk/lib/backupstore/BackupClientFileAttributes.cpp
Log:
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.
Modified: box/trunk/infrastructure/m4/boxbackup_tests.m4
===================================================================
--- box/trunk/infrastructure/m4/boxbackup_tests.m4 2014-12-06 16:07:05 UTC (rev 3442)
+++ box/trunk/infrastructure/m4/boxbackup_tests.m4 2014-12-06 16:40:31 UTC (rev 3443)
@@ -203,9 +203,11 @@
AC_CHECK_MEMBERS([DIR.dd_fd],,, [[#include <dirent.h>]])
AC_CHECK_MEMBERS([struct tcp_info.tcpi_rtt],,, [[#include <netinet/tcp.h>]])
+AC_CHECK_DECLS([O_BINARY])
+
+AC_CHECK_DECLS([ENOTSUP],,, [[#include <sys/errno.h>]])
AC_CHECK_DECLS([INFTIM],,, [[#include <poll.h>]])
AC_CHECK_DECLS([SO_PEERCRED],,, [[#include <sys/socket.h>]])
-AC_CHECK_DECLS([O_BINARY],,,)
AC_CHECK_DECLS([SOL_TCP],,, [[#include <netinet/tcp.h>]])
AC_CHECK_DECLS([TCP_INFO],,, [[#include <netinet/tcp.h>]])
Modified: box/trunk/lib/backupstore/BackupClientFileAttributes.cpp
===================================================================
--- box/trunk/lib/backupstore/BackupClientFileAttributes.cpp 2014-12-06 16:07:05 UTC (rev 3442)
+++ box/trunk/lib/backupstore/BackupClientFileAttributes.cpp 2014-12-06 16:40:31 UTC (rev 3443)
@@ -654,9 +654,18 @@
}
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 @@
else
{
THROW_SYS_FILE_ERROR("Failed to list extended "
- "attributes, skipping them", Filename,
+ "attributes for unknown reason", Filename,
CommonException, OSFileError);
}
}
More information about the Boxbackup-commit
mailing list