cvm-sql(7)

πŸ’– cvm-sql(7) β€” the CVM SQL Framework πŸ’–

okay bestie, sit down, hydrate, and let me tell you about cvm-sql(7) from the Miscellaneous Information Manual, because this little page is genuinely the blueprint for how CVM talks to a SQL database and it's lowkey iconic. πŸ¦‹


✨ NAME ✨

cvm-sql β€” the CVM SQL Framework. it's giving "database-backed credential validation", and honestly? obsessed. πŸ‘‘


πŸŽ€ QUERY SUBSTITUTION πŸŽ€

so when you write a query, $VAR and ${VAR} get swapped out for the quoted value of the environment variable called VAR. periodt. πŸ’…

  • use the ${VAR} form whenever VAR contains literally anything that isn't alphanumeric or an underscore (_). she's the flexi one, she handles the chaos. 🫢
  • do NOT put quotes in the query yourself β€” the substitution already brings the quotes, so adding your own is just double-quoting and that's not the vibe. πŸ™ˆ
  • account and domain are the special ones: they hold the account and domain names that the CVM client handed over. main character variables fr fr. ⭐
  • $$ becomes a single dollar sign. yes really, that's the escape hatch. πŸ’€

🌸 QUERY RESULTS 🌸

your query has to produce these fields exactly in this order. no shuffling, no remixing, no "close enough". and every required field must not be null and must not be empty β€” empty strings are NOT the moment. 🚫

  1. Password, encrypted with crypt(3) β€” required πŸ”
  2. Actual account name β€” required
  3. User ID (integer) β€” required
  4. Group ID (integer) β€” required
  5. Directory β€” required
  6. Real name β€” optional
  7. Login shell β€” optional
  8. Group name β€” optional
  9. Domain name β€” optional
  10. System account name β€” optional
  11. System account directory β€” optional
  12. Mailbox path β€” optional
bestie if the order is off, it's over. the order IS the assignment. 😭

🌈 DEFAULT QUERY 🌈

here's the default one, the moment, the blueprint:

SELECT password, username, userid, groupid, directory, realname, shell,
groupname, domain, sys_username, sys_directory FROM accounts WHERE
username=$account AND domain=$domain

she's simple, she's clean, she works. keep her exactly as written if you're not feeling creative. ✨


🧚 SEE ALSO 🧚

go read these next, they're all part of the family:

and the website, if you wanna go deeper: http://untroubled.org/cvm/cvm.html 🌐


and that's the whole page, bestie πŸ’œ this was cvm-sql(7) β€” the Miscellaneous Information Manual, page cvm-sql(7), from the CVM source/version of that manual. no cap, go forth and query responsibly. πŸ“βœ¨

πŸ“¦ where this page comes from