implement a usage function
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1694 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -242,6 +242,7 @@ static RETSIGTYPE lostconn (int);
|
|||||||
static int receive_data (FILE *, FILE *);
|
static int receive_data (FILE *, FILE *);
|
||||||
static void send_data (FILE *, FILE *, off_t);
|
static void send_data (FILE *, FILE *, off_t);
|
||||||
static struct passwd * sgetpwnam (char *);
|
static struct passwd * sgetpwnam (char *);
|
||||||
|
static void usage(void);
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
curdir(void)
|
curdir(void)
|
||||||
@@ -287,19 +288,34 @@ parse_auth_level(char *str)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print usage and die.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
usage (void)
|
||||||
|
{
|
||||||
|
fprintf (stderr,
|
||||||
|
"Usage: %s [-d] [-i] [-g guest_umask] [-l] [-p port]"
|
||||||
|
" [-t timeout] [-T max_timeout] [-u umask] [-v]"
|
||||||
|
" [-a auth_level] \n",
|
||||||
|
__progname);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int addrlen, ch, on = 1, tos;
|
int addrlen, ch, on = 1, tos;
|
||||||
char *cp, line[LINE_MAX];
|
char *cp, line[LINE_MAX];
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
|
|
||||||
int not_inetd = 0;
|
int not_inetd = 0;
|
||||||
int port;
|
int port;
|
||||||
struct servent *sp;
|
struct servent *sp;
|
||||||
|
|
||||||
char tkfile[1024];
|
char tkfile[1024];
|
||||||
|
|
||||||
|
set_progname (argv[0]);
|
||||||
|
|
||||||
/* detach from any tickets and tokens */
|
/* detach from any tickets and tokens */
|
||||||
|
|
||||||
snprintf(tkfile, sizeof(tkfile),
|
snprintf(tkfile, sizeof(tkfile),
|
||||||
@@ -381,15 +397,13 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
warnx("unknown flag -%c ignored", argv[optind-1][0]);
|
usage ();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(not_inetd)
|
if(not_inetd)
|
||||||
mini_inetd (port);
|
mini_inetd (port);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LOG_NDELAY sets up the logging connection immediately,
|
* LOG_NDELAY sets up the logging connection immediately,
|
||||||
* necessary for anonymous ftp's that chroot and can't do it later.
|
* necessary for anonymous ftp's that chroot and can't do it later.
|
||||||
|
Reference in New Issue
Block a user