1DPNS_CHOWN(3) DPNS Library Functions DPNS_CHOWN(3)
2
3
4
6 dpns_chown - change owner and group of a DPNS directory/file in the
7 name server
8
10 #include <sys/types.h>
11 #include "dpns_api.h"
12
13 int dpns_chown (const char *path, uid_t new_uid, gid_t new_gid)
14
15 int dpns_lchown (const char *path, uid_t new_uid, gid_t new_gid)
16
18 dpns_chown sets the owner and the group of a DPNS directory/file in the
19 name server to the numeric values in owner and group respectively. If
20 owner or group is specified as -1, dpns_chown() does not change the
21 corresponding ID of the file.
22
23 dpns_lchown is identical to dpns_chown except for symbolic links: it
24 does not follow the link but changes the ownership of the link itself.
25
26 path specifies the logical pathname relative to the current DPNS
27 directory or the full DPNS pathname.
28
29 To change the owner ID, if the group ID does not change and if the
30 caller and the new owner ID belong to that group, GRP_ADMIN privilege
31 is needed, otherwise the caller must have ADMIN privilege in the Cupv
32 database. To change the group ID, the effective user ID of the process
33 must match the owner ID of the file and the new group must be in the
34 list of groups the caller belong to or the caller must have ADMIN priv‐
35 ilege in the Cupv database.
36
38 This routine returns 0 if the operation was successful or -1 if the
39 operation failed. In the latter case, serrno is set appropriately.
40
42 EPERM The effective user ID does not match the owner of the file
43 and the caller does not have ADMIN privilege in the Cupv
44 database.
45
46 ENOENT The named file/directory does not exist or is a null path‐
47 name.
48
49 EACCES Search permission is denied on a component of the path
50 prefix.
51
52 EFAULT path is a NULL pointer.
53
54 ENOTDIR A component of path prefix is not a directory.
55
56 EINVAL new_uid or new_gid is invalid.
57
58 ENAMETOOLONG The length of path exceeds CA_MAXPATHLEN or the length of
59 a path component exceeds CA_MAXNAMELEN.
60
61 SENOSHOST Host unknown.
62
63 SENOSSERV Service unknown.
64
65 SECOMERR Communication error.
66
67 ENSNACT Name server is not running or is being shutdown.
68
70 Castor_limits(4), dpns_chdir(3), Cupvlist(1)
71
73 LCG Grid Deployment Team
74
75
76
77DPNS $Date: 2003/09/02 07:15:00 $ DPNS_CHOWN(3)