Bug 57681 - portrange should only apply to server sockets
Summary: portrange should only apply to server sockets
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: amanda   
(Show other bugs)
Version: 7.2
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Jay Fenlason
QA Contact: Aaron Brown
Depends On:
TreeView+ depends on / blocked
Reported: 2001-12-18 20:55 UTC by John Dalbec
Modified: 2014-08-31 23:24 UTC (History)
1 user (show)

Fixed In Version: 2.4.4p1-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-12-04 20:15:50 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description John Dalbec 2001-12-18 20:55:32 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.9-12 i686)

Description of problem:
configure.in says:
    [  --with-portrange=low,high  bind unreserved TCP server sockets to
ports within this range [unlimited]],

but common-src/stream.c stream_client() says
    if (bind_portrange(client_socket, &claddr, PORTRANGE) == 0)
        goto out;

so that --with-portrange applies to client sockets too.  This means that
amrecover doesn't work if the portrange is >1023.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Rebuild amanda with --with-portrange=<unreserved portrange>
2.  amrecover

Actual Results:  amrecover: did not get a reserved port: <port #>

Expected Results:  amrecover should work

Additional info:

--with-portrange is needed to do amanda backups with strong firewalls in

Comment 1 Trond Eivind Glomsrxd 2002-01-08 23:57:54 UTC
We don't build it that way, sounds like a local configuration issue. If you want
to change the ports the server is listening to, you can just change the ports in
the files in /etc/xinetd.d?

Comment 2 John Dalbec 2002-01-09 13:28:24 UTC
No, these are (usually high) ports that are used for streaming backup data.  In your configuration amanda chooses any available port regardless of 
the contents of /etc.  But I'm not comfortable opening all ports between these machines, so I rebuilt amanda with the --with-portrange option.  The 
remarks in the configure script indicate that the --portrange option applies to servers only, but as delivered in your SRPM it applies to clients also.  If 
you feel this is not your problem, I can just upstream it.

Comment 3 John Dalbec 2002-01-09 14:05:56 UTC
Current amanda CVS takes a different (also effective) approach to my complaint.  From the comments on the last revision:

 Add stream_client_privileged() function to get a
 privileged port and fail if one is not available.
 The older stream_client() function gets a (non-privileged)
 port in the configured portrange, if set and possible,
 else anything available.

 Use stream_client_privileged() in amrecover instead of

Comment 4 Trond Eivind Glomsrxd 2002-01-17 20:08:38 UTC
OK, we'll get that when amanda is updated next.

Comment 5 John Dalbec 2002-04-03 15:21:31 UTC
FWIW, the stream_client patch (from CVS) was recently posted to http://www.amanda.org/patches.html.

Comment 6 Jay Fenlason 2003-12-04 20:15:50 UTC
Today's the day for cleaning up old bugs.  It looks like this has been 
fixed for a long time now. 

Note You need to log in before you can comment on or make changes to this bug.