Details
Description
It would be useful to allow names to be mapped to projid numbers using the /etc/projid file (projid.5), as is used by the XFS quota utility (xfs_quota.8):
usera:1 userc:3
There should be a new function struct ll_project *llapi_getprjname(const char *name) function that is called by lfs and lctl to read the /etc/projid file and lookup the name and return the projid, while struct ll_project *llapi_getprjid(__u32 prjid) would lookup the numeric project ID and return the name:
struct ll_project { __u32 lp_projid; char *lp_name; };
Returning the struct instead of a single value (name or prjid) allows expanding this interface in the future (e.g. to list which users are allowed to use/change the group, passwords for the group, etc. as with getgrnam(), getgrgid(), getpwnam(), getpwuid()).
It isn't very clear what benefit the /etc/projects file (projects.5) provides, so I'm not yet sure whether we need to implement support for this or not.
This should be available for use by lfs project -p, lfs find -projid, lfs quota -p, lfs setquota -p.
Attachments
Issue Links
- has to be done before
-
LU-18659 add new 'lfs projectadd' command to add project entries to the /etc/projid file
-
- Open
-
-
LU-18638 print project name with 'lfs project'
-
- Open
-
-
LU-18640 add option for 'lfs project' to do project name and id lookup only
-
- Open
-
- is related to
-
LU-14915 Add project flags to manage the project's directories and files
-
- Open
-
-
LU-14968 add password for project files
-
- Open
-
-
LU-17702 'lfs quota -u $USER' should print quota for all Lustre mountpoints
-
- Resolved
-
- is related to
-
LU-12056 tar doesn't support project id
-
- Resolved
-
-
LU-18661 allow enable/disable projname->username fallback
-
- Open
-
For the "/etc/passwd" fallback, we've been discussing a few approaches:
Reviewing the Solaris projects(5) man page I see that it is using project names of the form user.USERNAME and group.GROUPNAME" to identify project names to match the username, but which could also be used in addition to or instead of "u:USERNAME". I'm a bit reluctant to allow '.' in the argument. According to this Serverfault page the use of '.' is normally forbidden in user/group names, but I'd prefer to avoid any unnecessary restrictions if possible.