PSM on FreeBSD builds but fails to work

VERIFIED DUPLICATE of bug 54796

Status

Core Graveyard
Security: UI
--
major
VERIFIED DUPLICATE of bug 54796
17 years ago
a year ago

People

(Reporter: Nick Sayer, Assigned: Wan-Teh Chang)

Tracking

1.0 Branch
Other
FreeBSD

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
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.

Comment 1

17 years ago
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

Comment 3

17 years ago
I think this is a duplicate of 54796 or 58869.
(Reporter)

Comment 4

17 years ago
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)

Comment 5

17 years ago
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.
(Assignee)

Comment 6

17 years ago
I will take this bug.
Assignee: ddrinan → wtc
(Reporter)

Comment 7

17 years ago
Yes, I tried building psm with this last patch and without the #if 0 stuff
and it does work.

Comment 8

17 years ago
I have successfully built psm from source as of 20010115 on FreeBSD-current,
marking FIXED
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Updated

17 years ago
Status: RESOLVED → VERIFIED

Comment 9

17 years ago
Verified per Eric's comments.

Comment 10

17 years ago
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 → ---

Comment 11

17 years ago
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
(Assignee)

Comment 12

17 years ago
Only the person to whom to bug is assigned can
mark the bug fixed.
Status: NEW → ASSIGNED

Comment 13

17 years ago
Created attachment 23167 [details] [diff] [review]
Proposed patch to prnetdb.c

Comment 14

17 years ago
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
(Assignee)

Comment 15

17 years ago
The fix for this bug has been checked in.

*** This bug has been marked as a duplicate of 54796 ***
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → DUPLICATE

Comment 16

17 years ago
Verified dupe.
Status: RESOLVED → VERIFIED

Updated

13 years ago
Component: Security: UI → Security: UI
Product: PSM → Core

Updated

9 years ago
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.