Zesstra | 7b2fbe7 | 2017-06-17 19:05:06 +0200 | [diff] [blame] | 1 | /* This sefun is to provide a replacement for the efun seteuid(). |
| 2 | * Feel free to add it to your mudlibs, if you have much code relying on that. |
| 3 | */ |
| 4 | |
| 5 | #if ! __EFUN_DEFINED__(seteuid) |
| 6 | |
| 7 | #include <configuration.h> |
| 8 | |
| 9 | int seteuid(string str) |
| 10 | { |
| 11 | object ob = efun::previous_object(); |
| 12 | |
| 13 | if (!str) |
| 14 | { |
| 15 | efun::configure_object(ob, OC_EUID, 0); |
| 16 | return 1; |
| 17 | } |
| 18 | |
| 19 | if (efun::call_direct(__MASTER_OBJECT__, "valid_seteuid", ob, str) != 1) |
| 20 | return 0; |
| 21 | |
| 22 | efun::configure_object(ob, OC_EUID, str); |
| 23 | return 1; |
| 24 | } |
| 25 | |
| 26 | #endif |