diff --git a/libisofs/aaip-os-linux.c b/libisofs/aaip-os-linux.c index 4bee1b1..bf2310f 100644 --- a/libisofs/aaip-os-linux.c +++ b/libisofs/aaip-os-linux.c @@ -526,6 +526,8 @@ ex:; @param flag Bitfield for control purposes. bit0= consider ENOTTY from FS_IOC_GETFLAGS an error (else return 4 on ENOTTY) + bit2= do not issue own error messages with operating + system errors @return 1= ok, all local attribute flags are in lfa_flags 2= ok, but some local flags could not be mapped to the FS_*_FL bits @@ -551,7 +553,8 @@ int aaip_get_lfa_flags(char *path, uint64_t *lfa_flags, int *max_bit, #ifdef FS_IOC_GETFLAGS fd= open(path, O_RDONLY | O_NDELAY); if(fd == -1) { - aaip_local_error("open(2)", path, errno, 0); + if(!(flag & 4)) + aaip_local_error("open(2)", path, errno, 0); *os_errno= errno; return(-1); } @@ -563,7 +566,8 @@ int aaip_get_lfa_flags(char *path, uint64_t *lfa_flags, int *max_bit, *max_bit= 23; return(4); } - aaip_local_error("ioctl(FS_IOC_GETFLAGS)", path, errno, 0); + if(!(flag & 4)) + aaip_local_error("ioctl(FS_IOC_GETFLAGS)", path, errno, 0); *os_errno= errno; return(-1); } @@ -878,6 +882,11 @@ ex:; } +/* + @param flag Bitfield for control purposes. + bit2= do not issue own error messages with operating + system errors +*/ int aaip_set_lfa_flags(char *path, uint64_t lfa_flags, int max_bit, int *os_errno, int flag) { @@ -900,7 +909,8 @@ int aaip_set_lfa_flags(char *path, uint64_t lfa_flags, int max_bit, fd= open(path, O_RDONLY | O_NDELAY); if(fd == -1) { - aaip_local_error("open(2)", path, errno, 0); + if(!(flag & 4)) + aaip_local_error("open(2)", path, errno, 0); *os_errno= errno; return(-1); } @@ -911,7 +921,8 @@ int aaip_set_lfa_flags(char *path, uint64_t lfa_flags, int max_bit, ret= ioctl(fd, FS_IOC_SETFLAGS, &ioctl_arg); close(fd); if(ret == -1) { - aaip_local_error("ioctl(FS_IOC_SETFLAGS)", path, errno, 0); + if(!(flag & 4)) + aaip_local_error("ioctl(FS_IOC_SETFLAGS)", path, errno, 0); *os_errno= errno; return(-1); } diff --git a/libisofs/fs_local.c b/libisofs/fs_local.c index 383bef9..192c6b3 100644 --- a/libisofs/fs_local.c +++ b/libisofs/fs_local.c @@ -948,7 +948,8 @@ int iso_local_get_perms_wo_acl(char *disk_path, mode_t *st_mode, int flag) /* * @param flag * Bitfield for control purposes - * bit5= in case of symbolic link: inquire link target + * bit2= do not issue own error messages with operating system errors + * bit5= in case of symbolic link: inquire link target * @return * 1= ok, lfa_flags is valid * 2= ok, but some local flags could not be mapped to the FS_*_FL bits @@ -978,7 +979,8 @@ int iso_local_get_lfa_flags(char *disk_path, uint64_t *lfa_flags, int *max_bit, } if ((stbuf.st_mode & S_IFMT) == S_IFLNK && !(flag & 32)) return 3; - ret = aaip_get_lfa_flags(disk_path, lfa_flags, max_bit, os_errno, 0); + ret = aaip_get_lfa_flags(disk_path, lfa_flags, max_bit, os_errno, + flag & 4); if(ret == 0) return ISO_LFA_NOT_ENABLED; if(ret < 0) @@ -991,6 +993,7 @@ int iso_local_get_lfa_flags(char *disk_path, uint64_t *lfa_flags, int *max_bit, * @param flag Bitfield for control purposes * bit0= do not try to change known superuser flags * bit1= change only known chattr settable flags + * bit2= do not issue own error messages with operating system errors * bit5= in case of symbolic link: inquire link target * @return * 1 = ok, all lfa_flags bits were written @@ -1023,7 +1026,7 @@ int iso_local_set_lfa_flags(char *disk_path, uint64_t lfa_flags, int max_bit, eff_flags = lfa_flags; } else { ret = aaip_get_lfa_flags(disk_path, &eff_flags, &old_max_bit, os_errno, - 0); + flag & 4); if (ret == 0) return ISO_LFA_NOT_ENABLED; if (ret < 0) @@ -1031,7 +1034,7 @@ int iso_local_set_lfa_flags(char *disk_path, uint64_t lfa_flags, int max_bit, eff_flags &= ~change_mask; eff_flags |= (lfa_flags & change_mask); } - ret= aaip_set_lfa_flags(disk_path, eff_flags, max_bit, os_errno, 0); + ret= aaip_set_lfa_flags(disk_path, eff_flags, max_bit, os_errno, flag & 4); if(ret == 0) return ISO_LFA_NOT_ENABLED; if(ret < 0) diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 97c3e67..da58738 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -8057,7 +8057,8 @@ int iso_local_set_attrs(char *disk_path, size_t num_attrs, char **names, * Else it will be filled with 0. * @param flag * Bitfield for control purposes - * bit5= in case of symbolic link: inquire link target + * bit2= do not issue own error messages with system call errors + * bit5= in case of symbolic link: inquire link target * @return * 1 = ok, lfa_flags is valid * 2 = ok, but some local flags could not be mapped to the FS_*_FL bits @@ -8101,6 +8102,7 @@ int iso_local_get_lfa_flags(char *disk_path, uint64_t *lfa_flags, int *max_bit, * Bitfield for control purposes * bit0= do not try to change known chattr superuser flags: iaj * bit1= change only known chattr settable flags: sucSiadAmjtDTCxPF + * bit2= do not issue own error messages with system call errors * bit5= in case of symbolic link: operate on link target * @return * 1 = ok, all lfa_flags bits were written