git: a9ea647c29cf - main - pw: Rename some enums.

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Mon, 06 May 2024 16:19:20 UTC
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=a9ea647c29cf510a164947251de0d34f53f2bca0

commit a9ea647c29cf510a164947251de0d34f53f2bca0
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-05-06 16:18:39 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-05-06 16:18:39 +0000

    pw: Rename some enums.
    
    Rename `M_PRINT` and `M_UPDATE` to `M_SHOW` and `M_MODIFY` to match the
    names of the commands they represent.  No functional change intended.
    
    MFC after:      3 days
    Reviewed by:    allanjude
    Differential Revision:  https://reviews.freebsd.org/D45096
---
 usr.sbin/pw/pw.h       | 20 ++++++++++----------
 usr.sbin/pw/pw_group.c |  4 ++--
 usr.sbin/pw/pw_user.c  |  6 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/usr.sbin/pw/pw.h b/usr.sbin/pw/pw.h
index 5de333ce5e71..e8ec95079fec 100644
--- a/usr.sbin/pw/pw.h
+++ b/usr.sbin/pw/pw.h
@@ -36,14 +36,14 @@
 
 enum _mode
 {
-        M_ADD,
-        M_DELETE,
-        M_UPDATE,
-        M_PRINT,
+	M_ADD,
+	M_DELETE,
+	M_MODIFY,
+	M_SHOW,
 	M_NEXT,
 	M_LOCK,
 	M_UNLOCK,
-        M_NUM
+	M_NUM
 };
 
 enum _passmode
@@ -56,13 +56,13 @@ enum _passmode
 
 enum _which
 {
-        W_USER,
-        W_GROUP,
-        W_NUM
+	W_USER,
+	W_GROUP,
+	W_NUM
 };
 
-#define	_DEF_DIRMODE	(S_IRWXU | S_IRWXG | S_IRWXO)
-#define	_PW_CONF	"pw.conf"
+#define _DEF_DIRMODE	(S_IRWXU | S_IRWXG | S_IRWXO)
+#define _PW_CONF	"pw.conf"
 #define _UC_MAXLINE	1024
 #define _UC_MAXSHELLS	32
 
diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c
index 32dec769fb1a..b2777177b9e6 100644
--- a/usr.sbin/pw/pw_group.c
+++ b/usr.sbin/pw/pw_group.c
@@ -697,11 +697,11 @@ pw_group_mod(int argc, char **argv, char *arg1)
 	if ((grp = GETGRNAM(name)) == NULL)
 		errx(EX_SOFTWARE, "group disappeared during update");
 
-	pw_log(cnf, M_UPDATE, W_GROUP, "%s(%ju)", grp->gr_name,
+	pw_log(cnf, M_MODIFY, W_GROUP, "%s(%ju)", grp->gr_name,
 	    (uintmax_t)grp->gr_gid);
 
 	if (nis && nis_update() == 0)
-		pw_log(cnf, M_UPDATE, W_GROUP, "NIS maps updated");
+		pw_log(cnf, M_MODIFY, W_GROUP, "NIS maps updated");
 
 	return (EXIT_SUCCESS);
 }
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index 6875d931a1d2..66f021fff983 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -146,7 +146,7 @@ create_and_populate_homedir(struct userconf *cnf, struct passwd *pwd,
 
 	copymkdir(conf.rootfd, pwd->pw_dir, skelfd, homemode, pwd->pw_uid,
 	    pwd->pw_gid, 0);
-	pw_log(cnf, update ? M_UPDATE : M_ADD, W_USER, "%s(%ju) home %s made",
+	pw_log(cnf, update ? M_MODIFY : M_ADD, W_USER, "%s(%ju) home %s made",
 	    pwd->pw_name, (uintmax_t)pwd->pw_uid, pwd->pw_dir);
 }
 
@@ -1787,7 +1787,7 @@ pw_user_mod(int argc, char **argv, char *arg1)
 	if (pwd == NULL)
 		errx(EX_NOUSER, "user '%s' disappeared during update", name);
 	grp = GETGRGID(pwd->pw_gid);
-	pw_log(cnf, M_UPDATE, W_USER, "%s(%ju):%s(%ju):%s:%s:%s",
+	pw_log(cnf, M_MODIFY, W_USER, "%s(%ju):%s(%ju):%s:%s:%s",
 	    pwd->pw_name, (uintmax_t)pwd->pw_uid,
 	    grp ? grp->gr_name : "unknown",
 	    (uintmax_t)(grp ? grp->gr_gid : (uid_t)-1),
@@ -1808,7 +1808,7 @@ pw_user_mod(int argc, char **argv, char *arg1)
 	}
 
 	if (nis && nis_update() == 0)
-		pw_log(cnf, M_UPDATE, W_USER, "NIS maps updated");
+		pw_log(cnf, M_MODIFY, W_USER, "NIS maps updated");
 
 	return (EXIT_SUCCESS);
 }