Fix complilation on systems with set_auth_parameters()
Sprinkle volatile to quiet warnings from gcc 2.8.0
This commit is contained in:
@@ -65,15 +65,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#if defined(HAVE_GETPRPWNAM) && defined(HAVE_SET_AUTH_PARAMETERS)
|
|
||||||
# ifdef __hpux
|
|
||||||
# undef MAXINT
|
|
||||||
# include <hpsecurity.h>
|
|
||||||
# else
|
|
||||||
# include <sys/security.h>
|
|
||||||
# endif /* __hpux */
|
|
||||||
# include <prot.h>
|
|
||||||
#endif /* HAVE_GETPRPWNAM && HAVE_SET_AUTH_PARAMETERS */
|
|
||||||
#ifdef HAVE_LOGIN_CAP_H
|
#ifdef HAVE_LOGIN_CAP_H
|
||||||
# include <login_cap.h>
|
# include <login_cap.h>
|
||||||
# ifndef LOGIN_DEFROOTCLASS
|
# ifndef LOGIN_DEFROOTCLASS
|
||||||
@@ -152,18 +143,10 @@ sudoers_policy_open(unsigned int version, sudo_conv_t conversation,
|
|||||||
sudo_printf_t plugin_printf, char * const settings[],
|
sudo_printf_t plugin_printf, char * const settings[],
|
||||||
char * const user_info[], char * const envp[])
|
char * const user_info[], char * const envp[])
|
||||||
{
|
{
|
||||||
int sources = 0;
|
volatile int sources = 0;
|
||||||
sigaction_t sa;
|
sigaction_t sa;
|
||||||
struct sudo_nss *nss;
|
struct sudo_nss *nss;
|
||||||
|
|
||||||
/* Must be done before we do any password lookups */
|
|
||||||
#if defined(HAVE_GETPRPWNAM) && defined(HAVE_SET_AUTH_PARAMETERS)
|
|
||||||
(void) set_auth_parameters(Argc, Argv);
|
|
||||||
# ifdef HAVE_INITPRIVS
|
|
||||||
initprivs();
|
|
||||||
# endif
|
|
||||||
#endif /* HAVE_GETPRPWNAM && HAVE_SET_AUTH_PARAMETERS */
|
|
||||||
|
|
||||||
if (!sudo_conv)
|
if (!sudo_conv)
|
||||||
sudo_conv = conversation;
|
sudo_conv = conversation;
|
||||||
if (!sudo_printf)
|
if (!sudo_printf)
|
||||||
@@ -297,8 +280,8 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
|
|||||||
char **edit_argv = NULL;
|
char **edit_argv = NULL;
|
||||||
struct sudo_nss *nss;
|
struct sudo_nss *nss;
|
||||||
int cmnd_status = -1, validated;
|
int cmnd_status = -1, validated;
|
||||||
int info_len = 0;
|
volatile int info_len = 0;
|
||||||
int rval = FALSE;
|
volatile int rval = FALSE;
|
||||||
|
|
||||||
/* Is root even allowed to run sudo? */
|
/* Is root even allowed to run sudo? */
|
||||||
if (user_uid == 0 && !def_root_sudo) {
|
if (user_uid == 0 && !def_root_sudo) {
|
||||||
|
17
src/sudo.c
17
src/sudo.c
@@ -76,6 +76,15 @@
|
|||||||
#ifdef HAVE_SETAUTHDB
|
#ifdef HAVE_SETAUTHDB
|
||||||
# include <usersec.h>
|
# include <usersec.h>
|
||||||
#endif /* HAVE_SETAUTHDB */
|
#endif /* HAVE_SETAUTHDB */
|
||||||
|
#if defined(HAVE_GETPRPWNAM) && defined(HAVE_SET_AUTH_PARAMETERS)
|
||||||
|
# ifdef __hpux
|
||||||
|
# undef MAXINT
|
||||||
|
# include <hpsecurity.h>
|
||||||
|
# else
|
||||||
|
# include <sys/security.h>
|
||||||
|
# endif /* __hpux */
|
||||||
|
# include <prot.h>
|
||||||
|
#endif /* HAVE_GETPRPWNAM && HAVE_SET_AUTH_PARAMETERS */
|
||||||
|
|
||||||
#include "sudo.h"
|
#include "sudo.h"
|
||||||
#include "sudo_plugin.h"
|
#include "sudo_plugin.h"
|
||||||
@@ -131,6 +140,14 @@ main(int argc, char *argv[], char *envp[])
|
|||||||
setprogname(argv[0]);
|
setprogname(argv[0]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Must be done before we do any password lookups */
|
||||||
|
#if defined(HAVE_GETPRPWNAM) && defined(HAVE_SET_AUTH_PARAMETERS)
|
||||||
|
(void) set_auth_parameters(argc, argv);
|
||||||
|
# ifdef HAVE_INITPRIVS
|
||||||
|
initprivs();
|
||||||
|
# endif
|
||||||
|
#endif /* HAVE_GETPRPWNAM && HAVE_SET_AUTH_PARAMETERS */
|
||||||
|
|
||||||
if (geteuid() != 0)
|
if (geteuid() != 0)
|
||||||
errorx(1, "must be setuid root");
|
errorx(1, "must be setuid root");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user