From 3aae315e6ea8b6e8972a09cb888b244aa662473c Mon Sep 17 00:00:00 2001
From: Holger Dengler <dengler@linutronix.de>
Date: Fri, 7 Jul 2017 11:30:29 +0200
Subject: security: Replace setreuid() and setregid() call

The implicit modification of saved UID or GID is not clear enough
for an example code. Therefore these calls are replaced by the more
suitable setresuid() and setresgid() calls.

Signed-off-by: Holger Dengler <dengler@linutronix.de>
---
 security/advanced/frm_multiuser_dac.tex | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'security/advanced/frm_multiuser_dac.tex')

diff --git a/security/advanced/frm_multiuser_dac.tex b/security/advanced/frm_multiuser_dac.tex
index 633f2fd..1a79a34 100644
--- a/security/advanced/frm_multiuser_dac.tex
+++ b/security/advanced/frm_multiuser_dac.tex
@@ -323,9 +323,9 @@ if(setegid(saved_gid))
 \begin{verbatim}
 printf("\nChange finally to stored UID/GID“);
 printf(" (there is no way back)\n");
-if(setregid(saved_gid, saved_gid))
+if(setresgid(saved_gid, saved_gid, saved_gid))
         /* error handling */;
-if(setreuid(saved_uid, saved_uid))
+if(setresuid(saved_uid, saved_uid, saved_uid))
         /* error handling */;
 \end{verbatim}
 \end{scriptsize}
-- 
cgit v1.2.3

