libnfsidmap-regex(5)

πŸ“¦ version 1.2, in ubuntu jammy

πŸ’– NAME πŸ’–

okay so bestie, this is libnfsidmap-regex β€” manual page number 5, filed under File Formats Manual πŸ“„βœ¨

regex β€” it's the libnfsidmap plugin that uses regex to map ids 🧚


✨ SYNOPSIS ✨

A plugin for libnfsidmap. It uses regex to map NFSv4 names to and from ids. that's the whole vibe πŸ¦‹


🌸 DESCRIPTION 🌸

The regex plugin parses NFSv4 user and group names using regex to extract the local user or group. fr fr that's its whole job πŸ’…

NFSv4 names get created by slapping constant strings before and after the local user and group names. iconic sandwich behavior πŸ₯ͺ✨

It additionally supports an additional configuration file for static group mappings. yes bestie, extra config, extra power πŸ‘‘


πŸŽ€ CONFIGURATION πŸŽ€

The config for this plugin lives in a brand new [Regex] section inside /etc/idmapd.conf, and it can contain lines shaped like this:

variable = value

The variables it actually recognizes are these ones πŸ‘‡

πŸ’… [Regex] section variables

  • User-Regex β€” the regular expression that pulls the local user name out of an NFSv4 name. You can concatenate several expressions with |, and the first match is the one that gets used. first come first served, periodt βœ‹
  • Group-Regex β€” the regular expression that pulls the local group name out of an NFSv4 name. Same deal: concatenate several with |, and the first match wins. πŸ’«
  • Prepend-Before-User β€” a constant string to put before a local user name when you're building an NFSv4 name.

(Default: none)

  • Append-After-User β€” a constant string to put after a local user name when you're building an NFSv4 name.

(Default: none)

  • Prepend-Before-Group β€” a constant string to put before a local group name when you're building an NFSv4 name.

(Default: none)

  • Append-After-Group β€” a constant string to put before a local group name when you're building an NFSv4 name.

(Default: none)

okay bestie yes, that one really does say "before" in its description. I'm not fixing it, I'm not touching it, I'm just reporting what the page says πŸ™ˆ
  • Group-Name-Prefix β€” a constant string that gets prepended to a local group name when it's converted into an NFSv4 name. And if an NFSv4 group name has this prefix, the prefix gets removed when converting it back to a local group name. It IS not applied if a static group mapping matches. ⚠️

This is the whole point: it lets you organize the group name space in a central directory that's used for a central NFS4 server, while using short group names in the local directory used in organizational units. big brain centralization energy 🧠🌈

  • Group-Name-No-Prefix-Regex β€” a regular expression to exclude groups from adding and removing the prefix set by Group-Name-Prefix. The regex must match both the remote and local group names. both of them, no skipping πŸ‘€

(Default: none)

  • Group-Map-File β€” the file name of an INI style file containing static group mappings.

(Default: /etc/idmapd.conf)

  • Group-Map-Section β€” the section in the static group mapping file that contains the mappings. The name must be all lower case. The section name in the file is case sensitive. two rules, don't mix them up 😭

(Default: groups)


πŸ¦‹ STATIC MAPPING πŸ¦‹

The Group-Map-File and Group-Map-Section variables let you define a section full of mappings shaped like:

nfs4 group = local group

The default is to have a [Groups] section in the /etc/idmapd.conf file. yes bestie, defaults really do be doing all the work πŸ’«

For both the NFS4 and the local group name, the Group-Name-Prefix prefix is not applied or removed. none of that, not here 🚫


⭐ EXAMPLES ⭐

Here's an example [Regex] and [Groups] section inside /etc/idmapd.conf:

[Regex]
User-Regex = ^EXAMPLE\([^@]+)@EXAMPLE.ORG$
Group-Regex = ^([^@]+)@EXAMPLE.ORG@EXAMPLE.ORG$|^EXAMPLE\([^@]+)@EXAMPLE.ORG$
Prepend-Before-User = EXAMPLE
Append-After-User = @EXAMPLE.ORG
#Prepend-Before-Group =
Append-After-Group = @example.org@example.org
Group-Name-Prefix = sales-
Group-Name-No-Prefix-Regex = -group$

[Groups]
domain users = users

copy it, tweak it, slay it πŸ’…βœ¨


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’€ BUGS πŸ’€

Report bugs to <stefan.walter@inf.ethz.ch> πŸ›πŸ“¬


and that's the whole page bestie!! this one's from the File Formats Manual family, and it's dated 25 March 2020 πŸŽ‚ β€” go forth and map those ids, no cap πŸ«ΆπŸ’–πŸŒΈ

πŸ“¦ where this page comes from