MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | SYNOPSIS |
| 2 | string valid_read(string path, string uid, string func, object ob) |
| 3 | |
| 4 | DESCRIPTION |
| 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. |
| 11 | |
| 12 | The returned pathname must not contain ``..'', a leading / |
| 13 | will be stripped by the interpreter. |
| 14 | |
| 15 | Func denotes the efun call or other operation that caused |
| 16 | valid_read() to be called: |
| 17 | ed_start (check if the file to be edited is readable), |
| 18 | file_size, |
| 19 | get_dir, |
| 20 | print_file (efun cat()), |
| 21 | read_bytes, |
| 22 | read_file, |
| 23 | restore_object, |
| 24 | tail. |
| 25 | |
| 26 | Note that this function is called in compat mode as well. If |
| 27 | you need to be compatible with the old 2.4.5-mudlib, redirect |
| 28 | these calls to the valid_read/valid_write in the user |
| 29 | object. |
| 30 | |
| 31 | SEE ALSO |
| 32 | valid_write(M), make_path_absolute(M) |