Closed Bug 65549 Opened 24 years ago Closed 24 years ago

PSM on FreeBSD builds but fails to work

Categories

(Core Graveyard :: Security: UI, defect)

1.0 Branch
Other
FreeBSD
defect
Not set
major

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 54796

People

(Reporter: nsayer, Assigned: wtc)

References

()

Details

Attachments

(1 file)

From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
BuildID:    0.7

If you attempt to do a psm build of 0.7, it does compile, but this
section of code always fails (from security/psm/server/servutil.c's
SSM_OpenPort()):


    /* Bind to PSM port on loopback address: connections from non-localhosts
     * will be disallowed
     */
    status = PR_InitializeNetAddr(PR_IpAddrLoopback, 0, &servaddr);
    if (status != PR_SUCCESS)
        goto loser;

    status = PR_Bind(datasocket, &servaddr);
    if (status != PR_SUCCESS)
        goto loser;

#if 0 on this section results in a psm that works correctly (albiet
insecurely).


Reproducible: Always
Steps to Reproduce:
1. gmake -f client.mk BUILD_MODULES=psm
2. cd dist/bin && ./mozilla
3. fetch any https:// url

Actual Results:  fails unless that code snippet is chopped out. Then it works.


Expected Results:  Duh.
sending over to PSM. I'm not sure PSM is supposed to even compile on BSD.
Component: Security: General → Client Library
Product: Browser → PSM
Version: other → 1.01
Reassigning.
Assignee: mstoltz → ddrinan
QA Contact: ckritzer → junruh
I think this is a duplicate of 54796 or 58869.
Looking at the other bugs was instructive. This patch fixes the problem(s):

--- prnetdb.c.orig      Tue Jan 16 21:43:04 2001
+++ prnetdb.c   Tue Jan 16 21:40:52 2001
@@ -924,6 +924,7 @@
     PRStatus rv = PR_SUCCESS;
     if (!_pr_initialized) _PR_ImplicitInitialization();

+       bzero(&(addr->inet),sizeof(addr->inet));
        addr->inet.family = AF_INET;
        addr->inet.port = htons(port);
        switch (val)
Does psm worked with this patch?
I tried same patch before, but psm didn't work.
Maybe it is good when called by servutil.c, but break something called by other 
part.
I will take this bug.
Assignee: ddrinan → wtc
Yes, I tried building psm with this last patch and without the #if 0 stuff
and it does work.
I have successfully built psm from source as of 20010115 on FreeBSD-current,
marking FIXED
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Verified per Eric's comments.
Reopening.
Comments emailed to me from nsayer@quack.kfu.com:
I think Eric may be mistaken. 0.7 is able to compile, but the resulting
 executable doesn't work without the patch that is in this bug. In fact,
 Terry Lambert has commented elsewhere that a failure to bzero()
 sockaddr_in structures is something that frequently comes up when
 porting Linux software over to *BSD. From our combined perspective, this
 patch is a very important one for our platform that does no other
 platforms any *harm*. I traded some mail with Eric and think he may have
 been confused about the nature of the problem -- I think he may have
 thought that my patching was addressed at getting psm to build properly
 rather than work properly after it's built. While some of the things I
 posted in the mozilla crypto newsgroup were about building psm on *BSD,
 this patch explicitely is required to get it to work once it does compile.
 
All I am saying is that if the patch in 65549 is not committed, psm 
won't work on *BSD. With that in mind, I think it is important that that 
code gets committed. Until it is, *BSD users will have to add that patch 
by hand in order to have any chance of getting the psm (and God knows 
what other portions of mozilla) to work correctly. Anything that calls 
PR_InitializeNetAddr() on a non-bzero()ed struct is suspect until then.

Status: VERIFIED → UNCONFIRMED
Resolution: FIXED → ---
Sorry for all this spam, I made a mistake when reading the summary and assumed
this was about PSM not compiling on FreeBSD.  One of us should upload the
appropriate patch for this though...

Confirming
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: PSM on FreeBSD compiles, but errors out → PSM on FreeBSD builds but fails to work
Only the person to whom to bug is assigned can
mark the bug fixed.
Status: NEW → ASSIGNED
I have turned the patch from nsayer's comments into an attachment, and building
with this attachment gets PSM to work on FreeBSD-current with a CVS build from
the night of 20010121.

Adding patch keyword
Keywords: patch
The fix for this bug has been checked in.

*** This bug has been marked as a duplicate of 54796 ***
Status: ASSIGNED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → DUPLICATE
Verified dupe.
Status: RESOLVED → VERIFIED
Product: PSM → Core
Version: psm1.01 → 1.0 Branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: