blob: 45f0bb6628568ed632fb0bf637db5a05476ef14b [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra7ea4a032019-11-26 20:11:40 +01002 string valid_read(string path, string uid, string func, object ob)
MG Mud User88f12472016-06-24 23:31:02 +02003
4DESCRIPTION
Zesstra7ea4a032019-11-26 20:11:40 +01005 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 User88f12472016-06-24 23:31:02 +020011
Zesstra7ea4a032019-11-26 20:11:40 +010012 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 User88f12472016-06-24 23:31:02 +020017
Zesstra7ea4a032019-11-26 20:11:40 +010018 Func denotes the efun call or other operation that caused
19 valid_read() to be called:
MG Mud User88f12472016-06-24 23:31:02 +020020
Zesstra7ea4a032019-11-26 20:11:40 +010021 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 User88f12472016-06-24 23:31:02 +020038
39SEE ALSO
Zesstra7ea4a032019-11-26 20:11:40 +010040 valid_write(M), make_path_absolute(M)