Bug#488549: Acknowledgement (coreutils: ls -l still prints
John David Anglin [EMAIL PROTECTED] wrote: getfilecon_raw() uses getxattr(). The manpage for getxattr() says it returns ENOTSUP if extended attributes are not supported. This is a syscall and it will take a bit more digging to see if it is consistent with the documentation. I finally got a working version of strace. I see that lgetxattr() returns EOPNOTSUPP, not ENOTSUP. Thanks for the details. I'll push your fix pretty soon: From d5bacd2f6f8e1b677b3a88a0416c6ec10faee79a Mon Sep 17 00:00:00 2001 From: John David Anglin [EMAIL PROTECTED] Date: Mon, 4 Aug 2008 14:04:44 +0200 Subject: [PATCH] ls: ignore spurious getfilecon failure due to lack of SELinux support * src/ls.c (gobble_file): Upon failed getfilecon, treat an errno value of EOPNOTSUPP just like ENOTSUP. See http://bugs.debian.org/488549. --- src/ls.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/ls.c b/src/ls.c index fd32730..9261f62 100644 --- a/src/ls.c +++ b/src/ls.c @@ -2715,7 +2715,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode, ls fail just because the file (even a command line argument) isn't on the right type of file system. I.e., a getfilecon failure isn't in the same class as a stat failure. */ - if (errno == ENOTSUP || errno == ENODATA) + if (errno == ENOTSUP || errno == EOPNOTSUPP || errno == ENODATA) err = 0; } -- 1.6.0.rc1.36.g5ff70 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#488549: Acknowledgement (coreutils: ls -l still prints
John David Anglin [EMAIL PROTECTED] wrote: This is a hppa specific bug. It turns out the errno's for [this is regarding http://bugs.debian.org/488549 ] Thanks for the report and patch. The patch is required for the very latest, upstream, too, and I'm about to apply it. What versions of HPUX are affected? The attached change fixes the problem with ls, but doesn't fix the errno problem. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#488549: Acknowledgement (coreutils: ls -l still prints
What versions of HPUX are affected? Although sys/errno.h defines different values for ENOTSUP and EOPNOTSUPP (same as hppa-linux values), I have not seen this problem on HP-UX 10 or 11. It looks like getfilecon is selinux specific. On HP-UX, getacl() returns EOPNOTSUPP if the operation is not supported on the file system. I would guess it does this consistently. The attached change fixes the problem with ls, but doesn't fix the errno problem. It would seem that getfilecon() returns the wrong error code, or the manpage is wrong. I see that getfilecon_raw() can return EOPNOTSUPP: if (ret == 0) { /* Re-map empty attribute values to errors. */ errno = EOPNOTSUPP; ret = -1; } getfilecon_raw() uses getxattr(). The manpage for getxattr() says it returns ENOTSUP if extended attributes are not supported. This is a syscall and it will take a bit more digging to see if it is consistent with the documentation. Dave -- J. David Anglin [EMAIL PROTECTED] National Research Council of Canada (613) 990-0752 (FAX: 952-6602) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#488549: Acknowledgement (coreutils: ls -l still prints
getfilecon_raw() uses getxattr(). The manpage for getxattr() says it returns ENOTSUP if extended attributes are not supported. This is a syscall and it will take a bit more digging to see if it is consistent with the documentation. I finally got a working version of strace. I see that lgetxattr() returns EOPNOTSUPP, not ENOTSUP. Dave -- J. David Anglin [EMAIL PROTECTED] National Research Council of Canada (613) 990-0752 (FAX: 952-6602) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#488549: Acknowledgement (coreutils: ls -l still prints
This is a hppa specific bug. It turns out the errno's for ENOTSUP and EOPNOTSUPP are not the same: #define EOPNOTSUPP 223 /* Operation not supported on transport endpoint */ #define ENOTSUP 252 /* Function not implemented (POSIX.4 / HPUX) */ The manpage says getfilecon should return ENOTSUP but EOPNOTSUPP is actually returned: (gdb) bt #0 __error (status=0, errnum=223, message=0x28610 %s) at error.c:221 #1 0x00016e68 in gobble_file (name=0x3184b uname.o, type=normal, inode=1532062, command_line_arg=false, dirname=0x31768 .) at ../../coreutils-6.12/src/ls.c:2718 #2 0x00015ddc in print_dir (name=0x31768 ., realname=0x0, command_line_arg=true) at ../../coreutils-6.12/src/ls.c:2407 #3 0x00012ee8 in main (argc=2, argv=0xfb1ee6cc) at ../../coreutils-6.12/src/ls.c:1328 The attached change fixes the problem with ls, but doesn't fix the errno problem. Dave -- J. David Anglin [EMAIL PROTECTED] National Research Council of Canada (613) 990-0752 (FAX: 952-6602) --- ls.c.orig 2008-05-26 02:40:32.0 -0400 +++ ls.c2008-08-04 00:20:01.0 -0400 @@ -2700,7 +2700,7 @@ ls fail just because the file (even a command line argument) isn't on the right type of file system. I.e., a getfilecon failure isn't in the same class as a stat failure. */ - if (errno == ENOTSUP || errno == ENODATA) + if (errno == ENOTSUP || errno == EOPNOTSUPP || errno == ENODATA) err = 0; } -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#488549: Acknowledgement (coreutils: ls -l still prints
--- ls.c.orig 2008-05-26 02:40:32.0 -0400 +++ ls.c 2008-08-04 00:20:01.0 -0400 @@ -2700,7 +2700,7 @@ ls fail just because the file (even a command line argument) isn't on the right type of file system. I.e., a getfilecon failure isn't in the same class as a stat failure. */ - if (errno == ENOTSUP || errno == ENODATA) + if (errno == ENOTSUP || errno == EOPNOTSUPP || errno == ENODATA) err = 0; } Oh, I should have said this change is against 6.12. The change for 6.10 is similar but a little different. Dave -- J. David Anglin [EMAIL PROTECTED] National Research Council of Canada (613) 990-0752 (FAX: 952-6602) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]