]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pam: minor coding style tweaks
authorLennart Poettering <lennart@poettering.net>
Thu, 16 Jan 2025 13:15:26 +0000 (14:15 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Jan 2025 08:58:26 +0000 (09:58 +0100)
src/home/pam_systemd_home.c
src/login/pam_systemd.c

index 624f1ced88507fe6238183ffdb0fe3979c181198..0d28e99ba2320453f8c61aa711cd91a510199628 100644 (file)
@@ -115,7 +115,6 @@ static int acquire_user_record(
                 r = pam_get_user(handle, &username, NULL);
                 if (r != PAM_SUCCESS)
                         return pam_syslog_pam_error(handle, LOG_ERR, r, "Failed to get user name: @PAMERR@");
-
                 if (isempty(username))
                         return pam_syslog_pam_error(handle, LOG_ERR, PAM_SERVICE_ERR, "User name not set.");
         }
@@ -535,7 +534,6 @@ static int acquire_home(
         r = pam_get_user(handle, &username, NULL);
         if (r != PAM_SUCCESS)
                 return pam_syslog_pam_error(handle, LOG_ERR, r, "Failed to get user name: @PAMERR@");
-
         if (isempty(username))
                 return pam_syslog_pam_error(handle, LOG_ERR, PAM_SERVICE_ERR, "User name not set.");
 
@@ -879,7 +877,6 @@ _public_ PAM_EXTERN int pam_sm_close_session(
         r = pam_get_user(handle, &username, NULL);
         if (r != PAM_SUCCESS)
                 return pam_syslog_pam_error(handle, LOG_ERR, r, "Failed to get user name: @PAMERR@");
-
         if (isempty(username))
                 return pam_syslog_pam_error(handle, LOG_ERR, PAM_SERVICE_ERR, "User name not set.");
 
@@ -949,7 +946,7 @@ _public_ PAM_EXTERN int pam_sm_acct_mgmt(
         if (r != PAM_SUCCESS)
                 return r;
 
-        r = acquire_user_record(handle, NULL, debug, &ur, NULL);
+        r = acquire_user_record(handle, /* username= */ NULL, debug, &ur, /* bus_data= */ NULL);
         if (r != PAM_SUCCESS)
                 return r;
 
@@ -1057,7 +1054,7 @@ _public_ PAM_EXTERN int pam_sm_chauthtok(
 
         pam_debug_syslog(handle, debug, "pam-systemd-homed account management");
 
-        r = acquire_user_record(handle, NULL, debug, &ur, NULL);
+        r = acquire_user_record(handle, /* username= */ NULL, debug, &ur, /* bus_data= */ NULL);
         if (r != PAM_SUCCESS)
                 return r;
 
index 893d03cdb62846066d2d827899524c0e19747023..9a0ec294f0dca579d594f10d8816c86bbbd3d578 100644 (file)
@@ -187,7 +187,6 @@ static int acquire_user_record(
         r = pam_get_user(handle, &username, NULL);
         if (r != PAM_SUCCESS)
                 return pam_syslog_pam_error(handle, LOG_ERR, r, "Failed to get user name: @PAMERR@");
-
         if (isempty(username))
                 return pam_syslog_pam_error(handle, LOG_ERR, PAM_SERVICE_ERR, "User name not valid.");
 
@@ -224,7 +223,7 @@ static int acquire_user_record(
                 _cleanup_free_ char *formatted = NULL;
 
                 /* Request the record ourselves */
-                r = userdb_by_name(username, 0, &ur);
+                r = userdb_by_name(username, /* flags= */ 0, &ur);
                 if (r < 0) {
                         pam_syslog_errno(handle, LOG_ERR, r, "Failed to get user record: %m");
                         return PAM_USER_UNKNOWN;
@@ -1468,12 +1467,12 @@ _public_ PAM_EXTERN int pam_sm_close_session(
 
         if (parse_argv(handle,
                        argc, argv,
-                       NULL,
-                       NULL,
-                       NULL,
+                       /* class= */ NULL,
+                       /* type= */ NULL,
+                       /* deskop= */ NULL,
                        &debug,
-                       NULL,
-                       NULL) < 0)
+                       /* default_capability_bounding_set */ NULL,
+                       /* default_capability_ambient_set= */ NULL) < 0)
                 return PAM_SESSION_ERR;
 
         pam_debug_syslog(handle, debug, "pam-systemd shutting down");