[csw-maintainers] Testing for file existence

Dagobert Michelsen dam at opencsw.org
Tue Feb 23 14:46:31 CET 2010


Hi Maciej,

Am 23.02.2010 um 14:40 schrieb Maciej (Matchek) Blizinski:
> Here's something for Unix grey beards that I discovered when debugging
> a failing unit test in Google protobuf (protocol buffers).  Let's
> consider the following set of commands:
>
> cd /var/tmp
> touch ${LOGNAME}-foo
> test -e ${LOGNAME}-foo/ && echo yes || echo no
>
> (note the trailing slash)
>
> What is in your opinion the proper outcome?
>
> Our buildfarm machines don't seem to agree on the issue.  Here are the
> poll results:
>
> || build8s: no || build8x: yes ||
> || build9s: no || build9x: yes ||
> || build10s: no || build10x: no ||
>
> The script that generated this output:
> http://paste.pocoo.org/show/181493/
>
> What do you make of it?  Is it a bug or a feature?  If it's a bug, can
> it be fixed on the OS side?

The problem is the trailing "/" on test argument to "test -e". For the  
test
the syscall "access" is issued which returns just 0 on Solaris 8 and 9  
and
ENOTDIR on Solaris 10 due to massive modifications in the access  
syscall code
due to the CIFS extensions.

Both build8s and build9s run as branded Zones and access() is not  
inerposed
in the branded zone interposing lib. I think it is a bug as the  
branded zone
should behave exactly the same as the native Solaris 8.

I'll see that I open a bug report.

Best regards

   -- Dago



More information about the maintainers mailing list