From: Iker Pedrosa Date: Thu, 13 Jul 2023 13:25:03 +0000 (+0200) Subject: usermod: conditionally build lastlog functionality X-Git-Tag: 4.14.0-rc1~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03251ffbc099286b56df1a9fc8dd3bb054bf7015;p=thirdparty%2Fshadow.git usermod: conditionally build lastlog functionality Resolves: https://github.com/shadow-maint/shadow/issues/674 Signed-off-by: Iker Pedrosa --- diff --git a/src/usermod.c b/src/usermod.c index f198f2db1..bf01881ac 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -17,7 +17,9 @@ #include #include #include +#ifdef ENABLE_LASTLOG #include +#endif /* ENABLE_LASTLOG */ #include #ifdef ACCT_TOOLS_SETUID #ifdef USE_PAM @@ -182,7 +184,9 @@ static void close_files (void); static void open_files (void); static void usr_update (void); static void move_home (void); +#ifdef ENABLE_LASTLOG static void update_lastlog (void); +#endif /* ENABLE_LASTLOG */ static void update_faillog (void); #ifndef NO_MOVE_MAILBOX @@ -1905,6 +1909,7 @@ static void move_home (void) * left alone in case the UID was shared. It doesn't hurt anything * to just leave it be. */ +#ifdef ENABLE_LASTLOG static void update_lastlog (void) { struct lastlog ll; @@ -1963,6 +1968,7 @@ static void update_lastlog (void) (void) close (fd); } +#endif /* ENABLE_LASTLOG */ /* * update_faillog - update the faillog file @@ -2360,7 +2366,9 @@ int main (int argc, char **argv) #endif /* NO_MOVE_MAILBOX */ if (uflg) { +#ifdef ENABLE_LASTLOG update_lastlog (); +#endif /* ENABLE_LASTLOG */ update_faillog (); }