aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/adduser.c2
-rw-r--r--loginutils/chpasswd.c2
-rw-r--r--loginutils/cryptpw.c2
-rw-r--r--loginutils/getty.c12
-rw-r--r--loginutils/login.c7
-rw-r--r--loginutils/passwd.c2
-rw-r--r--loginutils/sulogin.c2
-rw-r--r--loginutils/vlock.c6
8 files changed, 18 insertions, 17 deletions
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index 7b5283e99..d409eabb9 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -85,7 +85,7 @@ static const char adduser_longopts[] ALIGN1 =
85 * can be customized via command-line parameters. 85 * can be customized via command-line parameters.
86 */ 86 */
87int adduser_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 87int adduser_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
88int adduser_main(int argc, char **argv) 88int adduser_main(int argc ATTRIBUTE_UNUSED, char **argv)
89{ 89{
90 struct passwd pw; 90 struct passwd pw;
91 const char *usegroup = NULL; 91 const char *usegroup = NULL;
diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c
index 7d47899fe..83e5e0c1f 100644
--- a/loginutils/chpasswd.c
+++ b/loginutils/chpasswd.c
@@ -21,7 +21,7 @@ static const char chpasswd_longopts[] ALIGN1 =
21#define OPT_MD5 2 21#define OPT_MD5 2
22 22
23int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 23int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
24int chpasswd_main(int argc, char **argv) 24int chpasswd_main(int argc ATTRIBUTE_UNUSED, char **argv)
25{ 25{
26 char *name, *pass; 26 char *name, *pass;
27 char salt[sizeof("$N$XXXXXXXX")]; 27 char salt[sizeof("$N$XXXXXXXX")];
diff --git a/loginutils/cryptpw.c b/loginutils/cryptpw.c
index 06817a681..c5170c6a4 100644
--- a/loginutils/cryptpw.c
+++ b/loginutils/cryptpw.c
@@ -8,7 +8,7 @@
8#include "libbb.h" 8#include "libbb.h"
9 9
10int cryptpw_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 10int cryptpw_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
11int cryptpw_main(int argc, char **argv) 11int cryptpw_main(int argc ATTRIBUTE_UNUSED, char **argv)
12{ 12{
13 char salt[sizeof("$N$XXXXXXXX")]; 13 char salt[sizeof("$N$XXXXXXXX")];
14 14
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 246bb4711..c8c54e3b9 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -367,7 +367,7 @@ static void auto_baud(char *buf, unsigned size_buf, struct termios *tp)
367} 367}
368 368
369/* do_prompt - show login prompt, optionally preceded by /etc/issue contents */ 369/* do_prompt - show login prompt, optionally preceded by /etc/issue contents */
370static void do_prompt(struct options *op, struct termios *tp) 370static void do_prompt(struct options *op)
371{ 371{
372#ifdef ISSUE 372#ifdef ISSUE
373 print_login_issue(op->issue, op->tty); 373 print_login_issue(op->issue, op->tty);
@@ -390,7 +390,7 @@ static int all_is_upcase(const char *s)
390/* get_logname - get user name, establish parity, speed, erase, kill, eol; 390/* get_logname - get user name, establish parity, speed, erase, kill, eol;
391 * return NULL on BREAK, logname on success */ 391 * return NULL on BREAK, logname on success */
392static char *get_logname(char *logname, unsigned size_logname, 392static char *get_logname(char *logname, unsigned size_logname,
393 struct options *op, struct chardata *cp, struct termios *tp) 393 struct options *op, struct chardata *cp)
394{ 394{
395 char *bp; 395 char *bp;
396 char c; /* input character, full eight bits */ 396 char c; /* input character, full eight bits */
@@ -414,7 +414,7 @@ static char *get_logname(char *logname, unsigned size_logname,
414 logname[0] = '\0'; 414 logname[0] = '\0';
415 while (!logname[0]) { 415 while (!logname[0]) {
416 /* Write issue file and prompt, with "parity" bit == 0. */ 416 /* Write issue file and prompt, with "parity" bit == 0. */
417 do_prompt(op, tp); 417 do_prompt(op);
418 418
419 /* Read name, watch for break, parity, erase, kill, end-of-line. */ 419 /* Read name, watch for break, parity, erase, kill, end-of-line. */
420 bp = logname; 420 bp = logname;
@@ -621,7 +621,7 @@ static void update_utmp(const char *line, char *fakehost)
621#endif /* CONFIG_FEATURE_UTMP */ 621#endif /* CONFIG_FEATURE_UTMP */
622 622
623int getty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 623int getty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
624int getty_main(int argc, char **argv) 624int getty_main(int argc ATTRIBUTE_UNUSED, char **argv)
625{ 625{
626 int n; 626 int n;
627 char *fakehost = NULL; /* Fake hostname for ut_host */ 627 char *fakehost = NULL; /* Fake hostname for ut_host */
@@ -670,7 +670,7 @@ int getty_main(int argc, char **argv)
670 670
671#ifdef DEBUGGING 671#ifdef DEBUGGING
672 dbf = xfopen(DEBUGTERM, "w"); 672 dbf = xfopen(DEBUGTERM, "w");
673 for (n = 1; n < argc; n++) { 673 for (n = 1; argv[n]; n++) {
674 debug(argv[n]); 674 debug(argv[n]);
675 debug("\n"); 675 debug("\n");
676 } 676 }
@@ -750,7 +750,7 @@ int getty_main(int argc, char **argv)
750 /* Read the login name. */ 750 /* Read the login name. */
751 debug("reading login name\n"); 751 debug("reading login name\n");
752 logname = get_logname(line_buf, sizeof(line_buf), 752 logname = get_logname(line_buf, sizeof(line_buf),
753 &options, &chardata, &termios); 753 &options, &chardata);
754 if (logname) 754 if (logname)
755 break; 755 break;
756 /* we are here only if options.numspeed > 1 */ 756 /* we are here only if options.numspeed > 1 */
diff --git a/loginutils/login.c b/loginutils/login.c
index a3caa0fca..79e7494bf 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -114,7 +114,7 @@ static void write_utent(struct utmp *utptr, const char *username)
114#endif /* !ENABLE_FEATURE_UTMP */ 114#endif /* !ENABLE_FEATURE_UTMP */
115 115
116#if ENABLE_FEATURE_NOLOGIN 116#if ENABLE_FEATURE_NOLOGIN
117static void die_if_nologin_and_non_root(int amroot) 117static void die_if_nologin(void)
118{ 118{
119 FILE *fp; 119 FILE *fp;
120 int c; 120 int c;
@@ -135,7 +135,7 @@ static void die_if_nologin_and_non_root(int amroot)
135 puts("\r\n[Disconnect bypassed -- root login allowed]\r"); 135 puts("\r\n[Disconnect bypassed -- root login allowed]\r");
136} 136}
137#else 137#else
138static ALWAYS_INLINE void die_if_nologin_and_non_root(int amroot) {} 138static ALWAYS_INLINE void die_if_nologin(void) {}
139#endif 139#endif
140 140
141#if ENABLE_FEATURE_SECURETTY && !ENABLE_PAM 141#if ENABLE_FEATURE_SECURETTY && !ENABLE_PAM
@@ -406,7 +406,8 @@ int login_main(int argc, char **argv)
406 } 406 }
407 407
408 alarm(0); 408 alarm(0);
409 die_if_nologin_and_non_root(pw->pw_uid == 0); 409 if (!amroot)
410 die_if_nologin();
410 411
411 write_utent(&utent, username); 412 write_utent(&utent, username);
412 413
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index 2f85e9f21..3353db1fa 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -70,7 +70,7 @@ static char* new_password(const struct passwd *pw, uid_t myuid, int algo)
70} 70}
71 71
72int passwd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 72int passwd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
73int passwd_main(int argc, char **argv) 73int passwd_main(int argc ATTRIBUTE_UNUSED, char **argv)
74{ 74{
75 enum { 75 enum {
76 OPT_algo = 0x1, /* -a - password algorithm */ 76 OPT_algo = 0x1, /* -a - password algorithm */
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 3a1a8e9f5..caa1a8335 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -15,7 +15,7 @@
15 15
16 16
17int sulogin_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 17int sulogin_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
18int sulogin_main(int argc, char **argv) 18int sulogin_main(int argc ATTRIBUTE_UNUSED, char **argv)
19{ 19{
20 char *cp; 20 char *cp;
21 int timeout = 0; 21 int timeout = 0;
diff --git a/loginutils/vlock.c b/loginutils/vlock.c
index ff60d78ff..96c1f679a 100644
--- a/loginutils/vlock.c
+++ b/loginutils/vlock.c
@@ -18,21 +18,21 @@
18#include <sys/vt.h> 18#include <sys/vt.h>
19#include "libbb.h" 19#include "libbb.h"
20 20
21static void release_vt(int signo) 21static void release_vt(int signo ATTRIBUTE_UNUSED)
22{ 22{
23 /* If -a, param is 0, which means: 23 /* If -a, param is 0, which means:
24 * "no, kernel, we don't allow console switch away from us!" */ 24 * "no, kernel, we don't allow console switch away from us!" */
25 ioctl(STDIN_FILENO, VT_RELDISP, (unsigned long) !option_mask32); 25 ioctl(STDIN_FILENO, VT_RELDISP, (unsigned long) !option_mask32);
26} 26}
27 27
28static void acquire_vt(int signo) 28static void acquire_vt(int signo ATTRIBUTE_UNUSED)
29{ 29{
30 /* ACK to kernel that switch to console is successful */ 30 /* ACK to kernel that switch to console is successful */
31 ioctl(STDIN_FILENO, VT_RELDISP, VT_ACKACQ); 31 ioctl(STDIN_FILENO, VT_RELDISP, VT_ACKACQ);
32} 32}
33 33
34int vlock_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 34int vlock_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
35int vlock_main(int argc, char **argv) 35int vlock_main(int argc ATTRIBUTE_UNUSED, char **argv)
36{ 36{
37 struct vt_mode vtm; 37 struct vt_mode vtm;
38 struct termios term; 38 struct termios term;