]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
login: cleanup begin of the login.c file
authorKarel Zak <kzak@redhat.com>
Thu, 25 Aug 2011 10:09:38 +0000 (12:09 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 26 Oct 2011 21:17:15 +0000 (23:17 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/login.c

index 8ef12af9a581964d8441599448701f8203f26af3..1bbcddde5b98bf4147b8633259000d4bf1914965 100644 (file)
@@ -49,6 +49,7 @@
 #include <sys/sysmacros.h>
 #include <linux/major.h>
 #include <netdb.h>
+#include <lastlog.h>
 #include <security/pam_appl.h>
 #include <security/pam_misc.h>
 #ifdef HAVE_LIBAUDIT
 #include <crypt.h>
 #endif
 
+#include "c.h"
+#include "setproctitle.h"
 #include "pathnames.h"
 #include "login.h"
 #include "strutils.h"
 #include "nls.h"
 #include "xalloc.h"
-#include "c.h"
 
 #define PAM_MAX_LOGIN_TRIES    3
 #define is_pam_failure(_rc)    ((_rc) != PAM_SUCCESS)
 
-#include <lastlog.h>
-
 #define SLEEP_EXIT_TIMEOUT 5
 
-#include "setproctitle.h"
-
-#ifndef HAVE_SECURITY_PAM_MISC_H
-static void getloginname (void);
-static void checknologin (void);
-static int rootterm (char *ttyn);
-#endif
-static void timedout (int);
-static void sigint (int);
-static void motd (void);
-static void dolastlog (int quiet);
-
 #ifdef USE_TTY_GROUP
 #  define TTY_MODE 0620
 #else
@@ -100,12 +88,12 @@ static void dolastlog (int quiet);
  * This bounds the time given to login.  Not a define so it can
  * be patched on machines where it's too small.
  */
-int     timeout = 60;
+int timeout = 60;
 
 struct passwd *pwd;
 
 static struct passwd pwdcopy;
-char    hostaddress[16];       /* used in checktty.c */
+char hostaddress[16];  /* used in checktty.c */
 sa_family_t hostfamily;                /* used in checktty.c */
 char   *hostname;              /* idem */
 static char    *username, *tty_name, *tty_number;
@@ -113,6 +101,11 @@ static char        thishost[100];
 static int     failures = 1;
 static pid_t   pid;
 
+static void timedout (int);
+static void sigint (int);
+static void motd (void);
+static void dolastlog (int quiet);
+
 /* Nice and simple code provided by Linus Torvalds 16-Feb-93 */
 /* Nonblocking stuff by Maciej W. Rozycki, macro@ds2.pg.gda.pl, 1999.
    He writes: "Login performs open() on a tty in a blocking mode.