MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame^] | 2 | string valid_read(string path, string uid, string func, object ob) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 3 | |
| 4 | DESCRIPTION |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame^] | 5 | This function is called to check if the object ob with the |
| 6 | user-id uid has read permissions for the file given by path |
| 7 | for the operation named by func. It should return 0 if |
| 8 | permission is denied, or the normalized path if permission is |
| 9 | granted. You can also return 1 to indicate that the path can |
| 10 | be used unchanged. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 11 | |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame^] | 12 | The returned pathname must not contain "..", a leading / |
| 13 | will be stripped by the interpreter. By default, the returned |
| 14 | path must also not contain space characters; if the driver |
| 15 | is instructed to allow them, the preprocessor macro |
| 16 | __FILENAME_SPACES__ is defined. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 17 | |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame^] | 18 | Func denotes the efun call or other operation that caused |
| 19 | valid_read() to be called: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 20 | |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame^] | 21 | copy_file |
| 22 | ed_start (check if the file to be edited is readable), |
| 23 | file_size, |
| 24 | get_dir, |
| 25 | print_file (efun cat()), |
| 26 | read_bytes, |
| 27 | read_file, |
| 28 | restore_object, |
| 29 | tail. |
| 30 | |
| 31 | For restore_object(), the <path> passed is the filename as given |
| 32 | in the efun call. |
| 33 | |
| 34 | This function is called in compat mode as well. If |
| 35 | you need to be compatible with the old 2.4.5-mudlib, redirect |
| 36 | these calls to the valid_read/valid_write in the user |
| 37 | object. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 38 | |
| 39 | SEE ALSO |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame^] | 40 | valid_write(M), make_path_absolute(M) |