/* Define to 1 if you have the `random' function. */
#undef HAVE_RANDOM
-/* Define to 1 if you have the `regcomp' function. */
-#undef HAVE_REGCOMP
-
/* Define to 1 if you have the `revoke' function. */
#undef HAVE_REVOKE
as_fn_append ac_header_list " sys/sysmacros.h"
as_fn_append ac_func_list " killpg"
as_fn_append ac_func_list " nl_langinfo"
-as_fn_append ac_func_list " regcomp"
as_fn_append ac_func_list " strftime"
as_fn_append ac_func_list " strrchr"
as_fn_append ac_func_list " strtoll"
-
-
for ac_func in getgrouplist
do :
ac_fn_c_check_func "$LINENO" "getgrouplist" "ac_cv_func_getgrouplist"
dnl Function checks
dnl
AC_FUNC_GETGROUPS
-AC_CHECK_FUNCS_ONCE([killpg nl_langinfo regcomp strftime strrchr strtoll sysconf tzset])
+AC_CHECK_FUNCS_ONCE([killpg nl_langinfo strftime strrchr strtoll sysconf tzset])
AC_CHECK_FUNCS([getgrouplist], [], [
case "$host_os" in
aix*)
following predicates:
command _\bp_\ba_\bt_\bt_\be_\br_\bn
- Evaluates to true if the command run matches _\bp_\ba_\bt_\bt_\be_\br_\bn.
- On systems with POSIX regular expression support, the
- pattern may be an extended regular expression. On
- systems without POSIX regular expression support, a
- simple sub-string match is performed instead.
+ Evaluates to true if the command run matches the
+ POSIX extended regular expression _\bp_\ba_\bt_\bt_\be_\br_\bn.
cwd _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
Evaluates to true if the command was run with the
file distributed with s\bsu\bud\bdo\bo or http://www.sudo.ws/license.html for
complete details.
-Sudo 1.8.12 December 4, 2014 Sudo 1.8.12
+Sudo 1.8.12 February 5, 2015 Sudo 1.8.12
.\" DO NOT EDIT THIS FILE, IT IS NOT THE MASTER!
.\" IT IS GENERATED AUTOMATICALLY FROM sudoreplay.mdoc.in
.\"
-.\" Copyright (c) 2009-2014 Todd C. Miller <Todd.Miller@courtesan.com>
+.\" Copyright (c) 2009-2015 Todd C. Miller <Todd.Miller@courtesan.com>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "SUDOREPLAY" "8" "December 4, 2014" "Sudo @PACKAGE_VERSION@" "System Manager's Manual"
+.TH "SUDOREPLAY" "8" "February 5, 2015" "Sudo @PACKAGE_VERSION@" "System Manager's Manual"
.nh
.if n .ad l
.SH "NAME"
.PD 0
.TP 8n
command \fIpattern\fR
-Evaluates to true if the command run matches
+Evaluates to true if the command run matches the POSIX extended
+regular expression
\fIpattern\fR.
-On systems with POSIX regular expression support, the pattern may
-be an extended regular expression.
-On systems without POSIX regular expression support, a simple sub-string
-match is performed instead.
.PD
.TP 8n
cwd \fIdirectory\fR
.\"
-.\" Copyright (c) 2009-2014 Todd C. Miller <Todd.Miller@courtesan.com>
+.\" Copyright (c) 2009-2015 Todd C. Miller <Todd.Miller@courtesan.com>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd December 4, 2014
+.Dd February 5, 2015
.Dt SUDOREPLAY @mansectsu@
.Os Sudo @PACKAGE_VERSION@
.Sh NAME
An expression is composed of the following predicates:
.Bl -tag -width 6n
.It command Ar pattern
-Evaluates to true if the command run matches
+Evaluates to true if the command run matches the POSIX extended
+regular expression
.Ar pattern .
-On systems with POSIX regular expression support, the pattern may
-be an extended regular expression.
-On systems without POSIX regular expression support, a simple sub-string
-match is performed instead.
.It cwd Ar directory
Evaluates to true if the command was run with the specified current
working directory.
# include <ndir.h>
# endif
#endif
-#ifdef HAVE_REGCOMP
-# include <regex.h>
-#endif
-#ifdef HAVE_ZLIB_H
-# include <zlib.h>
-#endif
-#include <signal.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif /* HAVE_STDBOOL_H */
+#include <regex.h>
+#include <signal.h>
+#ifdef HAVE_ZLIB_H
+# include <zlib.h>
+#endif
#include <pathnames.h>
bool negated;
bool or;
union {
-#ifdef HAVE_REGCOMP
regex_t cmdre;
-#else
- char *pattern;
-#endif
time_t tstamp;
char *cwd;
char *tty;
static void usage(int);
static void write_output(int fd, int what, void *v);
-#ifdef HAVE_REGCOMP
-# define REGEX_T regex_t
-#else
-# define REGEX_T char
-#endif
-
#define VALID_ID(s) (isalnum((unsigned char)(s)[0]) && \
isalnum((unsigned char)(s)[1]) && isalnum((unsigned char)(s)[2]) && \
isalnum((unsigned char)(s)[3]) && isalnum((unsigned char)(s)[4]) && \
} else {
if (*(++av) == NULL)
sudo_fatalx(U_("%s requires an argument"), av[-1]);
-#ifdef HAVE_REGCOMP
if (type == ST_PATTERN) {
if (regcomp(&sn->u.cmdre, *av, REG_EXTENDED|REG_NOSUB) != 0)
sudo_fatalx(U_("invalid regular expression: %s"), *av);
- } else
-#endif
- if (type == ST_TODATE || type == ST_FROMDATE) {
+ } else if (type == ST_TODATE || type == ST_FROMDATE) {
sn->u.tstamp = get_date(*av);
if (sn->u.tstamp == -1)
sudo_fatalx(U_("could not parse date \"%s\""), *av);
res = strcmp(sn->u.user, log->user) == 0;
break;
case ST_PATTERN:
-#ifdef HAVE_REGCOMP
rc = regexec(&sn->u.cmdre, log->cmd, 0, NULL, 0);
if (rc && rc != REG_NOMATCH) {
char buf[BUFSIZ];
sudo_fatalx("%s", buf);
}
res = rc == REG_NOMATCH ? 0 : 1;
-#else
- res = strstr(log.cmd, sn->u.pattern) != NULL;
-#endif
break;
case ST_FROMDATE:
res = log->tstamp >= sn->u.tstamp;
}
static int
-list_session(char *logfile, REGEX_T *re, const char *user, const char *tty)
+list_session(char *logfile, regex_t *re, const char *user, const char *tty)
{
char idbuf[7], *idstr, *cp;
const char *timestr;
/* XXX - always returns 0, calls sudo_fatal() on failure */
static int
-find_sessions(const char *dir, REGEX_T *re, const char *user, const char *tty)
+find_sessions(const char *dir, regex_t *re, const char *user, const char *tty)
{
DIR *d;
struct dirent *dp;
list_sessions(int argc, char **argv, const char *pattern, const char *user,
const char *tty)
{
- REGEX_T rebuf, *re = NULL;
+ regex_t rebuf, *re = NULL;
debug_decl(list_sessions, SUDO_DEBUG_UTIL)
/* Parse search expression if present */
parse_expr(&search_expr, argv, false);
-#ifdef HAVE_REGCOMP
/* optional regex */
if (pattern) {
re = &rebuf;
if (regcomp(re, pattern, REG_EXTENDED|REG_NOSUB) != 0)
sudo_fatalx(U_("invalid regular expression: %s"), pattern);
}
-#else
- re = (char *) pattern;
-#endif /* HAVE_REGCOMP */
debug_return_int(find_sessions(session_dir, re, user, tty));
}