mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 09:57:41 +00:00
We still want to recognize %{seq} for the SUDOERS_NO_SEQ case but
just leave it as-is.
This commit is contained in:
parent
a2ce6fd296
commit
a17d171155
4
NEWS
4
NEWS
@ -77,6 +77,10 @@ What's new in Sudo 1.8.7?
|
|||||||
* On HP-UX systems, sudo will now use the pstat() function to
|
* On HP-UX systems, sudo will now use the pstat() function to
|
||||||
determine the tty instead of ttyname().
|
determine the tty instead of ttyname().
|
||||||
|
|
||||||
|
* Turkish translation for sudo from translationproject.org.
|
||||||
|
|
||||||
|
* Dutch translation for sudo and sudoers from translationproject.org.
|
||||||
|
|
||||||
What's new in Sudo 1.8.6p7?
|
What's new in Sudo 1.8.6p7?
|
||||||
|
|
||||||
* A time stamp file with the date set to the epoch by "sudo -k"
|
* A time stamp file with the date set to the epoch by "sudo -k"
|
||||||
|
@ -46,13 +46,16 @@ struct path_escape {
|
|||||||
size_t (*copy_fn)(char *, size_t, char *);
|
size_t (*copy_fn)(char *, size_t, char *);
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef SUDOERS_NO_SEQ
|
|
||||||
static size_t
|
static size_t
|
||||||
fill_seq(char *str, size_t strsize, char *logdir)
|
fill_seq(char *str, size_t strsize, char *logdir)
|
||||||
{
|
{
|
||||||
|
#ifdef SUDOERS_NO_SEQ
|
||||||
|
debug_decl(fill_seq, SUDO_DEBUG_UTIL)
|
||||||
|
debug_return_size_t(strlcpy(str, "%{seq}", strsize));
|
||||||
|
#else
|
||||||
static char sessid[7];
|
static char sessid[7];
|
||||||
int len;
|
int len;
|
||||||
debug_decl(sudoers_io_version, SUDO_DEBUG_UTIL)
|
debug_decl(fill_seq, SUDO_DEBUG_UTIL)
|
||||||
|
|
||||||
if (sessid[0] == '\0')
|
if (sessid[0] == '\0')
|
||||||
io_nextid(logdir, def_iolog_dir, sessid);
|
io_nextid(logdir, def_iolog_dir, sessid);
|
||||||
@ -63,8 +66,8 @@ fill_seq(char *str, size_t strsize, char *logdir)
|
|||||||
if (len < 0)
|
if (len < 0)
|
||||||
debug_return_size_t(strsize); /* handle non-standard snprintf() */
|
debug_return_size_t(strsize); /* handle non-standard snprintf() */
|
||||||
debug_return_size_t(len);
|
debug_return_size_t(len);
|
||||||
}
|
|
||||||
#endif /* SUDOERS_NO_SEQ */
|
#endif /* SUDOERS_NO_SEQ */
|
||||||
|
}
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
fill_user(char *str, size_t strsize, char *unused)
|
fill_user(char *str, size_t strsize, char *unused)
|
||||||
@ -136,9 +139,7 @@ fill_command(char *str, size_t strsize, char *unused)
|
|||||||
|
|
||||||
/* Note: "seq" must be first in the list. */
|
/* Note: "seq" must be first in the list. */
|
||||||
static struct path_escape io_path_escapes[] = {
|
static struct path_escape io_path_escapes[] = {
|
||||||
#ifndef SUDOERS_NO_SEQ
|
|
||||||
{ "seq", fill_seq },
|
{ "seq", fill_seq },
|
||||||
#endif
|
|
||||||
{ "user", fill_user },
|
{ "user", fill_user },
|
||||||
{ "group", fill_group },
|
{ "group", fill_group },
|
||||||
{ "runas_user", fill_runas_user },
|
{ "runas_user", fill_runas_user },
|
||||||
@ -161,7 +162,7 @@ expand_iolog_path(const char *prefix, const char *dir, const char *file,
|
|||||||
char *dst, *dst0, *path, *pathend, tmpbuf[PATH_MAX];
|
char *dst, *dst0, *path, *pathend, tmpbuf[PATH_MAX];
|
||||||
char *slash = NULL;
|
char *slash = NULL;
|
||||||
const char *endbrace, *src = dir;
|
const char *endbrace, *src = dir;
|
||||||
static struct path_escape *escapes;
|
struct path_escape *escapes = NULL;
|
||||||
int pass, oldlocale;
|
int pass, oldlocale;
|
||||||
bool strfit;
|
bool strfit;
|
||||||
debug_decl(expand_iolog_path, SUDO_DEBUG_UTIL)
|
debug_decl(expand_iolog_path, SUDO_DEBUG_UTIL)
|
||||||
@ -189,10 +190,7 @@ expand_iolog_path(const char *prefix, const char *dir, const char *file,
|
|||||||
switch (pass) {
|
switch (pass) {
|
||||||
case 0:
|
case 0:
|
||||||
src = dir;
|
src = dir;
|
||||||
escapes = io_path_escapes;
|
escapes = io_path_escapes + 1; /* skip "%{seq}" */
|
||||||
#ifndef SUDOERS_NO_SEQ
|
|
||||||
escapes++; /* skip "${seq}" */
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
/* Trim trailing slashes from dir component. */
|
/* Trim trailing slashes from dir component. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user