$OpenBSD: patch-nfs_c,v 1.2 2012/03/18 16:50:09 naddy Exp $ --- nfs.c.orig Tue May 19 14:36:10 1998 +++ nfs.c Sun Mar 18 10:49:08 2012 @@ -40,7 +40,6 @@ #include #include #include -#include #include #ifdef SYSV #include @@ -50,7 +49,6 @@ #include #include #include -#include #include "mount.h" #include "nfs_prot.h" #include @@ -58,7 +56,6 @@ #ifdef READLINE #include -#include #endif /* @@ -169,7 +166,6 @@ int interact = 1; /* interactive mode */ int authtype = AUTH_UNIX; /* type of authentication */ int uid = -2; /* remote user id (initialy nobody) */ int gid = -2; /* remote group id (initialy nobody) */ -keybuf secretkey; /* remote user's secret key */ /* server information (also used as state information) */ char *mountpath; /* remote mount path */ @@ -189,7 +185,7 @@ jmp_buf intenv; /* where to go in interrupts */ void interrupt(int); int command(char *); -int getline(char *, int, int *, char **, int); +int get_line(char *, int, int *, char **, int); void do_host(int, char **); void do_setuid(int, char **); void do_setgid(int, char **); @@ -266,7 +262,7 @@ main(int argc, char **argv) /* interpreter's main command loop */ if (setjmp(intenv)) putchar('\n'); - while (getline(buffer, BUFSIZ, &argcount, argvec, NARGVEC)) { + while (get_line(buffer, BUFSIZ, &argcount, argvec, NARGVEC)) { if (argcount == 0) continue; if ((cmd = command(argvec[0])) == CMD_QUIT) break; @@ -377,14 +373,14 @@ interrupt(int signo) * it up into an argument vector. */ int -getline(char *buf, int bufsize, int *argc, char **argv, int argvsize) +get_line(char *buf, int bufsize, int *argc, char **argv, int argvsize) { register char *p; #ifdef READLINE if (interact) { char *line; - if ((line = readline("nfs> ")) == NULL) + if ((line = readline("nfsshell> ")) == NULL) return 0; strncpy(buf, line, bufsize); add_history(line); @@ -394,7 +390,7 @@ getline(char *buf, int bufsize, int *argc, char **argv return 0; } #else - if (interact) printf("nfs> "); + if (interact) printf("nfsshell> "); if (fgets(buf, bufsize, stdin) == NULL) return 0; #endif @@ -447,16 +443,13 @@ void do_setuid(int argc, char **argv) { if (argc > 3) { - fprintf(stderr, "Usage: uid [ []]\n"); + fprintf(stderr, "Usage: uid []\n"); return; } if (argc <= 2) { authtype = AUTH_UNIX; uid = argc == 1 ? -2 : atoi(argv[1]); - } else if (argc == 3) { - authtype = AUTH_DES; - memcpy(secretkey, argv[2], HEXKEYBYTES); } if (nfsclient) {