version 1.1, 2012/02/21 16:23:02
|
version 1.1.1.3, 2013/07/22 10:46:13
|
Line 1
|
Line 1
|
/* |
/* |
* Copyright (c) 2011 Todd C. Miller <Todd.Miller@courtesan.com> | * Copyright (c) 2011-2013 Todd C. Miller <Todd.Miller@courtesan.com> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 26
|
Line 26
|
# include <stdlib.h> |
# include <stdlib.h> |
# endif |
# endif |
#endif /* STDC_HEADERS */ |
#endif /* STDC_HEADERS */ |
|
#ifdef HAVE_STDBOOL_H |
|
# include <stdbool.h> |
|
#else |
|
# include "compat/stdbool.h" |
|
#endif /* HAVE_STDBOOL_H */ |
#ifdef HAVE_STRING_H |
#ifdef HAVE_STRING_H |
# include <string.h> |
# include <string.h> |
#endif /* HAVE_STRING_H */ |
#endif /* HAVE_STRING_H */ |
Line 35
|
Line 40
|
#include <grp.h> |
#include <grp.h> |
#include <pwd.h> |
#include <pwd.h> |
|
|
|
#define SUDO_ERROR_WRAP 0 |
|
|
|
#include "missing.h" |
#include "list.h" |
#include "list.h" |
#include "parse.h" |
#include "parse.h" |
#include "toke.h" |
#include "toke.h" |
#include "gram.h" | #include "sudo_plugin.h" |
| #include <gram.h> |
|
|
|
__dso_public int main(int argc, char *argv[]); |
|
|
/* |
/* |
* TODO: test realloc |
* TODO: test realloc |
*/ |
*/ |
|
|
YYSTYPE yylval; | YYSTYPE sudoerslval; |
|
|
struct fill_test { |
struct fill_test { |
const char *input; |
const char *input; |
Line 96 check_fill(const char *input, int len, int addspace, c
|
Line 107 check_fill(const char *input, int len, int addspace, c
|
{ |
{ |
if (!fill(input, len)) |
if (!fill(input, len)) |
return -1; |
return -1; |
*resultp = yylval.string; | *resultp = sudoerslval.string; |
return !strcmp(yylval.string, expect); | return !strcmp(sudoerslval.string, expect); |
} |
} |
|
|
static int |
static int |
Line 105 check_fill_cmnd(const char *input, int len, int addspa
|
Line 116 check_fill_cmnd(const char *input, int len, int addspa
|
{ |
{ |
if (!fill_cmnd(input, len)) |
if (!fill_cmnd(input, len)) |
return -1; |
return -1; |
*resultp = yylval.command.cmnd; | *resultp = sudoerslval.command.cmnd; |
return !strcmp(yylval.command.cmnd, expect); | return !strcmp(sudoerslval.command.cmnd, expect); |
} |
} |
|
|
static int |
static int |
Line 114 check_fill_args(const char *input, int len, int addspa
|
Line 125 check_fill_args(const char *input, int len, int addspa
|
{ |
{ |
if (!fill_args(input, len, addspace)) |
if (!fill_args(input, len, addspace)) |
return -1; |
return -1; |
*resultp = yylval.command.args; | *resultp = sudoerslval.command.args; |
return !strcmp(yylval.command.args, expect); | return !strcmp(sudoerslval.command.args, expect); |
} |
} |
|
|
static int |
static int |
Line 174 main(int argc, char *argv[])
|
Line 185 main(int argc, char *argv[])
|
|
|
/* STUB */ |
/* STUB */ |
void |
void |
cleanup(int gotsig) | sudoerserror(const char *s) |
{ | |
return; | |
} | |
| |
/* STUB */ | |
void | |
yyerror(const char *s) | |
{ |
{ |
return; |
return; |
} |
} |