projects
/
sudo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d39747e
)
create_admin_success_flag() should use restore_perms() rather than
author
Todd C. Miller
<Todd.Miller@courtesan.com>
Tue, 23 Nov 2010 12:34:22 +0000
(07:34 -0500)
committer
Todd C. Miller
<Todd.Miller@courtesan.com>
Tue, 23 Nov 2010 12:34:22 +0000
(07:34 -0500)
set_perms() to restore the uid.
plugins/sudoers/sudoers.c
patch
|
blob
|
history
diff --git
a/plugins/sudoers/sudoers.c
b/plugins/sudoers/sudoers.c
index af86e776b16fb4acec090fa1cbd91898a09fe717..9e285e33e3b156f1c897974cff0dbf630467d5a1 100644
(file)
--- a/
plugins/sudoers/sudoers.c
+++ b/
plugins/sudoers/sudoers.c
@@
-1349,14
+1349,11
@@
create_admin_success_flag(void)
/* Create admin flag file if it doesn't already exist. */
set_perms(PERM_USER);
- if (stat(flagfile, &statbuf)
=
= 0) {
-
set_perms(PERM_ROOT
);
-
return
;
+ if (stat(flagfile, &statbuf)
!
= 0) {
+
fd = open(flagfile, O_CREAT|O_WRONLY|O_EXCL, 0644
);
+
close(fd)
;
}
-
- fd = open(flagfile, O_CREAT|O_WRONLY|O_EXCL, 0644);
- close(fd);
- set_perms(PERM_ROOT);
+ restore_perms();
}
#else /* !USE_ADMIN_FLAG */
static void