version 1.1.1.3, 2012/10/09 09:29:52
|
version 1.1.1.5, 2014/06/15 16:12:54
|
Line 1
|
Line 1
|
/* |
/* |
* Copyright (c) 2010-2011 Todd C. Miller <Todd.Miller@courtesan.com> | * Copyright (c) 2010-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 17
|
Line 17
|
#include <config.h> |
#include <config.h> |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/param.h> |
|
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/wait.h> |
#include <sys/wait.h> |
|
|
Line 56
|
Line 55
|
|
|
#include <pathnames.h> |
#include <pathnames.h> |
#include "sudo_plugin.h" |
#include "sudo_plugin.h" |
|
#include "sudo_util.h" |
#include "missing.h" |
#include "missing.h" |
|
|
/* |
/* |
Line 139 policy_open(unsigned int version, sudo_conv_t conversa
|
Line 139 policy_open(unsigned int version, sudo_conv_t conversa
|
if (strncmp(*ui, "runas_group=", sizeof("runas_group=") - 1) == 0) { |
if (strncmp(*ui, "runas_group=", sizeof("runas_group=") - 1) == 0) { |
runas_group = *ui + sizeof("runas_group=") - 1; |
runas_group = *ui + sizeof("runas_group=") - 1; |
} |
} |
#if !defined(HAVE_GETPROGNAME) && !defined(HAVE___PROGNAME) |
|
if (strncmp(*ui, "progname=", sizeof("progname=") - 1) == 0) { |
if (strncmp(*ui, "progname=", sizeof("progname=") - 1) == 0) { |
setprogname(*ui + sizeof("progname=") - 1); | initprogname(*ui + sizeof("progname=") - 1); |
} |
} |
#endif |
|
/* Check to see if sudo was called as sudoedit or with -e flag. */ |
/* Check to see if sudo was called as sudoedit or with -e flag. */ |
if (strncmp(*ui, "sudoedit=", sizeof("sudoedit=") - 1) == 0) { |
if (strncmp(*ui, "sudoedit=", sizeof("sudoedit=") - 1) == 0) { |
if (strcasecmp(*ui + sizeof("sudoedit=") - 1, "true") == 0) |
if (strcasecmp(*ui + sizeof("sudoedit=") - 1, "true") == 0) |
Line 306 find_editor(int nfiles, char * const files[], char **a
|
Line 304 find_editor(int nfiles, char * const files[], char **a
|
cp = strtok(editor, " \t"); |
cp = strtok(editor, " \t"); |
if (cp == NULL || |
if (cp == NULL || |
(editor_path = find_in_path(editor, plugin_state.envp)) == NULL) { |
(editor_path = find_in_path(editor, plugin_state.envp)) == NULL) { |
|
free(editor); |
return NULL; |
return NULL; |
} |
} |
if (editor_path != editor) |
if (editor_path != editor) |
Line 503 struct policy_plugin sample_policy = {
|
Line 502 struct policy_plugin sample_policy = {
|
* Note: This plugin does not differentiate between tty and pipe I/O. |
* Note: This plugin does not differentiate between tty and pipe I/O. |
* It all gets logged to the same file. |
* It all gets logged to the same file. |
*/ |
*/ |
struct io_plugin sample_io = { | __dso_public struct io_plugin sample_io = { |
SUDO_IO_PLUGIN, |
SUDO_IO_PLUGIN, |
SUDO_API_VERSION, |
SUDO_API_VERSION, |
io_open, |
io_open, |