#define FUSE_USE_VERSION 26
-#include <sys/types.h> /* sometimes required before <attr/xattr.h> */
-
-#include <attr/xattr.h>
+#include <sys/types.h> /* sometimes required before <sys/xattr.h> */
+#include <sys/xattr.h>
#include <dirent.h>
#include <errno.h>
#include <fuse.h>
# define O_NOFOLLOW 0 /* Security only... */
#endif
+#ifndef ENOATTR
+# define ENOATTR ENODATA
+#endif
+
#define WIMFS_MQUEUE_NAME_LEN 32
#define WIMLIB_UNMOUNT_FLAG_SEND_PROGRESS 0x80000000
name[STAGING_FILE_NAME_LEN] = '\0';
retry:
- randomize_char_array_with_alnum(name, STAGING_FILE_NAME_LEN);
+ get_random_alnum_chars(name, STAGING_FILE_NAME_LEN);
fd = openat(ctx->staging_dir_fd, name,
O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW, 0600);
if (unlikely(fd < 0)) {
p = staging_dir_name;
p = mempcpy(p, wim_basename, wim_basename_len);
p = mempcpy(p, common_suffix, sizeof(common_suffix));
- randomize_char_array_with_alnum(p, random_suffix_len);
+ get_random_alnum_chars(p, random_suffix_len);
p += random_suffix_len;
*p = '\0';
return ret;
}
-static struct fuse_operations wimfs_operations = {
+static const struct fuse_operations wimfs_operations = {
.chmod = wimfs_chmod,
.chown = wimfs_chown,
.fgetattr = wimfs_fgetattr,
{
name[0] = '/';
memcpy(name + 1, "wimfs-", 6);
- randomize_char_array_with_alnum(name + 7, WIMFS_MQUEUE_NAME_LEN - 7);
+ get_random_alnum_chars(name + 7, WIMFS_MQUEUE_NAME_LEN - 7);
name[WIMFS_MQUEUE_NAME_LEN] = '\0';
}