From c4769f333e1426b942a7ee7d52883beb4fc553a2 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 25 Aug 2024 10:55:32 +0200 Subject: [PATCH] Separated errors about Linux file attributes from those of xattr and ACL --- libisofs/fs_local.c | 14 +++++++------- libisofs/libisofs.h | 12 ++++++++++++ libisofs/messages.c | 6 ++++++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/libisofs/fs_local.c b/libisofs/fs_local.c index e67fcce..383bef9 100644 --- a/libisofs/fs_local.c +++ b/libisofs/fs_local.c @@ -980,9 +980,9 @@ int iso_local_get_lfa_flags(char *disk_path, uint64_t *lfa_flags, int *max_bit, return 3; ret = aaip_get_lfa_flags(disk_path, lfa_flags, max_bit, os_errno, 0); if(ret == 0) - return ISO_AAIP_NOT_ENABLED; - if (ret < 0) - return ISO_AAIP_NO_GET_LOCAL; + return ISO_LFA_NOT_ENABLED; + if(ret < 0) + return ISO_LFA_NO_SET_LOCAL; return ret; } @@ -1025,17 +1025,17 @@ int iso_local_set_lfa_flags(char *disk_path, uint64_t lfa_flags, int max_bit, ret = aaip_get_lfa_flags(disk_path, &eff_flags, &old_max_bit, os_errno, 0); if (ret == 0) - return ISO_AAIP_NOT_ENABLED; + return ISO_LFA_NOT_ENABLED; if (ret < 0) - return ISO_AAIP_NO_GET_LOCAL; + return ISO_LFA_NO_GET_LOCAL; eff_flags &= ~change_mask; eff_flags |= (lfa_flags & change_mask); } ret= aaip_set_lfa_flags(disk_path, eff_flags, max_bit, os_errno, 0); if(ret == 0) - return ISO_AAIP_NOT_ENABLED; + return ISO_LFA_NOT_ENABLED; if(ret < 0) - return ISO_AAIP_NO_SET_LOCAL; + return ISO_LFA_NO_SET_LOCAL; return ret; } diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 22ddcad..97c3e67 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -9700,6 +9700,18 @@ int iso_conv_name_chars(IsoWriteOpts *opts, char *name, size_t name_len, (WARNING,HIGH, -431) */ #define ISO_LFA_UNKNOWN_BIT 0xD030FE51 +/** Local Linux-like file attribute processing not enabled at compile time + (SORRY,HIGH, -432) */ +#define ISO_LFA_NOT_ENABLED 0xE030FE50 + +/** Error with getting Linux-like file attributes of local file + (SORRY,HIGH, -433) */ +#define ISO_LFA_NO_GET_LOCAL 0xE030FE4F + +/** Error with setting Linux-like file attributes of local file + (SORRY,HIGH, -434) */ +#define ISO_LFA_NO_SET_LOCAL 0xE030FE4E + /* Internal developer note: Place new error codes directly above this comment. diff --git a/libisofs/messages.c b/libisofs/messages.c index 8798de1..2b6f8c0 100644 --- a/libisofs/messages.c +++ b/libisofs/messages.c @@ -577,6 +577,12 @@ const char *iso_error_to_msg(int errcode) return "Unknown Linux-like chattr letter encountered during conversion"; case ISO_LFA_UNKNOWN_BIT: return "Unknown Linux-like file attribute flag bit encountered during conversion"; + case ISO_LFA_NOT_ENABLED: + return "Local Linux-like file attribute processing not enabled at compile time"; + case ISO_LFA_NO_GET_LOCAL: + return "Error with getting Linux-like file attributes of local file"; + case ISO_LFA_NO_SET_LOCAL: + return "Error with setting Linux-like file attributes of local file"; default: return "Unknown error"; }