aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-03-15 08:29:22 +0000
committerEric Andersen <andersen@codepoet.org>2004-03-15 08:29:22 +0000
commitc7bda1ce659294d6e22c06e087f6f265983c7578 (patch)
tree4c6d2217f4d8306c59cf1096f8664e1cfd167213 /loginutils
parent8854004b41065b3d081af7f3df13a100b0c8bfbe (diff)
downloadbusybox-c7bda1ce659294d6e22c06e087f6f265983c7578.tar.gz
Remove trailing whitespace. Update copyright to include 2004.
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/Makefile2
-rw-r--r--loginutils/Makefile.in2
-rw-r--r--loginutils/addgroup.c4
-rw-r--r--loginutils/adduser.c4
-rw-r--r--loginutils/getty.c14
-rw-r--r--loginutils/login.c48
-rw-r--r--loginutils/su.c12
7 files changed, 43 insertions, 43 deletions
diff --git a/loginutils/Makefile b/loginutils/Makefile
index 3359d5638..a013d141f 100644
--- a/loginutils/Makefile
+++ b/loginutils/Makefile
@@ -1,6 +1,6 @@
# Makefile for busybox
#
-# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
+# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/loginutils/Makefile.in b/loginutils/Makefile.in
index 160051094..87c0a5c4e 100644
--- a/loginutils/Makefile.in
+++ b/loginutils/Makefile.in
@@ -1,6 +1,6 @@
# Makefile for busybox
#
-# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
+# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index af1cd7a83..cfbd71624 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -136,7 +136,7 @@ extern void if_i_am_not_root(void);
/*
* addgroup will take a login_name as its first parameter.
*
- * gid
+ * gid
*
* can be customized via command-line parameters.
* ________________________________________________________________________ */
@@ -157,7 +157,7 @@ int addgroup_main(int argc, char **argv)
} else {
bb_show_usage();
}
-
+
if (optind < argc) {
user = argv[optind];
optind++;
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index c4ab557d0..3e10fd398 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -77,7 +77,7 @@ static int passwd_study(const char *filename, struct passwd *p)
if ((p->pw_uid > max) || (p->pw_uid < min))
p->pw_uid = min;
- /* stuff to do:
+ /* stuff to do:
* make sure login isn't taken;
* find free uid and gid;
*/
@@ -246,7 +246,7 @@ void if_i_am_not_root(void)
*
* home
* shell
- * gecos
+ * gecos
*
* can be customized via command-line parameters.
* ________________________________________________________________________ */
diff --git a/loginutils/getty.c b/loginutils/getty.c
index b12b88fb1..0e475e4c0 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -5,13 +5,13 @@
be here. Now read the real man-page agetty.8 instead.
-f option added by Eric Rasmussen <ear@usfirst.org> - 12/28/95
-
+
1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
- added Native Language Support
1999-05-05 Thorsten Kranzkowski <dl8bcu@gmx.net>
- enable hardware flow control before displaying /etc/issue
-
+
*/
#include <stdio.h>
@@ -54,11 +54,11 @@ extern void updwtmp(const char *filename, const struct utmp *ut);
/*
* Things you may want to modify.
- *
+ *
* If ISSUE is not defined, agetty will never display the contents of the
* /etc/issue file. You will not want to spit out large "issue" files at the
* wrong baud rate. Relevant for System V only.
- *
+ *
* You may disagree with the default line-editing etc. characters defined
* below. Note, however, that DEL cannot be used for interrupt generation
* and for line editing at the same time.
@@ -386,7 +386,7 @@ static void parse_args(int argc, char **argv, struct options *op)
case 'I':
if (!(op->initstring = strdup(optarg)))
error(bb_msg_memory_exhausted);
-
+
{
const char *p;
char *q;
@@ -700,9 +700,9 @@ static void auto_baud(struct termio *tp)
* the DCD line, and if the computer is fast enough to set the proper
* baud rate before the message has gone by. We expect a message of the
* following format:
- *
+ *
* <junk><number><junk>
- *
+ *
* The number is interpreted as the baud rate of the incoming call. If the
* modem does not tell us the baud rate within one second, we will keep
* using the current baud rate. It is advisable to enable BREAK
diff --git a/loginutils/login.c b/loginutils/login.c
index ee50a175a..99f66b53b 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -77,7 +77,7 @@ extern int login_main(int argc, char **argv)
int opt_preserve = 0;
int opt_fflag = 0;
char *opt_host = 0;
- int alarmstarted = 0;
+ int alarmstarted = 0;
#ifdef CONFIG_SELINUX
int flask_enabled = is_flask_enabled();
security_id_t sid = 0, old_tty_sid, new_tty_sid;
@@ -88,7 +88,7 @@ extern int login_main(int argc, char **argv)
signal ( SIGALRM, alarm_handler );
alarm ( TIMEOUT );
alarmstarted = 1;
-
+
while (( flag = getopt(argc, argv, "f:h:p")) != EOF ) {
switch ( flag ) {
case 'p':
@@ -104,7 +104,7 @@ extern int login_main(int argc, char **argv)
if ( !amroot ) /* Auth bypass only if real UID is zero */
bb_error_msg_and_die ( "-f permission denied" );
-
+
safe_strncpy(username, optarg, USERNAME_SIZE);
opt_fflag = 1;
break;
@@ -119,7 +119,7 @@ extern int login_main(int argc, char **argv)
if (optind < argc) // user from command line (getty)
safe_strncpy(username, argv[optind], USERNAME_SIZE);
- if ( !isatty ( 0 ) || !isatty ( 1 ) || !isatty ( 2 ))
+ if ( !isatty ( 0 ) || !isatty ( 1 ) || !isatty ( 2 ))
return EXIT_FAILURE; /* Must be a terminal */
#ifdef CONFIG_FEATURE_U_W_TMP
@@ -136,7 +136,7 @@ extern int login_main(int argc, char **argv)
if ( amroot )
memset ( utent.ut_host, 0, sizeof utent.ut_host );
#endif
-
+
if ( opt_host ) {
#ifdef CONFIG_FEATURE_U_W_TMP
safe_strncpy ( utent.ut_host, opt_host, sizeof( utent. ut_host ));
@@ -145,7 +145,7 @@ extern int login_main(int argc, char **argv)
}
else
snprintf ( fromhost, sizeof( fromhost ) - 1, " on `%.100s'", tty );
-
+
setpgrp();
openlog ( "login", LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH );
@@ -167,14 +167,14 @@ extern int login_main(int argc, char **argv)
pw_copy.pw_passwd = "!";
opt_fflag = 0;
failed = 1;
- } else
+ } else
pw_copy = *pw;
pw = &pw_copy;
if (( pw-> pw_passwd [0] == '!' ) || ( pw-> pw_passwd[0] == '*' ))
failed = 1;
-
+
if ( opt_fflag ) {
opt_fflag = 0;
goto auth_ok;
@@ -192,14 +192,14 @@ extern int login_main(int argc, char **argv)
goto auth_ok;
failed = 1;
-
+
auth_ok:
- if ( !failed)
+ if ( !failed)
break;
{ // delay next try
time_t start, now;
-
+
time ( &start );
now = start;
while ( difftime ( now, start ) < FAIL_DELAY) {
@@ -215,7 +215,7 @@ auth_ok:
return EXIT_FAILURE;
}
}
-
+
alarm ( 0 );
if ( check_nologin ( pw-> pw_uid == 0 ))
return EXIT_FAILURE;
@@ -253,15 +253,15 @@ auth_ok:
sid = 0;
#endif
- if ( *tty != '/' )
+ if ( *tty != '/' )
snprintf ( full_tty, sizeof( full_tty ) - 1, "/dev/%s", tty);
else
safe_strncpy ( full_tty, tty, sizeof( full_tty ) - 1 );
-
- if ( !is_my_tty ( full_tty ))
+
+ if ( !is_my_tty ( full_tty ))
syslog ( LOG_ERR, "unable to determine TTY name, got %s\n", full_tty );
-
- /* Try these, but don't complain if they fail
+
+ /* Try these, but don't complain if they fail
* (for example when the root fs is read only) */
chown ( full_tty, pw-> pw_uid, pw-> pw_gid );
chmod ( full_tty, 0600 );
@@ -275,14 +275,14 @@ auth_ok:
motd ( );
signal ( SIGALRM, SIG_DFL ); /* default alarm signal */
- if ( pw-> pw_uid == 0 )
+ if ( pw-> pw_uid == 0 )
syslog ( LOG_INFO, "root login %s\n", fromhost );
run_shell ( tmp, 1, 0, 0
#ifdef CONFIG_SELINUX
, sid
#endif
); /* exec the shell finally. */
-
+
return EXIT_FAILURE;
}
@@ -306,7 +306,7 @@ static int login_prompt ( char *buf_name )
for ( sp = buf; isspace ( *sp ); sp++ ) { }
for ( ep = sp; isgraph ( *ep ); ep++ ) { }
- *ep = 0;
+ *ep = 0;
safe_strncpy(buf_name, sp, USERNAME_SIZE);
if(buf_name[0])
return 1;
@@ -332,7 +332,7 @@ static int check_nologin ( int amroot )
}
if ( !amroot )
return 1;
-
+
puts ( "\r\n[Disconnect bypassed -- root login allowed.]\r" );
}
return 0;
@@ -377,7 +377,7 @@ static int is_my_tty ( const char *tty )
if ( stat ( tty, &by_name ) || fstat ( 0, &by_fd ))
return 0;
-
+
if ( by_name. st_rdev != by_fd. st_rdev )
return 0;
else
@@ -391,8 +391,8 @@ static void motd ( )
register int c;
if (( fp = fopen ( bb_path_motd_file, "r" ))) {
- while (( c = getc ( fp )) != EOF )
- putchar ( c );
+ while (( c = getc ( fp )) != EOF )
+ putchar ( c );
fclose ( fp );
}
}
diff --git a/loginutils/su.c b/loginutils/su.c
index 2d7a7ac05..ec0c16c7d 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -84,12 +84,12 @@ int su_main ( int argc, char **argv )
}
/* get user if specified */
- if ( optind < argc )
+ if ( optind < argc )
opt_username = argv [optind++];
if ( optind < argc )
opt_args = argv + optind;
-
+
#if defined( SYSLOG_SUCCESS ) || defined( SYSLOG_FAILURE )
#ifdef CONFIG_FEATURE_U_W_TMP
/* The utmp entry (via getlogin) is probably the best way to identify
@@ -108,11 +108,11 @@ int su_main ( int argc, char **argv )
openlog ( bb_applet_name, 0, LOG_AUTH );
#endif
-
+
pw = getpwnam ( opt_username );
if ( !pw )
bb_error_msg_and_die ( "user %s does not exist", opt_username );
-
+
/* Make sure pw->pw_shell is non-NULL. It may be NULL when NEW_USER
is a username that is retrieved via NIS (YP), but that doesn't have
a default shell listed. */
@@ -145,13 +145,13 @@ int su_main ( int argc, char **argv )
if ( !opt_shell )
opt_shell = pw->pw_shell;
- change_identity ( pw );
+ change_identity ( pw );
setup_environment ( opt_shell, opt_loginshell, !opt_preserve, pw );
run_shell ( opt_shell, opt_loginshell, opt_command, (const char**)opt_args
#ifdef CONFIG_SELINUX
, 0
#endif
);
-
+
return EXIT_FAILURE;
}