1LFC_CHOWN(3) LFC Library Functions LFC_CHOWN(3)
2
3
4
6 lfc_chown - change owner and group of a LFC directory/file in the name
7 server
8
10 #include <sys/types.h>
11 #include "lfc_api.h"
12
13 int lfc_chown (const char *path, uid_t new_uid, gid_t new_gid)
14
15 int lfc_lchown (const char *path, uid_t new_uid, gid_t new_gid)
16
18 lfc_chown sets the owner and the group of a LFC 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, lfc_chown() does not change the cor‐
21 responding ID of the file.
22
23 lfc_lchown is identical to lfc_chown except for symbolic links: it does
24 not follow the link but changes the ownership of the link itself.
25
26 path specifies the logical pathname relative to the current LFC
27 directory or the full LFC 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), lfc_chdir(3), Cupvlist(1)
71
73 LCG Grid Deployment Team
74
75
76
77LFC $Date: 2003/09/02 07:15:00 $ LFC_CHOWN(3)