LL2_RENAME_USER(3)

πŸ’… LL2_RENAME_USER(3) πŸ’…

okay so this is a page from the Programmers Manual section 3, bestie β€” it's LL2_RENAME_USER, and it's literally the glow-up makeover function for usernames ✨


πŸŽ€ NAME πŸŽ€

ll2_rename_user β€” renames a user entry. that's it, that's the whole job. she rebrands πŸ’–


🌸 SYNOPSIS 🌸

#include <lastlog2.h>

int ll2_rename_user (struct ll2_context *context, const char *user,
const char *newname, char **error);

πŸ¦‹ DESCRIPTION πŸ¦‹

so what she does is: she changes the user name from user to newname on one entry in the database β€” and that database is the one defined by context. 🫢

and heads up, bestie: all other entries with the user user will be deleted. not renamed, not archived, deleted. so like… be aware πŸ‘€

if context is NULL, then the default database β€” the one defined in LL2_DEFAULT_DATABASE β€” gets taken instead. no context, no problem.

here's the vibe in code form:

char    *error = NULL;
const   char *user = "root";
const   char *new_user = "notroot";

int ret = ll2_rename_user (NULL, user, new_user, &error);

⭐ RETURN VALUE ⭐

  • returns 0 on success β€” slay πŸ’…
  • returns -ENOMEM or -1 on other failure 😭
  • error contains an error string if the return value is -1
  • but ngl, error is not guaranteed to contain an error string β€” it could also be NULL
  • and error should be freed by the caller, so don't forget her 🫢

πŸ‘‘ AUTHORS πŸ‘‘

Thorsten Kukuk <kukuk@suse.de> β€” the icon who made this happen πŸ’œ


🌈 SEE ALSO 🌈

the whole friend group fr fr πŸ’–


πŸ“ REPORTING BUGS πŸ“

found a bug? no cap, go tell them β€” use the issue tracker: <https://github.com/util-linux/util-linux/issues> 🧚


πŸ’€ AVAILABILITY πŸ’€

the liblastlog2 library is part of the util-linux package since version 2.40. you can download it from the Linux Kernel Archive: <https://www.kernel.org/pub/linux/utils/util-linux/> ✨


and that's the page, bestie πŸŽ€ this was util-linux 2.41.6, dated 2026-08-31 β€” she's serving LL2_RENAME_USER(3) and honestly? iconic. periodt. πŸ’…πŸ”₯

πŸ“¦ where this page comes from