++version
This commit is contained in:
46
check.c
46
check.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1 (based on Root Group sudo version 1.1)
|
* CU sudo version 1.5.2 (based on Root Group sudo version 1.1)
|
||||||
*
|
*
|
||||||
* This software comes with no waranty whatsoever, use at your own risk.
|
* This software comes with no waranty whatsoever, use at your own risk.
|
||||||
*
|
*
|
||||||
@@ -235,7 +235,7 @@ static int check_timestamp()
|
|||||||
timedir_is_good = 1; /* now there's an assumption for ya... */
|
timedir_is_good = 1; /* now there's an assumption for ya... */
|
||||||
|
|
||||||
/* become root */
|
/* become root */
|
||||||
set_perms(PERM_ROOT);
|
set_perms(PERM_ROOT, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* walk through the path one directory at a time
|
* walk through the path one directory at a time
|
||||||
@@ -298,7 +298,7 @@ static int check_timestamp()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* relinquish root */
|
/* relinquish root */
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
|
|
||||||
return (timestamp_is_old);
|
return (timestamp_is_old);
|
||||||
}
|
}
|
||||||
@@ -350,7 +350,7 @@ static void update_timestamp()
|
|||||||
{
|
{
|
||||||
if (timedir_is_good) {
|
if (timedir_is_good) {
|
||||||
/* become root */
|
/* become root */
|
||||||
set_perms(PERM_ROOT);
|
set_perms(PERM_ROOT, 0);
|
||||||
|
|
||||||
if (touch(timestampfile) < 0) {
|
if (touch(timestampfile) < 0) {
|
||||||
int fd = open(timestampfile, O_WRONLY | O_CREAT | O_TRUNC, 0600);
|
int fd = open(timestampfile, O_WRONLY | O_CREAT | O_TRUNC, 0600);
|
||||||
@@ -362,7 +362,7 @@ static void update_timestamp()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* relinquish root */
|
/* relinquish root */
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,13 +391,13 @@ void remove_timestamp()
|
|||||||
#endif /* USE_TTY_TICKETS */
|
#endif /* USE_TTY_TICKETS */
|
||||||
|
|
||||||
/* become root */
|
/* become root */
|
||||||
set_perms(PERM_ROOT);
|
set_perms(PERM_ROOT, 0);
|
||||||
|
|
||||||
/* remove the ticket file */
|
/* remove the ticket file */
|
||||||
(void) unlink(timestampfile);
|
(void) unlink(timestampfile);
|
||||||
|
|
||||||
/* relinquish root */
|
/* relinquish root */
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ static void check_passwd()
|
|||||||
sd = &sd_dat;
|
sd = &sd_dat;
|
||||||
|
|
||||||
/* Initialize SecurID. */
|
/* Initialize SecurID. */
|
||||||
set_perms(PERM_ROOT);
|
set_perms(PERM_ROOT, 0);
|
||||||
creadcfg();
|
creadcfg();
|
||||||
if (sd_init(sd) != 0) {
|
if (sd_init(sd) != 0) {
|
||||||
(void) fprintf(stderr, "%s: Cannot contact SecurID server\n", Argv[0]);
|
(void) fprintf(stderr, "%s: Cannot contact SecurID server\n", Argv[0]);
|
||||||
@@ -432,7 +432,7 @@ static void check_passwd()
|
|||||||
*/
|
*/
|
||||||
while (counter > 0) {
|
while (counter > 0) {
|
||||||
if (sd_auth(sd) == ACM_OK) {
|
if (sd_auth(sd) == ACM_OK) {
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,7 +443,7 @@ static void check_passwd()
|
|||||||
(void) fprintf(stderr, "%s\n", INCORRECT_PASSWORD);
|
(void) fprintf(stderr, "%s\n", INCORRECT_PASSWORD);
|
||||||
#endif /* USE_INSULTS */
|
#endif /* USE_INSULTS */
|
||||||
}
|
}
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
|
|
||||||
if (counter > 0) {
|
if (counter > 0) {
|
||||||
log_error(PASSWORD_NOT_CORRECT);
|
log_error(PASSWORD_NOT_CORRECT);
|
||||||
@@ -478,15 +478,15 @@ static void check_passwd()
|
|||||||
|
|
||||||
#ifdef HAVE_SKEY
|
#ifdef HAVE_SKEY
|
||||||
/* rewrite the prompt if using s/key since the challenge can change */
|
/* rewrite the prompt if using s/key since the challenge can change */
|
||||||
set_perms(PERM_ROOT);
|
set_perms(PERM_ROOT, 0);
|
||||||
prompt = sudo_skeyprompt(&skey, prompt);
|
prompt = sudo_skeyprompt(&skey, prompt);
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
#endif /* HAVE_SKEY */
|
#endif /* HAVE_SKEY */
|
||||||
#ifdef HAVE_OPIE
|
#ifdef HAVE_OPIE
|
||||||
/* rewrite the prompt if using OPIE since the challenge can change */
|
/* rewrite the prompt if using OPIE since the challenge can change */
|
||||||
set_perms(PERM_ROOT);
|
set_perms(PERM_ROOT, 0);
|
||||||
prompt = sudo_opieprompt(&opie, prompt);
|
prompt = sudo_opieprompt(&opie, prompt);
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
#endif /* HAVE_OPIE */
|
#endif /* HAVE_OPIE */
|
||||||
|
|
||||||
/* get a password from the user */
|
/* get a password from the user */
|
||||||
@@ -512,23 +512,23 @@ static void check_passwd()
|
|||||||
#ifdef HAVE_SKEY
|
#ifdef HAVE_SKEY
|
||||||
/* Only check s/key db if the user exists there */
|
/* Only check s/key db if the user exists there */
|
||||||
if (skey.keyfile) {
|
if (skey.keyfile) {
|
||||||
set_perms(PERM_ROOT);
|
set_perms(PERM_ROOT, 0);
|
||||||
if (skeyverify(&skey, pass) == 0) {
|
if (skeyverify(&skey, pass) == 0) {
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
return; /* if the key is correct return() */
|
return; /* if the key is correct return() */
|
||||||
}
|
}
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_SKEY */
|
#endif /* HAVE_SKEY */
|
||||||
#ifdef HAVE_OPIE
|
#ifdef HAVE_OPIE
|
||||||
/* Only check OPIE db if the user exists there */
|
/* Only check OPIE db if the user exists there */
|
||||||
if (opie.opie_flags) {
|
if (opie.opie_flags) {
|
||||||
set_perms(PERM_ROOT);
|
set_perms(PERM_ROOT, 0);
|
||||||
if (opieverify(&opie, pass) == 0) {
|
if (opieverify(&opie, pass) == 0) {
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
return; /* if the key is correct return() */
|
return; /* if the key is correct return() */
|
||||||
}
|
}
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_OPIE */
|
#endif /* HAVE_OPIE */
|
||||||
#if !defined(HAVE_SKEY) || !defined(SKEY_ONLY)
|
#if !defined(HAVE_SKEY) || !defined(SKEY_ONLY)
|
||||||
@@ -654,7 +654,7 @@ static int sudo_krb_validate_user(pw_ent, pass)
|
|||||||
* Update the ticket if password is ok. Kerb4 expects
|
* Update the ticket if password is ok. Kerb4 expects
|
||||||
* the ruid and euid to be the same here so we setuid to root.
|
* the ruid and euid to be the same here so we setuid to root.
|
||||||
*/
|
*/
|
||||||
set_perms(PERM_ROOT);
|
set_perms(PERM_ROOT, 0);
|
||||||
k_errno = krb_get_pw_in_tkt(pw_ent->pw_name, "", realm, "krbtgt", realm,
|
k_errno = krb_get_pw_in_tkt(pw_ent->pw_name, "", realm, "krbtgt", realm,
|
||||||
DEFAULT_TKT_LIFE, pass);
|
DEFAULT_TKT_LIFE, pass);
|
||||||
|
|
||||||
@@ -669,7 +669,7 @@ static int sudo_krb_validate_user(pw_ent, pass)
|
|||||||
krb_err_txt[k_errno]);
|
krb_err_txt[k_errno]);
|
||||||
|
|
||||||
/* done with rootly stuff */
|
/* done with rootly stuff */
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
|
|
||||||
return(!(k_errno == INTK_OK));
|
return(!(k_errno == INTK_OK));
|
||||||
}
|
}
|
||||||
@@ -844,7 +844,7 @@ static void reminder()
|
|||||||
(void) fprintf(stderr, "\n%s\n%s\n\n%s\n%s\n\n",
|
(void) fprintf(stderr, "\n%s\n%s\n\n%s\n%s\n\n",
|
||||||
#else
|
#else
|
||||||
(void) fprintf(stderr, "\n%s\n%s\n%s\n%s\n\n%s\n%s\n\n%s\n%s\n\n",
|
(void) fprintf(stderr, "\n%s\n%s\n%s\n%s\n\n%s\n%s\n\n%s\n%s\n\n",
|
||||||
" CU sudo version 1.5.1, based on Root Group sudo version 1.1",
|
" CU sudo version 1.5.2, based on Root Group sudo version 1.1",
|
||||||
" sudo version 1.1, Copyright (C) 1991 The Root Group, Inc.",
|
" sudo version 1.1, Copyright (C) 1991 The Root Group, Inc.",
|
||||||
" sudo comes with ABSOLUTELY NO WARRANTY. This is free software,",
|
" sudo comes with ABSOLUTELY NO WARRANTY. This is free software,",
|
||||||
" and you are welcome to redistribute it under certain conditions.",
|
" and you are welcome to redistribute it under certain conditions.",
|
||||||
|
2
compat.h
2
compat.h
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
2
getwd.c
2
getwd.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -77,12 +77,12 @@ char * sudo_goodpath(path)
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
/* we need to be root for the stat */
|
/* we need to be root for the stat */
|
||||||
set_perms(PERM_ROOT);
|
set_perms(PERM_ROOT, 0);
|
||||||
|
|
||||||
err = stat(path, &statbuf);
|
err = stat(path, &statbuf);
|
||||||
|
|
||||||
/* discard root perms */
|
/* discard root perms */
|
||||||
set_perms(PERM_USER);
|
set_perms(PERM_USER, 0);
|
||||||
|
|
||||||
/* stat(3) failed */
|
/* stat(3) failed */
|
||||||
if (err)
|
if (err)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* CU sudo version 1.5.1
|
* CU sudo version 1.5.2
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,6 +23,6 @@
|
|||||||
#ifndef _SUDO_VERSION_H
|
#ifndef _SUDO_VERSION_H
|
||||||
#define _SUDO_VERSION_H
|
#define _SUDO_VERSION_H
|
||||||
|
|
||||||
static char version[] = "1.5.1";
|
static char version[] = "1.5.2";
|
||||||
|
|
||||||
#endif /* _SUDO_VERSION_H */
|
#endif /* _SUDO_VERSION_H */
|
||||||
|
Reference in New Issue
Block a user