Use setprogname() as needed.
This commit is contained in:
@@ -101,10 +101,6 @@
|
|||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
extern int optind;
|
extern int optind;
|
||||||
|
|
||||||
int Argc;
|
|
||||||
char **Argv;
|
|
||||||
const char *session_dir = _PATH_SUDO_TRANSCRIPT;
|
|
||||||
|
|
||||||
union io_fd {
|
union io_fd {
|
||||||
FILE *f;
|
FILE *f;
|
||||||
#ifdef HAVE_ZLIB
|
#ifdef HAVE_ZLIB
|
||||||
@@ -165,6 +161,8 @@ struct search_node {
|
|||||||
static struct search_node *node_stack[32];
|
static struct search_node *node_stack[32];
|
||||||
static int stack_top;
|
static int stack_top;
|
||||||
|
|
||||||
|
static const char *session_dir = _PATH_SUDO_TRANSCRIPT;
|
||||||
|
|
||||||
static union io_fd io_fds[IOFD_MAX];
|
static union io_fd io_fds[IOFD_MAX];
|
||||||
static const char *io_fnames[IOFD_MAX] = {
|
static const char *io_fnames[IOFD_MAX] = {
|
||||||
"/stdin",
|
"/stdin",
|
||||||
@@ -212,8 +210,9 @@ main(int argc, char *argv[])
|
|||||||
size_t len, nread, off;
|
size_t len, nread, off;
|
||||||
ssize_t nwritten;
|
ssize_t nwritten;
|
||||||
|
|
||||||
Argc = argc;
|
#if !defined(HAVE_GETPROGNAME) && !defined(HAVE___PROGNAME)
|
||||||
Argv = argv;
|
setprogname(argc > 0 argv[0] ? "sudoreplay");
|
||||||
|
#endif
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "d:lm:s:V")) != -1) {
|
while ((ch = getopt(argc, argv, "d:lm:s:V")) != -1) {
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
|
@@ -100,8 +100,8 @@ extern struct passwd *getpwuid(uid_t);
|
|||||||
/*
|
/*
|
||||||
* Globals
|
* Globals
|
||||||
*/
|
*/
|
||||||
int Argc, NewArgc;
|
int NewArgc;
|
||||||
char **Argv, **NewArgv;
|
char **NewArgv;
|
||||||
int num_interfaces;
|
int num_interfaces;
|
||||||
struct interface *interfaces;
|
struct interface *interfaces;
|
||||||
struct sudo_user sudo_user;
|
struct sudo_user sudo_user;
|
||||||
@@ -137,8 +137,9 @@ main(int argc, char *argv[])
|
|||||||
yydebug = 1;
|
yydebug = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Argv = argv;
|
#if !defined(HAVE_GETPROGNAME) && !defined(HAVE___PROGNAME)
|
||||||
Argc = argc;
|
setprogname(argc > 0 argv[0] ? "testsudoers");
|
||||||
|
#endif
|
||||||
|
|
||||||
dflag = 0;
|
dflag = 0;
|
||||||
grfile = pwfile = runas_group = runas_user = NULL;
|
grfile = pwfile = runas_group = runas_user = NULL;
|
||||||
|
@@ -131,8 +131,6 @@ extern int optind;
|
|||||||
/*
|
/*
|
||||||
* Globals
|
* Globals
|
||||||
*/
|
*/
|
||||||
int Argc;
|
|
||||||
char **Argv;
|
|
||||||
int num_interfaces;
|
int num_interfaces;
|
||||||
struct interface *interfaces;
|
struct interface *interfaces;
|
||||||
struct sudo_user sudo_user;
|
struct sudo_user sudo_user;
|
||||||
@@ -154,8 +152,10 @@ main(int argc, char *argv[])
|
|||||||
malloc_options = "AFGJPR";
|
malloc_options = "AFGJPR";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Argv = argv;
|
#if !defined(HAVE_GETPROGNAME) && !defined(HAVE___PROGNAME)
|
||||||
if ((Argc = argc) < 1)
|
setprogname(argc > 0 argv[0] ? "visudo");
|
||||||
|
#endif
|
||||||
|
if (argc < 1)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user