Debian Codegraph @

liblastlog2/man/ll2_rename_user.3

raw
1 '\" t
2 .\" Title: ll2_rename_user
3 .\" Author: [see the "AUTHOR(S)" section]
4 .\" Generator: Asciidoctor 2.0.20
5 .\" Date: 2026-04-28
6 .\" Manual: Programmer's Manual
7 .\" Source: util-linux 2.42.1
8 .\" Language: English
9 .\"
10 .TH "LL2_RENAME_USER" "3" "2026-04-28" "util\-linux 2.42.1" "Programmer\*(Aqs Manual"
11 .ie \n(.g .ds Aq \(aq
12 .el .ds Aq '
13 .ss \n[.ss] 0
14 .nh
15 .ad l
16 .de URL
17 \fI\\$2\fP <\\$1>\\$3
18 ..
19 .als MTO URL
20 .if \n[.g] \{\
21 . mso www.tmac
22 . am URL
23 . ad l
24 . .
25 . am MTO
26 . ad l
27 . .
28 . LINKSTYLE blue R < >
29 .\}
30 .SH "NAME"
31 ll2_rename_user \- Renames a user entry.
32 .SH "SYNOPSIS"
33 .sp
34 \fB#include <lastlog2.h>\fP
35 .sp
36 \fBint ll2_rename_user (struct ll2_context *\fIcontext\fP, const char *\fIuser\fP,
37 const char *\fInewname\fP, char **\fIerror\fP);\fP
38 .SH "DESCRIPTION"
39 .sp
40 Changes user name from \fIuser\fP to \fInewname\fP of one entry in
41 database, which is defined by \fIcontext\fP. All other entries with the user \fIuser\fP
42 will be deleted.
43 If \fIcontext\fP is NULL, the default database, defined in \fILL2_DEFAULT_DATABASE\fP,
44 will be taken.
45 .sp
46 .if n .RS 4
47 .nf
48 .fam C
49 char *error = NULL;
50 const char *user = "root";
51 const char *new_user = "notroot";
52
53 int ret = ll2_rename_user (NULL, user, new_user, &error);
54 .fam
55 .fi
56 .if n .RE
57 .SH "RETURN VALUE"
58 .sp
59 Returns 0 on success, \-ENOMEM or \-1 on other failure.
60 \fIerror\fP contains an error string if the return value is \-1.
61 \fIerror\fP is not guaranteed to contain an error string, could also be NULL.
62 \fIerror\fP should be freed by the caller.
63 .SH "AUTHORS"
64 .sp
65 .MTO "kukuk\(atsuse.de" "Thorsten Kukuk" ""
66 .SH "SEE ALSO"
67 .sp
68 \fBlastlog2\fP(3),
69 \fBll2_new_context\fP(3),
70 \fBll2_unref_context\fP(3),
71 \fBll2_read_all\fP(3),
72 \fBll2_write_entry\fP(3),
73 \fBll2_read_entry\fP(3),
74 \fBll2_remove_entry\fP(3),
75 \fBll2_update_login_time\fP(3),
76 \fBll2_import_lastlog\fP(3)
77 .SH "REPORTING BUGS"
78 .sp
79 For bug reports, use the \c
80 .URL "https://github.com/util\-linux/util\-linux/issues" "issue tracker" "."
81 .SH "AVAILABILITY"
82 .sp
83 The \fBliblastlog2\fP library is part of the util\-linux package since version 2.40. It can be downloaded from \c
84 .URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."