summaryrefslogtreecommitdiff
path: root/lib/uid_wrapper/uid_wrapper.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-06-28 11:59:51 -0700
committerJeremy Allison <jra@samba.org>2012-06-28 17:15:16 -0700
commit821bd95156e8cc6d843aecb0a27d4a08761b7dac (patch)
treea35f1f0059005555bc3fe548760a9cf01e896d55 /lib/uid_wrapper/uid_wrapper.c
parent7630fe50bd7d0783d1f6b253cbee46cccca3f774 (diff)
downloadsamba-821bd95156e8cc6d843aecb0a27d4a08761b7dac.tar.gz
samba-821bd95156e8cc6d843aecb0a27d4a08761b7dac.tar.bz2
samba-821bd95156e8cc6d843aecb0a27d4a08761b7dac.zip
Replace all uses of setXX[ug]id() and setgroups with samba_setXX[ug]id() calls.
Will allow thread-specific credentials to be added by modifying the central definitions. Deliberately left the setXX[ug]id() call in popt as this is not used in Samba.
Diffstat (limited to 'lib/uid_wrapper/uid_wrapper.c')
-rw-r--r--lib/uid_wrapper/uid_wrapper.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c
index 898d1afbb9..7a85a9563a 100644
--- a/lib/uid_wrapper/uid_wrapper.c
+++ b/lib/uid_wrapper/uid_wrapper.c
@@ -22,6 +22,7 @@
#include "replace.h"
#include "system/passwd.h"
#include <talloc.h>
+#include "../lib/util/setid.h"
#else /* _SAMBA_BUILD_ */
@@ -72,7 +73,7 @@ _PUBLIC_ int uwrap_seteuid(uid_t euid)
{
uwrap_init();
if (!uwrap.enabled) {
- return seteuid(euid);
+ return samba_seteuid(euid);
}
/* assume for now that the ruid stays as root */
if (euid == 0) {
@@ -89,7 +90,7 @@ _PUBLIC_ int uwrap_setreuid(uid_t ruid, uid_t euid)
{
uwrap_init();
if (!uwrap.enabled) {
- return setreuid(ruid, euid);
+ return samba_setreuid(ruid, euid);
}
/* assume for now that the ruid stays as root */
if (euid == 0) {
@@ -106,7 +107,7 @@ _PUBLIC_ int uwrap_setresuid(uid_t ruid, uid_t euid, uid_t suid)
{
uwrap_init();
if (!uwrap.enabled) {
- return setresuid(ruid, euid, suid);
+ return samba_setresuid(ruid, euid, suid);
}
/* assume for now that the ruid stays as root */
if (euid == 0) {
@@ -132,7 +133,7 @@ _PUBLIC_ int uwrap_setegid(gid_t egid)
{
uwrap_init();
if (!uwrap.enabled) {
- return setegid(egid);
+ return samba_setegid(egid);
}
/* assume for now that the ruid stays as root */
if (egid == 0) {
@@ -149,7 +150,7 @@ _PUBLIC_ int uwrap_setregid(gid_t rgid, gid_t egid)
{
uwrap_init();
if (!uwrap.enabled) {
- return setregid(rgid, egid);
+ return samba_setregid(rgid, egid);
}
/* assume for now that the ruid stays as root */
if (egid == 0) {
@@ -166,7 +167,7 @@ _PUBLIC_ int uwrap_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
{
uwrap_init();
if (!uwrap.enabled) {
- return setresgid(rgid, egid, sgid);
+ return samba_setresgid(rgid, egid, sgid);
}
/* assume for now that the ruid stays as root */
if (egid == 0) {
@@ -191,7 +192,7 @@ _PUBLIC_ int uwrap_setgroups(size_t size, const gid_t *list)
{
uwrap_init();
if (!uwrap.enabled) {
- return setgroups(size, list);
+ return samba_setgroups(size, list);
}
talloc_free(uwrap.groups);