#include "utils.h"
#include "fuse_xattrs_config.h"
#include "stringmem.h"
+#include "xattrs_config.h"
#include <sys/xattr.h>
return 0;
}
+// Ensure existence of tail path from either source_dir or sidecar_dir
static int ensure_dirs(char *path) {
int n = strlen( path );
char *p = stralloc( n+1 );
memcpy( p, path, n+1 );
char *e = p + 1;
+ if ( strncmp( path, xattrs_config.source_dir,
+ xattrs_config.source_dir_size ) == 0 ) {
+ e += xattrs_config.source_dir_size;
+ } else if ( strncmp( path, xattrs_config.sidecar_dir,
+ xattrs_config.sidecar_dir_size ) == 0 ) {
+ e += xattrs_config.sidecar_dir_size;
+ }
+ if ( e - p >= n ) {
+ return 0;
+ }
for ( ;; ) {
while ( *e && *e != '/' ) e++;
if ( *e ) {