CAP_MKDB(1)

πŸ“¦
version 237 Β· 3 versions
, in nixpkgs unstable

Ok bestie, welcome to CAP_MKDB(1), from the General Commands Manual β€” home of cap_mkdb, the create-a-capability-database girlie. ✨

πŸ’– NAME πŸ’–

cap_mkdb β€” create capability database. Periodt. πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

cap_mkdb [-v] [-f outfile] file1 [file2 ...]

🌸 DESCRIPTION 🌸

Okay so here’s the vibe: cap_mkdb builds a hashed database out of the getcap(3) logical database constructed by the concatenation of the specified files. 🫢

The database is named by the basename of the first file argument and the string ".db". So yeah, first file = name inspo, ".db" = the suffix. The getcap(3) routines can access the database in this form much more quickly than they can the original text file(s). Iconic.

The tc capabilities of the records are expanded before the record is stored into the database. No cap. πŸ’…

The options are as follows:

  • -f outfile β€” specify a different database basename. Different basename, same chaotic energy.
  • -v β€” print out the number of capability records in the database. Numbers! Love that for us. πŸ”₯

πŸŽ€ FORMAT πŸŽ€

Each record is stored in the database using two different types of keys. Two keys, one record, main character energy. πŸ‘‘

Type 1 key: it consists of the first capability of the record (not including the trailing colon (:)) with a data field consisting of a special byte followed by the rest of the record. The special byte is either a 0 or a 1, where 0 means that the record is okay, and 1 means that there was a tc capability in the record that couldn’t be expanded. That’s the β€œuh oh, tc didn’t expand” flag, bestie. 😭

Type 2 key: it consists of one of the names from the first capability of the record with a data field consisting of a special byte followed by the first capability of the record. The special byte is a 2. Literally type-two coded. πŸ¦‹

In normal operation, names are looked up in the database, resulting in a key/data pair of the second type. The data field of this key/data pair is used to look up a key/data pair of the first type which has the real data associated with the name. So the lookup is a two-step slay: name β†’ type-2 pair β†’ its data field β†’ type-1 pair β†’ the actual data. Periodt. ✨

⭐ RETURN VALUE ⭐

The cap_mkdb utility exits 0 on success and >0 if an error occurs. So 0 = slay, >0 = something went sideways. πŸ’€

🌈 SEE ALSO 🌈

Go read these if you’re feeling curious, iykyk. 🧚


This page’s source/version is Debian, and its date is June 6, 1993. Byeee, bestie β€” go make that hashed database. πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from
  • nixpkgs unstable: adv_cmds 237
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms