]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lastlog2: Improve comments and documentation
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 12 Aug 2024 15:37:53 +0000 (17:37 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 12 Aug 2024 15:37:53 +0000 (17:37 +0200)
Fix grammar issues and unify style across documentation and code comments.
No functional change.

13 files changed:
liblastlog2/README.md
liblastlog2/man/lastlog2.3.adoc
liblastlog2/man/ll2_import_lastlog.3.adoc
liblastlog2/man/ll2_new_context.3.adoc
liblastlog2/man/ll2_read_all.3.adoc
liblastlog2/man/ll2_read_entry.3.adoc
liblastlog2/man/ll2_remove_entry.3.adoc
liblastlog2/man/ll2_rename_user.3.adoc
liblastlog2/man/ll2_unref_context.3.adoc
liblastlog2/man/ll2_update_login_time.3.adoc
liblastlog2/man/ll2_write_entry.3.adoc
liblastlog2/src/lastlog2.c
misc-utils/lastlog2.8.adoc

index 8bcfb39b655d9443ae1dd4121bcd294ae411b576..7095edd5798c8d741821ab494e77341450693ffa 100644 (file)
@@ -18,15 +18,15 @@ Since there are only few applications which really support `lastlog`, the data i
 
 ## lastlog2
 
-`lastlog2` tries to solve this problems:
+`lastlog2` tries to solve these problems:
 
 * It's using sqlite3 as database backend.
-* Data is only collected via a PAM module, so that every tools can make use of it, without modifying existing packages.
+* Data is only collected via a PAM module, so that all tools can make use of it, without modifying existing packages.
 * The output is as compatible as possible with the old lastlog implementation.
 * The old `/var/log/lastlog` file can be imported into the new database.
 * The size of the database depends on the amount of users, not how big the biggest UID is.
 
-**IMPORTANT** To be Y2038 safe on 32bit architectures, the binaries needs to be build with a **64bit time_t**. This should be the standard on 64bit architectures.
+**IMPORTANT** To be Y2038 safe on 32bit architectures, the binaries need to be built with a **64bit time_t**. This should be the standard on 64bit architectures.
 
 Besides the lastlog2 library in this directory there are additional parts like service definition, PAM module and applications:
 
index 05cab12187bf316dfeb79ef90153e00cfa18ae20..405bdb2a5331bf8b8d27078e789fce478b851dc4 100644 (file)
@@ -19,7 +19,7 @@ lastlog2 - Y2038 safe version of lastlog library.
 
 *lastlog2* reports the last login of a given user or of all users who did ever login on a system.
 
-It's using sqlite3 as database backend. Data is only collected via a PAM module, so that every
+It's using sqlite3 as database backend. Data is only collected via a PAM module, so that all
 tools can make use of it, without modifying existing packages.
 The output is as compatible as possible with the old lastlog implementation.
 By default the database will be written as `/var/lib/lastlog/lastlog2.db`.
index 9ddf54b16796843487fd95e36d42cf133b342c3f..672a92cd167f3df32b8ac6de5c5a00ee8151f856 100644 (file)
@@ -9,7 +9,7 @@
 
 == NAME
 
-ll2_import_lastlog - Import old lastlog file.
+ll2_import_lastlog - Imports old lastlog file.
 
 == SYNOPSIS
 
@@ -21,7 +21,7 @@ ll2_import_lastlog - Import old lastlog file.
 
 == DESCRIPTION
 
-Importing all entries from _lastlog_file_ file (lastlog(8)) into
+Imports all entries from _lastlog_file_ file (lastlog(8)) into
 lastlog2 database defined with _context_.
 If _context_ is NULL, the default database, defined in _LL2_DEFAULT_DATABASE_,
 will be taken.
index 9a46646a7d1097fe07357497892258a833fecf88..8bb280422ec6bbda3aef04988515f758a6bbd5fb 100644 (file)
@@ -9,7 +9,7 @@
 
 == NAME
 
-ll2_new_context - Context which defines the lastlog2 environment.
+ll2_new_context - Allocates context which defines the lastlog2 environment.
 
 == SYNOPSIS
 
@@ -19,8 +19,8 @@ ll2_new_context - Context which defines the lastlog2 environment.
 
 == DESCRIPTION
 
-Defining lastlog2 context e.g. database file, which will be used for
-any other lastlog2 calls. If _db_path_ is NULL, the default path defined
+Defines lastlog2 context e.g. database file, which will be used for
+any other lastlog2 call. If _db_path_ is NULL, the default path defined
 in _LL2_DEFAULT_DATABASE_ will be taken.
 
 --------------------------------------
@@ -32,7 +32,7 @@ ll2_context *context = ll2_new_context(db_path);
 
 == RETURN VALUE
 
-Returns context which will used for all other lastlog2 library calls.
+Returns context which will be used for all other lastlog2 library calls.
 This context should be released with _ll2_unref_context_ when it is not
 needed anymore.
 Returns NULL on an error.
index 8f1a120a935bce14bc856d98d472b4d2d7b9c405..26617d6178fed1bc36d8bd4f1823dc8d0c9996b3 100644 (file)
@@ -46,7 +46,7 @@ Returns 0 on success, -ENOMEM or -1 on other failure.
 _error_ contains an error string if the return value is -1.
 _error_ is not guaranteed to contain an error string, could also be NULL.
 _error_ should be freed by the caller.
-If lastlog2 database does not exist at all, the errno ENOENT has been set
+If lastlog2 database does not exist at all, the errno ENOENT is set
 and can be checked.
 
 == AUTHORS
index 3bef1a83788987ceac5bc675f1ee4e43705a339e..063861284a5ccb76bc300b428b93a6e898a476b3 100644 (file)
@@ -42,7 +42,7 @@ Returns 0 on success, -ENOMEM or -1 on other failure.
 _error_ contains an error string if the return value is -1.
 _error_ is not guaranteed to contain an error string, could also be NULL.
 _error_ should be freed by the caller.
-If lastlog2 database does not exist at all, the errno ENOENT has been set
+If lastlog2 database does not exist at all, the errno ENOENT is set
 and can be checked.
 
 The evaluated values are returned by _ll_time_, _tty_, _rhost_ and _pam_service_.
index f38ab66b336970a021f873da838b3d1ed2cdb057..622c3c65f55315ec9b00b2260b269bda37e1a68e 100644 (file)
@@ -9,7 +9,7 @@
 
 == NAME
 
-ll2_remove_entry - Remove all entries of an user.
+ll2_remove_entry - Removes all entries of a user.
 
 == SYNOPSIS
 
@@ -20,7 +20,7 @@ ll2_remove_entry - Remove all entries of an user.
 
 == DESCRIPTION
 
-Removing all database entries, defined in _context_, with the user name _user_.
+Removes all database entries, defined in _context_, with the user name _user_.
 If _context_ is NULL, the default database, defined in _LL2_DEFAULT_DATABASE_,
 will be taken.
 
index 2202fe231640d8cc99559179233d839775ee8606..d3687a9dca975975668562cd15224b69e54598f4 100644 (file)
@@ -9,7 +9,7 @@
 
 == NAME
 
-ll2_rename_user - Renames an user entry.
+ll2_rename_user - Renames a user entry.
 
 == SYNOPSIS
 
@@ -20,7 +20,7 @@ ll2_rename_user - Renames an user entry.
 
 == DESCRIPTION
 
-Changing user name from _user_ to _newname_ of one entry in
+Changes user name from _user_ to _newname_ of one entry in
 database, which is defined by _context_. All other entries with the user _user_
 will be deleted.
 If _context_ is NULL, the default database, defined in _LL2_DEFAULT_DATABASE_,
index 5e52ca60ef18b7a90a1136f0503a2a6460eb4db0..937de5974ef2dfb76527f5d74b767ddeb6529836 100644 (file)
@@ -9,7 +9,7 @@
 
 == NAME
 
-ll2_unref_context - Freeing lastlog2 context.
+ll2_unref_context - Frees lastlog2 context.
 
 == SYNOPSIS
 
@@ -19,7 +19,7 @@ ll2_unref_context - Freeing lastlog2 context.
 
 == DESCRIPTION
 
-Freeing lastlog2 context, which has been generated by
+Frees lastlog2 context, which has been allocated by
 _ll2_new_context_.
 
 --------------------------------------
index 9cc43e164f26744eea5f4226736bd4e35e86f412..3a7aed58998f4c09083b342d78121c865aa80a8f 100644 (file)
@@ -9,7 +9,7 @@
 
 == NAME
 
-ll2_update_login_time - Writes an *new* entry with updated login time.
+ll2_update_login_time - Writes a *new* entry with updated login time.
 
 == SYNOPSIS
 
@@ -21,7 +21,7 @@ ll2_update_login_time - Writes an *new* entry with updated login time.
 
 == DESCRIPTION
 
-Writes an *new* entry to database, defined in _context_, for user _user_.
+Writes a *new* entry to database, defined in _context_, for user _user_.
 Time is set by _ll_time_ whereas the other values are taken from
 an already existing entry.
 If _context_ is NULL, the default database, defined in _LL2_DEFAULT_DATABASE_,
@@ -39,7 +39,7 @@ int ret = ll2_update_login_time (NULL, user, login_time, &error);
 
 Returns 0 on success, -ENOMEM or -1 on other failure.
 _error_ contains an error string if the return value is -1.
-_error_ is not guaranteed to contain an error string. It could also be NULL if the return value is -1.
+_error_ is not guaranteed to contain an error string, could also be NULL.
 _error_ should be freed by the caller.
 
 == AUTHORS
index 6dca1b5c661c66efd6e33a427ef859f130e80b7d..fc8e92b7541049d66d10a32c0613fd4174caa4b9 100644 (file)
@@ -9,7 +9,7 @@
 
 == NAME
 
-ll2_write_entry -  Write a new entry into the database.
+ll2_write_entry -  Writes a new entry into the database.
 
 == SYNOPSIS
 
@@ -22,7 +22,7 @@ ll2_write_entry -  Write a new entry into the database.
 
 == DESCRIPTION
 
-Writes an new entry into database, which is defined in _context_.
+Writes a new entry into database, which is defined in _context_.
 If _context_ is NULL, the default database, defined in _LL2_DEFAULT_DATABASE_,
 will be taken.
 
index cafcb017ee46d255e0a84f033f203e04e650dcbc..2d3ab2050172b36da6a551642bdbaaf5ac9cc182 100644 (file)
@@ -39,7 +39,7 @@
 #include "lastlog2P.h"
 #include "strutils.h"
 
-/* Set the ll2 context/environment */
+/* Sets the ll2 context/environment. */
 /* Returns the context or NULL if an error has happened. */
 extern struct ll2_context * ll2_new_context(const char *db_path)
 {
@@ -61,7 +61,7 @@ extern struct ll2_context * ll2_new_context(const char *db_path)
        return context;
 }
 
-/* Release ll2 context/environment */
+/* Releases ll2 context/environment. */
 extern void ll2_unref_context(struct ll2_context *context)
 {
        if (context)
@@ -206,7 +206,8 @@ out_read_entry:
        return retval;
 }
 
-/* reads 1 entry from database and returns that. Returns 0 on success, -ENOMEM or -1 on other failure. */
+/* Reads one entry from database and returns that.
+   Returns 0 on success, -ENOMEM or -1 on other failure. */
 int
 ll2_read_entry(struct ll2_context *context, const char *user,
               int64_t *ll_time, char **tty, char **rhost,
@@ -225,7 +226,8 @@ ll2_read_entry(struct ll2_context *context, const char *user,
        return retval;
 }
 
-/* Write a new entry. Returns 0 on success, -ENOMEM or -1 on other failure. */
+/* Writes a new entry.
+   Returns 0 on success, -ENOMEM or -1 on other failure. */
 static int
 write_entry(sqlite3 *db, const char *user,
            int64_t ll_time, const char *tty, const char *rhost,
@@ -324,7 +326,8 @@ out_ll2_read_entry:
        return retval;
 }
 
-/* Write a new entry. Returns 0 on success, -ENOMEM or -1 on other failure. */
+/* Writes a new entry.
+   Returns 0 on success, -ENOMEM or -1 on other failure. */
 int
 ll2_write_entry(struct ll2_context *context, const char *user,
                int64_t ll_time, const char *tty, const char *rhost,
@@ -343,7 +346,7 @@ ll2_write_entry(struct ll2_context *context, const char *user,
        return retval;
 }
 
-/* Write a new entry with updated login time.
+/* Writes a new entry with updated login time.
    Returns 0 on success, -ENOMEM or -1 on other failure. */
 int
 ll2_update_login_time(struct ll2_context *context, const char *user,
@@ -409,7 +412,7 @@ ll2_read_all(struct ll2_context *context,
             char **error)
 {
        sqlite3 *db;
-       char *err_msg = 0;
+       char *err_msg = NULL;
        int retval = 0;
 
        if ((retval = open_database_ro(context, &db, error)) != 0)
@@ -431,7 +434,8 @@ ll2_read_all(struct ll2_context *context,
        return retval;
 }
 
-/* Remove an user entry. Returns 0 on success, -ENOMEM or -1 on other failure. */
+/* Removes a user entry.
+   Returns 0 on success, -ENOMEM or -1 on other failure. */
 static int
 remove_entry(sqlite3 *db, const char *user, char **error)
 {
@@ -480,7 +484,8 @@ out_remove_entry:
        return retval;
 }
 
-/* Remove an user entry. Returns 0 on success, -ENOMEM or -1 on other failure. */
+/* Removes a user entry.
+   Returns 0 on success, -ENOMEM or -1 on other failure. */
 int
 ll2_remove_entry(struct ll2_context *context, const char *user,
                 char **error)
@@ -498,7 +503,8 @@ ll2_remove_entry(struct ll2_context *context, const char *user,
        return retval;
 }
 
-/* Renames an user entry. Returns 0 on success, -ENOMEM or -1 on other failure. */
+/* Renames a user entry.
+   Returns 0 on success, -ENOMEM or -1 on other failure. */
 int
 ll2_rename_user(struct ll2_context *context, const char *user,
                const char *newname, char **error)
@@ -536,7 +542,7 @@ ll2_rename_user(struct ll2_context *context, const char *user,
        return retval;
 }
 
-/* Import old lastlog file.
+/* Imports old lastlog file.
    Returns 0 on success, -ENOMEM or -1 on other failure. */
 int
 ll2_import_lastlog(struct ll2_context *context, const char *lastlog_file,
index 99e322be338c4edbf204ad5bf635dea1c54f56cd..c34af24123b82fdf648cb6a45376eaf434660307 100644 (file)
@@ -12,7 +12,7 @@ This file may be copied under the terms of the GNU General Public License.
 
 == NAME
 
-lastlog2 - display date of last login for all users or a specific one
+lastlog2 - displays date of last login for all users or a specific one
 
 == SYNOPSIS