www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy Wood" <royw...@unn.unisys.com>
Subject Re: os-unixware/1357: Server incorrectly interprets whether file is a symlink.
Date Thu, 19 Feb 1998 16:24:13 GMT
I am sorry it took so long to get back to you (so much to do, so little
time).

I don't think compiling without _POSIX_SOURCE defined affects anything
else.  We have been running with this change since I submitted it.  We are
running Stronghold 2.1 with all modules compiled without the _POSIX_SOURCE
defined.  We are running Unixware 2.1.2.  I am assuming that this bug
exists in all 2.1 releases.

We tried to report the bug and get it fixed through Unisys/Unixware but we
were told that the stat function wasn't part of the POSIX spec that they
coded to and we were out of luck.  Our argument that it was obviously
broken and existing fuctions shouldn't break fell on deaf ears.

I am enclosing the results of a test program we ran to troubleshoot the
problem.  Compiling with _POSIX_SOURCE defined causes the stat function to
return the time rather than the file type.  Depending on the time the
function was called determines whether the function thinks the file is a
link or not (real fun to figure out).

If you have any other questions, please let me know.

Regards,

Roy Wood



Script started on Thu Feb 19 09:49:06 1998
IH19:/work/acct/roy/src>cat Makefile
PROGRAM =linktest

CFLAGS = -g \
     -DCOMPILED=\"`date  +%D_%T`\"

#CFLAGS = -g \
#    -D_POSIX_SOURCE -DCOMPILED=\"`date  +%D_%T`\"

OBJS = linktest.o

$(PROGRAM): $(OBJS)
     cc $(OBJS) $(CFLAGS) -o $(PROGRAM)

linktest.o: linktest.c

all:
     make $(PROGRAM)

clean:
     rm -f *.o core.*


IH19:/work/acct/roy/src>cat linktest.c
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>

main(argc,argv)
int argc;
char **argv;
{
struct stat x_stat;

if(!lstat(argv[1], &x_stat))
        {
        printf("Good stat of file \"%s\"\n", argv[1]);
        printf("st_atime=%0x\n", x_stat.st_atime);
        printf("st_mode=%0x\n", x_stat.st_mode);
        printf("st_xmode0=%0x\n", *((int *)((char *)(&x_stat) + 0)));
        printf("st_xmode4=%0x\n", *((int *)((char *)(&x_stat) + 4)));
        printf("st_xmode8=%0x\n", *((int *)((char *)(&x_stat) + 8)));
        printf("st_xmode12=%0x\n", *((int *)((char *)(&x_stat) + 12)));
        printf("st_xmode16=%0x\n", *((int *)((char *)(&x_stat) + 16)));
        printf("st_xmode20=%0x\n", *((int *)((char *)(&x_stat) + 20)));
        printf("st_xmode24=%0x\n", *((int *)((char *)(&x_stat) + 24)));
        printf("offset=%d\n", ((int)(&((struct stat *)NULL)->st_mode)));
        }
else
        {
        printf("Bad stat of file \"%s\"\n", argv[1]);
        }
}

IH19:/work/acct/roy/src>make clean
     rm -f *.o core.*

IH19:/work/acct/roy/src>make
     cc -g  -DCOMPILED=\"`date  +%D_%T`\" -c linktest.c
     cc linktest.o -g  -DCOMPILED=\"`date  +%D_%T`\" -o linktest

IH19:/work/acct/roy/src>linktest link
Good stat of file "link"
st_atime=34ec51f6
st_mode=a1ff
st_xmode0=88020c
st_xmode4=0
st_xmode8=0
st_xmode12=0
st_xmode16=24d
st_xmode20=a1ff
st_xmode24=1
offset=20

IH19:/work/acct/roy/src>make clean
     rm -f *.o core.*

IH19:/work/acct/roy/src>make
     cc -g  -D_POSIX_SOURCE -DCOMPILED=\"`date  +%D_%T`\" -c linktest.c
     cc linktest.o -g  -D_POSIX_SOURCE -DCOMPILED=\"`date  +%D_%T`\" -o
linktest

IH19:/work/acct/roy/src>linktest link
Good stat of file "link"
st_atime=7fffffff
st_mode=34ec51f6
st_xmode0=24d3206
st_xmode4=1a1ff
st_xmode8=c9040a
st_xmode12=0
st_xmode16=5
st_xmode20=34ec51f6
st_xmode24=34ec5158
offset=20

IH19:/work/acct/roy/src>exit

script done on Thu Feb 19 09:51:30 1998



                                                                  
 (Embedded                                                        
 image moved   dgaudet@hyperreal.org                              
 to file:      02/07/98 06:21 AM                                  
 PIC30119.PCX)                                                    
                                                                  



To:   apache-bugdb@apache.org, dgaudet@apache.org, Roy Wood/GCS/US/Unisys
cc:
Subject:  Re: os-unixware/1357: Server incorrectly interprets whether file
      is a symlink.




[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]

Synopsis: Server incorrectly interprets whether file is a symlink.
State-Changed-From-To: open-analyzed
State-Changed-By: dgaudet
State-Changed-When: Sat Feb  7 04:21:28 PST 1998
State-Changed-Why:
I'm really confused by this.  We don't have anyone who uses
unixware, so we can't really test out your suggestion.  Are
you sure this doesn't affect anything else?  Have you tried
building all the modules without _POSIX_SOURCE ?  Will it
work on all 2.x versions of unixware?
Thanks
Dean




Mime
View raw message