Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bad configure test for getpwent() ?



>     pw1=getpwnam(buf);
>     sprintf(buf, "%d:%d", rand(), getpid());
>     pw2=getpwnam(buf);
>     exit(pw1!=0 && pw2!=0 && !strcmp(pw1->pw_name, pw2->pw_name));

It's not comparing the pointers; it's comparing the names.

> I don't think getpwent() is required to return a unique pointer each time;
> that is, I think it's allowed to re-use an internal static buffer for each
> entry that it returns.  That would mean that this test always succeeds ...



Messages sorted by: Reverse Date, Date, Thread, Author