Added sefun for seteuid()
As replacement for the efun seteuid() that was removed in the
driver.
Change-Id: Ic80c53838559a9a1f705e6023805f07e0a827432
diff --git a/secure/simul_efun/seteuid.c b/secure/simul_efun/seteuid.c
new file mode 100644
index 0000000..516a759
--- /dev/null
+++ b/secure/simul_efun/seteuid.c
@@ -0,0 +1,26 @@
+/* This sefun is to provide a replacement for the efun seteuid().
+ * Feel free to add it to your mudlibs, if you have much code relying on that.
+ */
+
+#if ! __EFUN_DEFINED__(seteuid)
+
+#include <configuration.h>
+
+int seteuid(string str)
+{
+ object ob = efun::previous_object();
+
+ if (!str)
+ {
+ efun::configure_object(ob, OC_EUID, 0);
+ return 1;
+ }
+
+ if (efun::call_direct(__MASTER_OBJECT__, "valid_seteuid", ob, str) != 1)
+ return 0;
+
+ efun::configure_object(ob, OC_EUID, str);
+ return 1;
+}
+
+#endif
diff --git a/secure/simul_efun/simul_efun.c b/secure/simul_efun/simul_efun.c
index 04a312b..a1d987a 100644
--- a/secure/simul_efun/simul_efun.c
+++ b/secure/simul_efun/simul_efun.c
@@ -87,6 +87,7 @@
#include __DIR__"livings.c"
#include __DIR__"comm.c"
#include __DIR__"files.c"
+#include __DIR__"seteuid.c"
#define TO efun::this_object()
#define TI efun::this_interactive()
diff --git a/sys/configuration.h b/sys/configuration.h
index b2c0b88..8ca189e 100644
--- a/sys/configuration.h
+++ b/sys/configuration.h
@@ -23,6 +23,7 @@
*/
#define OC_COMMANDS_ENABLED 0
#define OC_HEART_BEAT 1
+#define OC_EUID 2
/* Possible options for configure_driver().
*/