* mountd --no-tcp -p bugs?
@ 2003-02-11 0:28 Ben Leslie
2003-02-14 8:17 ` Ben Leslie
0 siblings, 1 reply; 3+ messages in thread
From: Ben Leslie @ 2003-02-11 0:28 UTC (permalink / raw)
To: nfs
Hi all,
I'm running into a couple of problems with mountd.
I'm using nfs-kernel-server version 1:1.0-2 package
provided in Debian stable. However looking at the source
seems to indicate the same problems would exist in current
cvs version.
Problem 1/
The -n flag (short for --no-tcp) is ignored.
To reproduce: rpc.mountd -n
The problem seems to be in utils/mountd/mountd.c.
while ((c = getopt_long(argc, argv, "o:Fd:f:p:P:hN:V:v", longopts, NULL)) != EOF)
Probably should be:
while ((c = getopt_long(argc, argv, "o:Fd:f:p:P:hN:V:vn", longopts, NULL)) != EOF)
Problem 2/
The --no-tcp and -p <portnum> options don't play well together.
Specifically, if you specify --no-tcp the -p option is ignored. I couldn't
find anything to indicate that this was the desired behaviour.
The problem here seems to be in the rpc_init() function (support/nfs/rpcmisc.c).
Specifically this bit:
if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_DGRAM)) {
static SVCXPRT *last_transp = NULL;
if (_rpcfdtype == 0) {
if (last_transp
&& (!defport || defport == last_transp->xp_port)) {
transp = last_transp;
goto udp_transport;
}
if (defport == 0)
sock = RPC_ANYSOCK;
else if ((sock = makesock(defport, IPPROTO_UDP)) < 0) {
xlog(L_FATAL, "%s: cannot make a UDP socket\n",
name);
}
}
if (sock == RPC_ANYSOCK)
sock = svcudp_socket (prog, 1);
transp = svcudp_create(sock);
defport is only looked at if the _rpcfgtype is set to zero, which
seems to me to be incorrect behaviour. However, since the rpc_init()
function is probably used by things other than mountd, chaning this
behaviour may have other unintended side affects. (Or I could be wrong
and this is indeed the correct behaviour, in which case the docs should
probably explain this.)
Cheers,
Benno
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: mountd --no-tcp -p bugs?
2003-02-11 0:28 mountd --no-tcp -p bugs? Ben Leslie
@ 2003-02-14 8:17 ` Ben Leslie
2003-02-19 4:27 ` Neil Brown
0 siblings, 1 reply; 3+ messages in thread
From: Ben Leslie @ 2003-02-14 8:17 UTC (permalink / raw)
To: nfs
On Tue, 11 Feb 2003, Benno wrote:
> Hi all,
>
> I'm running into a couple of problems with mountd.
Hi again,
I haven't had any feedback on this email from a few days
ago. Is this not a bug and I'm missing something, or just
no one cares about bugs in client programs, or am I just being
impatient?
Thanks again,
Benno
-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: mountd --no-tcp -p bugs?
2003-02-14 8:17 ` Ben Leslie
@ 2003-02-19 4:27 ` Neil Brown
0 siblings, 0 replies; 3+ messages in thread
From: Neil Brown @ 2003-02-19 4:27 UTC (permalink / raw)
To: benno; +Cc: nfs
On Friday February 14, benno@sesgroup.net wrote:
> On Tue, 11 Feb 2003, Benno wrote:
>
> > Hi all,
> >
> > I'm running into a couple of problems with mountd.
>
> Hi again,
>
> I haven't had any feedback on this email from a few days
> ago. Is this not a bug and I'm missing something, or just
> no one cares about bugs in client programs, or am I just being
> impatient?
It is a bug.
You aren't missing much.
People do care, but are also busy.
You were reasonably patient, and it does help to ask again (and
again...) if you don't get a response. It gives an indication of how
important it is, and helps people with short memory and long todo
lists.
I have just committed the following patch to the nfs-utils CVS. It
should address your issues.
NeilBrown
Index: ChangeLog
===================================================================
RCS file: /cvsroot/nfs/nfs-utils/ChangeLog,v
retrieving revision 1.187
diff -u -r1.187 ChangeLog
--- ChangeLog 13 Feb 2003 02:29:42 -0000 1.187
+++ ChangeLog 19 Feb 2003 04:23:27 -0000
@@ -1,3 +1,16 @@
+2003-02-19 NeilBrown <neilb@cse.unsw.edu.au>
+ Ben Leslie <benno@sesgroup.net>
+
+ * support/nfs/rpcmisc.c(rpc_init): change test for ignoring
+ "defport" from (__rpcfdtype == 0) to (__rpcpmstart==0). The
+ former would incorectly ignore defport if the application
+ explicitly set __rpcfdtype. The later is sufficient to avoid the
+ special handling in the case where stdin is an internet socket.
+
+ * utils/mountd/mountd.c(main): Add 'n' to option list in
+ getopt_long as this is a short form of --no-tcp which want being
+ checked.
+
2003-02-12 Chip Salzenberg <chip@pobox.com>
* debian/changelog: Version 1.0.2-2.
Index: support/nfs/rpcmisc.c
===================================================================
RCS file: /cvsroot/nfs/nfs-utils/support/nfs/rpcmisc.c,v
retrieving revision 1.13
diff -u -r1.13 rpcmisc.c
--- support/nfs/rpcmisc.c 16 Sep 2002 02:27:45 -0000 1.13
+++ support/nfs/rpcmisc.c 19 Feb 2003 04:23:28 -0000
@@ -66,7 +66,7 @@
if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_DGRAM)) {
static SVCXPRT *last_transp = NULL;
- if (_rpcfdtype == 0) {
+ if (_rpcpmstart == 0) {
if (last_transp
&& (!defport || defport == last_transp->xp_port)) {
transp = last_transp;
@@ -96,7 +96,7 @@
if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_STREAM)) {
static SVCXPRT *last_transp = NULL;
- if (_rpcfdtype == 0) {
+ if (_rpcpmstart == 0) {
if (last_transp
&& (!defport || defport == last_transp->xp_port)) {
transp = last_transp;
Index: utils/mountd/mountd.c
===================================================================
RCS file: /cvsroot/nfs/nfs-utils/utils/mountd/mountd.c,v
retrieving revision 1.13
diff -u -r1.13 mountd.c
--- utils/mountd/mountd.c 8 Apr 2002 21:43:25 -0000 1.13
+++ utils/mountd/mountd.c 19 Feb 2003 04:23:28 -0000
@@ -399,7 +399,7 @@
/* Parse the command line options and arguments. */
opterr = 0;
- while ((c = getopt_long(argc, argv, "o:Fd:f:p:P:hN:V:v", longopts, NULL)) != EOF)
+ while ((c = getopt_long(argc, argv, "on:Fd:f:p:P:hN:V:v", longopts, NULL)) != EOF)
switch (c) {
case 'o':
descriptors = atoi(optarg);
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-02-19 4:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-11 0:28 mountd --no-tcp -p bugs? Ben Leslie
2003-02-14 8:17 ` Ben Leslie
2003-02-19 4:27 ` Neil Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.