#include <sys/file.h>
#include "sudo.h"
+#include "version.h"
#ifndef STDC_HEADERS
extern char *getenv();
/*
* Globals
*/
+char **Argv;
char buffer[BUFSIZ];
char *sudoers = _PATH_SUDO_SUDOERS;
char *sudoers_tmp_file = _PATH_SUDO_STMP;
FILE *sudoers_tmp_fp=NULL,
*sudoers_fp=NULL;
+/*
+ * local functions not visible outside visudo.c
+ */
+static void usage();
+
+
static RETSIGTYPE Exit(sig)
int sig;
{
char * Editor;
#endif /* ENV_EDITOR */
+ Argv = argv;
+
+ if (argc > 1) {
+ /*
+ * print version string and exit if we got -v
+ */
+ if (!strcmp(argv[1], "-v")) {
+ (void) printf("visudo version %s\n", version);
+ exit(0);
+ } else {
+ usage();
+ }
+
+ }
+
/*
* handle the signals
*/
exit(0);
}
}
+
+
+/**********************************************************************
+ *
+ * usage()
+ *
+ * this function just gives you instructions and exits
+ */
+
+static void usage()
+{
+ (void) fprintf(stderr, "usage: %s [-v]\n", *Argv);
+ exit(1);
+}