summaryrefslogtreecommitdiffstats
path: root/src/routers/rf_set_ugid.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:47:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:47:26 +0000
commit96b619cc129afed52411b9fad3407037a1cb7207 (patch)
treee453a74cc9ae39fbfcb3ac55a347e880413e4a06 /src/routers/rf_set_ugid.c
parentInitial commit. (diff)
downloadexim4-96b619cc129afed52411b9fad3407037a1cb7207.tar.xz
exim4-96b619cc129afed52411b9fad3407037a1cb7207.zip
Adding upstream version 4.92.upstream/4.92upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/routers/rf_set_ugid.c')
-rw-r--r--src/routers/rf_set_ugid.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/routers/rf_set_ugid.c b/src/routers/rf_set_ugid.c
new file mode 100644
index 0000000..e1346b4
--- /dev/null
+++ b/src/routers/rf_set_ugid.c
@@ -0,0 +1,44 @@
+/*************************************************
+* Exim - an Internet mail transport agent *
+*************************************************/
+
+/* Copyright (c) University of Cambridge 1995 - 2009 */
+/* See the file NOTICE for conditions of use and distribution. */
+
+#include "../exim.h"
+#include "rf_functions.h"
+
+
+/*************************************************
+* Set uid/gid from block into address *
+*************************************************/
+
+/* This function copies any set uid or gid from a ugid block into an
+address.
+
+Arguments:
+ addr the address
+ ugid the ugid block
+
+Returns: nothing
+*/
+
+void
+rf_set_ugid(address_item *addr, ugid_block *ugid)
+{
+if (ugid->uid_set)
+ {
+ addr->uid = ugid->uid;
+ setflag(addr, af_uid_set);
+ }
+
+if (ugid->gid_set)
+ {
+ addr->gid = ugid->gid;
+ setflag(addr, af_gid_set);
+ }
+
+if (ugid->initgroups) setflag(addr, af_initgroups);
+}
+
+/* End of rf_set_ugid.c */