diff options
author | Steve Dickson <steved@redhat.com> | 2008-03-18 09:34:58 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2008-03-18 09:34:58 -0400 |
commit | 3899db6d602901523d6db6e2280c3bffd6c9ed63 (patch) | |
tree | 4c5e713f0663688dd20995420a9240956cfdbccc | |
parent | fa29d7a9a3d8a72b79924d28813eef7e55a25bc9 (diff) | |
download | nfs-utils-3899db6d602901523d6db6e2280c3bffd6c9ed63.tar.gz nfs-utils-3899db6d602901523d6db6e2280c3bffd6c9ed63.tar.xz nfs-utils-3899db6d602901523d6db6e2280c3bffd6c9ed63.zip |
Make sure showmount fails when rpc.mountd is not registered
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/showmount/showmount.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/showmount/showmount.c b/utils/showmount/showmount.c index 4e10a29..76bef19 100644 --- a/utils/showmount/showmount.c +++ b/utils/showmount/showmount.c @@ -240,6 +240,8 @@ static unsigned short getport(struct sockaddr_in *addr, rpc_createerr.cf_stat = status; clnt_destroy(client); return 0; + } else if (port == 0) { + rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED; } clnt_destroy(client); @@ -364,7 +366,7 @@ int main(int argc, char **argv) server_addr.sin_port = getport(&server_addr, MOUNTPROG, MOUNTVERS, IPPROTO_UDP); if (!server_addr.sin_port) { - clnt_pcreateerror("portmap getport"); + clnt_pcreateerror("showmount"); exit(1); } msock = RPC_ANYSOCK; |