Rename PERM_RUNAS -> PERM_FULL_RUNAS and add a PERM_RUNAS that just
changes the euid.
This commit is contained in:
20
set_perms.c
20
set_perms.c
@@ -119,6 +119,11 @@ set_perms_posix(perm)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PERM_RUNAS:
|
case PERM_RUNAS:
|
||||||
|
if (seteuid(runas_pw->pw_uid))
|
||||||
|
fatal("unable to change to runas uid", 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PERM_FULL_RUNAS:
|
||||||
/* headed for exec(), assume euid == 0 */
|
/* headed for exec(), assume euid == 0 */
|
||||||
runas_setup();
|
runas_setup();
|
||||||
if (def_stay_setuid)
|
if (def_stay_setuid)
|
||||||
@@ -192,6 +197,11 @@ set_perms_suid(perm)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PERM_RUNAS:
|
case PERM_RUNAS:
|
||||||
|
if (seteuid(runas_pw->pw_uid))
|
||||||
|
fatal("unable to change to runas uid", 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PERM_FULL_RUNAS:
|
||||||
/* headed for exec(), assume euid == 0 */
|
/* headed for exec(), assume euid == 0 */
|
||||||
runas_setup();
|
runas_setup();
|
||||||
error = setresuid(def_stay_setuid ?
|
error = setresuid(def_stay_setuid ?
|
||||||
@@ -264,6 +274,11 @@ set_perms_suid(perm)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PERM_RUNAS:
|
case PERM_RUNAS:
|
||||||
|
if (seteuid(runas_pw->pw_uid))
|
||||||
|
fatal("unable to change to runas uid", 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PERM_FULL_RUNAS:
|
||||||
/* headed for exec(), assume euid == 0 */
|
/* headed for exec(), assume euid == 0 */
|
||||||
runas_setup();
|
runas_setup();
|
||||||
error = setreuid(def_stay_setuid ?
|
error = setreuid(def_stay_setuid ?
|
||||||
@@ -333,6 +348,11 @@ set_perms_nosuid(perm)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PERM_RUNAS:
|
case PERM_RUNAS:
|
||||||
|
if (seteuid(runas_pw->pw_uid))
|
||||||
|
fatal("unable to change to runas uid", 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PERM_FULL_RUNAS:
|
||||||
/* headed for exec(), assume euid == 0 */
|
/* headed for exec(), assume euid == 0 */
|
||||||
runas_setup();
|
runas_setup();
|
||||||
if (setuid(runas_pw->pw_uid))
|
if (setuid(runas_pw->pw_uid))
|
||||||
|
3
sudo.h
3
sudo.h
@@ -122,7 +122,8 @@ struct sudo_user {
|
|||||||
#define PERM_FULL_USER 0x03
|
#define PERM_FULL_USER 0x03
|
||||||
#define PERM_SUDOERS 0x04
|
#define PERM_SUDOERS 0x04
|
||||||
#define PERM_RUNAS 0x05
|
#define PERM_RUNAS 0x05
|
||||||
#define PERM_TIMESTAMP 0x06
|
#define PERM_FULL_RUNAS 0x06
|
||||||
|
#define PERM_TIMESTAMP 0x07
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shortcuts for sudo_user contents.
|
* Shortcuts for sudo_user contents.
|
||||||
|
Reference in New Issue
Block a user