File: conquestsh.c

package info (click to toggle)
conquest 8.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,984 kB
  • ctags: 3,086
  • sloc: ansic: 39,393; sh: 8,540; yacc: 446; makefile: 296; lex: 146
file content (44 lines) | stat: -rw-r--r-- 1,381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "c_defs.h"

/************************************************************************
 *
 * $Id: conquestsh.c,v 1.2 2003/11/02 20:53:00 jon Exp $
 *
 * Copyright 2003 Jon Trulson under the ARTISTIC LICENSE. (See LICENSE).
 ***********************************************************************/

/* This is a very short program that should be used as the
   'shell' of a telnet conquest server.  Assuming you have setup a
   conquest user (suitable for telneting into), simply define
   this program as the shell.  When a user telnets in to the conquest account
   this program will run.

   It's sole purpose is to execute the conquest client binary with appropriate
   options (like -t).  It can be easily modified by a server operator
   to pass other options as well, if need be.  */

#include "conqdef.h"

#ifndef CONQUESTSH_EXEC            /* this is determined during configure */
#error "CONQUESTSH_EXEC was not defined on the compile line"
#endif

#define TELNET_OPT "-t"
#define SERVER_OPT1 "-s"
#define SERVER_OPT2 "localhost" /* change this if you'd like */

int main(int argc, char *argv[])
{
  execlp(CONQUESTSH_EXEC, 
        CONQUESTSH_EXEC, 
        TELNET_OPT,
        SERVER_OPT1,
        SERVER_OPT2,
        NULL);

  /* should never get here */
  fprintf(stderr, "exec %s failed: %s\n", CONQUESTSH_EXEC, strerror(errno));
          
  exit(0);
  
}