NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/57103: ls prints error message with autofs



The following reply was made to PR bin/57103; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/57103: ls prints error message with autofs
Date: Sun, 11 Dec 2022 17:44:26 +0700

     Date:        Sun, 11 Dec 2022 10:10:01 +0000 (UTC)
     From:        mlelstv%serpens.de@localhost (Michael van Elst)
     Message-ID:  <20221211101001.62C331A9239%mollari.NetBSD.org@localhost>
 
   |  Either autofs should learn the pathconf operation or ls should learn
   |  that the error EOPNOTSUPP for this operation should be handled silently.
 
 Probably both.
 
 The following should fix the ls issue, but I'm unable to test it,
 I have nothing that uses ACLs (to verify they can still be obtained)
 nor do I use autofs to encounter the error case.
 
 Perhaps someone who does have either one of those abilities could test
 this, and if it works, it can be committed.   (Note: it is not needed that
 anyone be able to test both aspects).
 
 The patch includes a small amount of code reordering so line wrapping can
 be avoided...
 
 kre
 
 Index: print.c
 ===================================================================
 RCS file: /cvsroot/src/bin/ls/print.c,v
 retrieving revision 1.57
 diff -u -r1.57 print.c
 --- print.c	17 May 2020 23:34:11 -0000	1.57
 +++ print.c	11 Dec 2022 10:37:25 -0000
 @@ -542,21 +542,22 @@
  		supports_acls = 0;
  
  		ret = lpathconf(name, _PC_ACL_NFS4);
 -		if (ret > 0) {
 -			type = ACL_TYPE_NFS4;
 -			supports_acls = 1;
 -		} else if (ret < 0 && errno != EINVAL) {
 +		f (ret < 0 && errno != EINVAL && errno != EOPNOTSUPP) {
  			warn("%s", name);
  			return;
  		}
 -		if (supports_acls == 0) {
 +		if (ret > 0) {
 +			type = ACL_TYPE_NFS4;
 +			supports_acls = 1;
 +		} else {
  			ret = lpathconf(name, _PC_ACL_EXTENDED);
 +			if (ret < 0 && errno != EINVAL && errno != EOPNOTSUPP) {
 +				warn("%s", name);
 +				return;
 +			}
  			if (ret > 0) {
  				type = ACL_TYPE_ACCESS;
  				supports_acls = 1;
 -			} else if (ret < 0 && errno != EINVAL) {
 -				warn("%s", name);
 -				return;
  			}
  		}
  	}
 
 


Home | Main Index | Thread Index | Old Index