(saveargv): Lame attempt at protecting users who foolishly specify
passwords on the command line. Antisocially zaps the complete command line, not just the password. Remove, at least for now. (main): Update accordingly.
This commit is contained in:
parent
f757843ca5
commit
b631cf944f
4 changed files with 2 additions and 60 deletions
|
@ -54,7 +54,7 @@ VPATH = @srcdir@
|
|||
|
||||
prog = empire$E
|
||||
obj = expect.$O host.$O ioqueue.$O ipglob.$O login.$O main.$O queue.$O \
|
||||
saveargv.$O servcmd.$O serverio.$O tags.$O termio.$O termlib.$O
|
||||
servcmd.$O serverio.$O tags.$O termio.$O termlib.$O
|
||||
|
||||
all: $(prog)
|
||||
|
||||
|
@ -80,13 +80,11 @@ uninstall:
|
|||
|
||||
# FIXME generate from .d
|
||||
expect.$O: misc.h
|
||||
handle.$O: misc.h
|
||||
host.$O: misc.h
|
||||
ioqueue.$O: misc.h queue.h ioqueue.h
|
||||
login.$O: misc.h proto.h
|
||||
main.$O: misc.h proto.h queue.h ioqueue.h tags.h
|
||||
queue.$O: misc.h queue.h
|
||||
saveargv.$O: misc.h
|
||||
servcmd.$O: misc.h proto.h queue.h ioqueue.h tags.h
|
||||
serverio.$O: misc.h queue.h ioqueue.h
|
||||
tags.$O: misc.h tags.h
|
||||
|
|
|
@ -69,7 +69,7 @@ static void intr(int sig);
|
|||
static int handleintr(int);
|
||||
|
||||
int
|
||||
main(int ac, char **av)
|
||||
main(int ac, char **argv)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
WORD wVersionRequested;
|
||||
|
@ -88,7 +88,6 @@ main(int ac, char **av)
|
|||
int retry = 0;
|
||||
#endif
|
||||
struct ioqueue server;
|
||||
char *argv[128];
|
||||
int i, j;
|
||||
char *ptr;
|
||||
char *auxout_fname;
|
||||
|
@ -122,8 +121,6 @@ main(int ac, char **av)
|
|||
FD_ZERO(&mask);
|
||||
FD_ZERO(&savemask);
|
||||
#endif
|
||||
memset(argv, 0, sizeof(argv));
|
||||
saveargv(ac, av, argv);
|
||||
auxout_fname = NULL;
|
||||
auxout_fp = NULL;
|
||||
for (i = j = 1; i < ac; ++i) {
|
||||
|
|
|
@ -67,7 +67,6 @@ int recvline(int s, char *buf);
|
|||
int expect(int s, int match, char *buf);
|
||||
int tcp_connect(char *, char *);
|
||||
int login(int s, char *uname, char *cname, char *cpass, int kill_proc, int);
|
||||
void saveargv(int ac, char **src, char **dst);
|
||||
void sendcmd(int s, char *cmd, char *arg);
|
||||
void servercmd(struct ioqueue *ioq, FILE *auxfi);
|
||||
int serverio(int s, struct ioqueue *ioq);
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
* Empire - A multi-player, client/server Internet based war game.
|
||||
* Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
|
||||
* Ken Stevens, Steve McClure
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* See files README, COPYING and CREDITS in the root of the source
|
||||
* tree for related information and legal notices. It is expected
|
||||
* that future projects/authors will amend these files as needed.
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* saveargv.c: routine to copy and clear argv
|
||||
*
|
||||
* Known contributors to this file:
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
|
||||
void
|
||||
saveargv(int ac, char **src, char **dst)
|
||||
{
|
||||
char *ptr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ac; i++) {
|
||||
dst[i] = strcpy(malloc(strlen(src[i]) + 1), src[i]);
|
||||
ptr = src[i];
|
||||
while (*ptr)
|
||||
*ptr++ = ' ';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue