make fails
jedai47 opened this issue · comments
jedai47 commented
I have the following error:
ake
gcc -g -DREADLINE -I/usr/local/include -c -o nfsshell.o nfsshell.c
nfsshell.c: In function ‘do_setuid’:
nfsshell.c:507:24: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
507 | if (nfsclient->cl_auth)
| ^~~~~~~
| cl_tp
In file included from /usr/include/rpc/rpc.h:50,
from nfsshell.c:62:
nfsshell.c:508:37: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
508 | auth_destroy(nfsclient->cl_auth);
| ^~~~~~~
nfsshell.c:508:37: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
508 | auth_destroy(nfsclient->cl_auth);
| ^~~~~~~
nfsshell.c:508:37: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
508 | auth_destroy(nfsclient->cl_auth);
| ^~~~~~~
nfsshell.c:509:20: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
509 | nfsclient->cl_auth = create_authenticator();
| ^~~~~~~
| cl_tp
nfsshell.c: In function ‘do_setgid’:
nfsshell.c:521:24: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
521 | if (nfsclient->cl_auth)
| ^~~~~~~
| cl_tp
nfsshell.c:522:37: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
522 | auth_destroy(nfsclient->cl_auth);
| ^~~~~~~
nfsshell.c:522:37: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
522 | auth_destroy(nfsclient->cl_auth);
| ^~~~~~~
nfsshell.c:522:37: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
522 | auth_destroy(nfsclient->cl_auth);
| ^~~~~~~
nfsshell.c:523:20: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
523 | nfsclient->cl_auth = create_authenticator();
| ^~~~~~~
| cl_tp
nfsshell.c: In function ‘do_cd’:
nfsshell.c:569:13: warning: implicit declaration of function ‘clnt_perror’; did you mean ‘clnt_perrno’? [-Wimplicit-function-declaration]
569 | clnt_perror(nfsclient, "nfs3_lookup");
| ^~~~~~~~~~~
| clnt_perrno
nfsshell.c: In function ‘open_mount’:
nfsshell.c:1691:22: warning: implicit declaration of function ‘clnttcp_create’; did you mean ‘clnt_tp_ncreate’? [-Wimplicit-function-declaration]
1691 | if ((mntclient = clnttcp_create(&mntserver_addr,
| ^~~~~~~~~~~~~~
| clnt_tp_ncreate
nfsshell.c:1691:20: warning: assignment to ‘CLIENT *’ {aka ‘struct rpc_client *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1691 | if ((mntclient = clnttcp_create(&mntserver_addr,
| ^
nfsshell.c:1693:9: warning: implicit declaration of function ‘clnt_pcreateerror’ [-Wimplicit-function-declaration]
1693 | clnt_pcreateerror("mount/tcp");
| ^~~~~~~~~~~~~~~~~
nfsshell.c:1698:26: warning: implicit declaration of function ‘clntudp_create’; did you mean ‘clnt_dg_ncreate’? [-Wimplicit-function-declaration]
1698 | if ((mntclient = clntudp_create(&mntserver_addr,
| ^~~~~~~~~~~~~~
| clnt_dg_ncreate
nfsshell.c:1698:24: warning: assignment to ‘CLIENT *’ {aka ‘struct rpc_client *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1698 | if ((mntclient = clntudp_create(&mntserver_addr,
| ^
In file included from /usr/include/rpc/rpc.h:53:
nfsshell.c:1706:29: error: ‘CLSET_TIMEOUT’ undeclared (first use in this function); did you mean ‘RL_STATE_TIMEOUT’?
1706 | clnt_control(mntclient, CLSET_TIMEOUT, (char *)&timeout);
| ^~~~~~~~~~~~~
nfsshell.c:1706:29: note: each undeclared identifier is reported only once for each function it appears in
nfsshell.c:1708:16: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
1708 | mntclient->cl_auth = create_authenticator();
| ^~~~~~~
| cl_tp
nfsshell.c: In function ‘close_mount’:
nfsshell.c:1729:33: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
1729 | auth_destroy(mntclient->cl_auth);
| ^~~~~~~
nfsshell.c:1729:33: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
1729 | auth_destroy(mntclient->cl_auth);
| ^~~~~~~
nfsshell.c:1729:33: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
1729 | auth_destroy(mntclient->cl_auth);
| ^~~~~~~
nfsshell.c:1730:9: warning: implicit declaration of function ‘clnt_destroy’; did you mean ‘cond_destroy’? [-Wimplicit-function-declaration]
1730 | clnt_destroy(mntclient);
| ^~~~~~~~~~~~
| cond_destroy
nfsshell.c: In function ‘open_nfs’:
nfsshell.c:1850:24: warning: assignment to ‘CLIENT *’ {aka ‘struct rpc_client *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1850 | if ((nfsclient = clntudp_create(&nfsserver_addr,
| ^
nfsshell.c:1864:24: warning: assignment to ‘CLIENT *’ {aka ‘struct rpc_client *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1864 | if ((nfsclient = clnttcp_create(&nfsserver_addr,
| ^
nfsshell.c:1878:24: warning: assignment to ‘CLIENT *’ {aka ‘struct rpc_client *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1878 | if ((nfsclient = clnttcp_create(&nfsserver_addr,
| ^
nfsshell.c:1886:28: warning: assignment to ‘CLIENT *’ {aka ‘struct rpc_client *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1886 | if ((nfsclient = clntudp_create(&nfsserver_addr,
| ^
nfsshell.c:1895:29: error: ‘CLSET_TIMEOUT’ undeclared (first use in this function); did you mean ‘RL_STATE_TIMEOUT’?
1895 | clnt_control(nfsclient, CLSET_TIMEOUT, (char *)&timeout);
| ^~~~~~~~~~~~~
nfsshell.c:1897:16: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
1897 | nfsclient->cl_auth = create_authenticator();
| ^~~~~~~
| cl_tp
nfsshell.c: In function ‘close_nfs’:
nfsshell.c:2082:33: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
2082 | auth_destroy(nfsclient->cl_auth);
| ^~~~~~~
nfsshell.c:2082:33: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
2082 | auth_destroy(nfsclient->cl_auth);
| ^~~~~~~
nfsshell.c:2082:33: error: ‘CLIENT’ {aka ‘struct rpc_client’} has no member named ‘cl_auth’; did you mean ‘cl_tp’?
2082 | auth_destroy(nfsclient->cl_auth);
| ^~~~~~~
nfsshell.c: In function ‘create_authenticator’:
nfsshell.c:2104:16: warning: implicit declaration of function ‘authunix_create’; did you mean ‘authunix_ncreate’? [-Wimplicit-function-declaration]
2104 | return authunix_create(machname, uid, gid, 1, gids);
| ^~~~~~~~~~~~~~~
| authunix_ncreate
nfsshell.c:2104:16: warning: returning ‘int’ from a function with return type ‘AUTH *’ makes pointer from integer without a cast [-Wint-conversion]
2104 | return authunix_create(machname, uid, gid, 1, gids);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [<builtin>: nfsshell.o] Error 1
Ben Lincoln commented
You need to use the legacy libtirpc
library. It is not compatible with libntirpc
, which is what you get by default on modern Linux.
These are the steps I used to get it to build:
Begin by installing the development package for the library, as well as libreadline
, e.g. on Debian and derivatives (Kali, Ubuntu, etc.):
$ sudo apt install libtirpc-dev libreadline-dev
After installing the library and headers, you will likely need to create links between the old/traditional location of the headers and where modern versions of Linux install them. e.g. on a Kali VM:
sudo ln -s /usr/include/tirpc/netconfig.h /usr/include/netconfig.h
sudo ln -s /usr/include/tirpc/rpc/auth.h /usr/include/rpc/auth.h
sudo ln -s /usr/include/tirpc/rpc/auth_des.h /usr/include/rpc/auth_des.h
sudo ln -s /usr/include/tirpc/rpc/auth_stat.h /usr/include/rpc/auth_stat.h
sudo ln -s /usr/include/tirpc/rpc/auth_unix.h /usr/include/rpc/auth_unix.h
sudo ln -s /usr/include/tirpc/rpc/clnt.h /usr/include/rpc/clnt.h
sudo ln -s /usr/include/tirpc/rpc/clnt_soc.h /usr/include/rpc/clnt_soc.h
sudo ln -s /usr/include/tirpc/rpc/clnt_stat.h /usr/include/rpc/clnt_stat.h
sudo ln -s /usr/include/tirpc/rpc/key_prot.h /usr/include/rpc/key_prot.h
sudo ln -s /usr/include/tirpc/rpc/pmap_clnt.h /usr/include/rpc/pmap_clnt.h
sudo ln -s /usr/include/tirpc/rpc/pmap_prot.h /usr/include/rpc/pmap_prot.h
sudo ln -s /usr/include/tirpc/rpc/rpc.h /usr/include/rpc/rpc.h
sudo ln -s /usr/include/tirpc/rpc/rpc_msg.h /usr/include/rpc/rpc_msg.h
sudo ln -s /usr/include/tirpc/rpc/rpcb_clnt.h /usr/include/rpc/rpcb_clnt.h
sudo ln -s /usr/include/tirpc/rpc/rpcb_prot.h /usr/include/rpc/rpcb_prot.h
sudo ln -s /usr/include/tirpc/rpc/rpcent.h /usr/include/rpc/rpcent.h
sudo ln -s /usr/include/tirpc/rpc/svc.h /usr/include/rpc/svc.h
sudo ln -s /usr/include/tirpc/rpc/svc_auth.h /usr/include/rpc/svc_auth.h
sudo ln -s /usr/include/tirpc/rpc/svc_mt.h /usr/include/rpc/svc_mt.h
sudo ln -s /usr/include/tirpc/rpc/svc_soc.h /usr/include/rpc/svc_soc.h
sudo ln -s /usr/include/tirpc/rpc/types.h /usr/include/rpc/types.h
sudo ln -s /usr/include/tirpc/rpc/xdr.h /usr/include/rpc/xdr.h