aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2003-03-19 09:13:01 +0000
committerManuel Novoa III <mjn3@codepoet.org>2003-03-19 09:13:01 +0000
commitcad5364599eb5062d59e0c397ed638ddd61a8d5d (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /loginutils
parente01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff)
downloadbusybox-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz
Major coreutils update.
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/addgroup.c23
-rw-r--r--loginutils/adduser.c38
-rw-r--r--loginutils/deluser.c38
-rw-r--r--loginutils/getty.c23
-rw-r--r--loginutils/login.c16
-rw-r--r--loginutils/passwd.c26
-rw-r--r--loginutils/su.c14
-rw-r--r--loginutils/sulogin.c6
-rw-r--r--loginutils/vlock.c15
9 files changed, 105 insertions, 94 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index 1d754af8e..2e8188dec 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -54,16 +54,16 @@ static int group_study(const char *filename, struct group *g)
struct group *grp;
const int max = 65000;
- etc_group = xfopen(filename, "r");
+ etc_group = bb_xfopen(filename, "r");
/* make sure gr_name isn't taken, make sure gid is kosher */
desired = g->gr_gid;
while ((grp = fgetgrent(etc_group))) {
if ((strcmp(grp->gr_name, g->gr_name)) == 0) {
- error_msg_and_die("%s: group already in use\n", g->gr_name);
+ bb_error_msg_and_die("%s: group already in use\n", g->gr_name);
}
if ((desired) && grp->gr_gid == desired) {
- error_msg_and_die("%d: gid has already been allocated\n",
+ bb_error_msg_and_die("%d: gid has already been allocated\n",
desired);
}
if ((grp->gr_gid > g->gr_gid) && (grp->gr_gid < max)) {
@@ -89,7 +89,6 @@ static int addgroup(const char *filename, char *group, gid_t gid, const char *us
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
FILE *etc_gshadow;
- const char *gshadow = gshadow_file;
#endif
struct group gr;
@@ -104,7 +103,7 @@ static int addgroup(const char *filename, char *group, gid_t gid, const char *us
return 1;
/* add entry to group */
- etc_group = xfopen(filename, "a");
+ etc_group = bb_xfopen(filename, "a");
fprintf(etc_group, entryfmt, group, default_passwd, gr.gr_gid, user);
fclose(etc_group);
@@ -112,8 +111,8 @@ static int addgroup(const char *filename, char *group, gid_t gid, const char *us
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
/* add entry to gshadow if necessary */
- if (access(gshadow, F_OK|W_OK) == 0) {
- etc_gshadow = xfopen(gshadow, "a");
+ if (access(bb_path_gshadow_file, F_OK|W_OK) == 0) {
+ etc_gshadow = bb_xfopen(bb_path_gshadow_file, "a");
fprintf(etc_gshadow, "%s:!::\n", group);
fclose(etc_gshadow);
}
@@ -144,7 +143,7 @@ int addgroup_main(int argc, char **argv)
gid = strtol(optarg, NULL, 10);
break;
default:
- show_usage();
+ bb_show_usage();
break;
}
}
@@ -153,7 +152,7 @@ int addgroup_main(int argc, char **argv)
group = argv[optind];
optind++;
} else {
- show_usage();
+ bb_show_usage();
}
if (optind < argc) {
@@ -164,12 +163,12 @@ int addgroup_main(int argc, char **argv)
}
if (geteuid() != 0) {
- error_msg_and_die
+ bb_error_msg_and_die
("Only root may add a group to the system.");
}
/* werk */
- return addgroup(group_file, group, gid, user);
+ return addgroup(bb_path_group_file, group, gid, user);
}
-/* $Id: addgroup.c,v 1.9 2003/01/09 18:53:53 andersen Exp $ */
+/* $Id: addgroup.c,v 1.10 2003/03/19 09:12:20 mjn3 Exp $ */
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index 3485611cc..cfaf860e0 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -66,7 +66,7 @@ static int passwd_study(const char *filename, struct passwd *p)
const int min = 500;
const int max = 65000;
- passwd = wfopen(filename, "r");
+ passwd = bb_wfopen(filename, "r");
if (!passwd)
return 4;
@@ -112,7 +112,7 @@ static void addgroup_wrapper(const char *login, gid_t gid)
{
char *cmd;
- bb_asprintf(&cmd, "addgroup -g %d %s", gid, login);
+ bb_xasprintf(&cmd, "addgroup -g %d %s", gid, login);
system(cmd);
free(cmd);
}
@@ -123,7 +123,7 @@ static void passwd_wrapper(const char *login)
{
static const char prog[] = "passwd";
execlp(prog, prog, login, NULL);
- error_msg_and_die("Failed to execute '%s', you must set the password for '%s' manually", prog, login);
+ bb_error_msg_and_die("Failed to execute '%s', you must set the password for '%s' manually", prog, login);
}
/* putpwent(3) remix */
@@ -137,7 +137,7 @@ static int adduser(const char *filename, struct passwd *p)
#endif
/* make sure everything is kosher and setup uid && gid */
- passwd = wfopen(filename, "a");
+ passwd = bb_wfopen(filename, "a");
if (passwd == NULL) {
return 1;
}
@@ -147,13 +147,13 @@ static int adduser(const char *filename, struct passwd *p)
r = passwd_study(filename, p);
if (r) {
if (r == 1)
- error_msg("%s: login already in use", p->pw_name);
+ bb_error_msg("%s: login already in use", p->pw_name);
else if (r == 2)
- error_msg("illegal uid or no uids left");
+ bb_error_msg("illegal uid or no uids left");
else if (r == 3)
- error_msg("group name %s already in use", p->pw_name);
+ bb_error_msg("group name %s already in use", p->pw_name);
else
- error_msg("generic error.");
+ bb_error_msg("generic error.");
return 1;
}
@@ -166,7 +166,7 @@ static int adduser(const char *filename, struct passwd *p)
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
/* add to shadow if necessary */
if (shadow_enabled) {
- shadow = wfopen(shadow_file, "a");
+ shadow = bb_wfopen(bb_path_shadow_file, "a");
if (shadow == NULL) {
return 1;
}
@@ -191,16 +191,16 @@ static int adduser(const char *filename, struct passwd *p)
/* mkdir */
if (mkdir(p->pw_dir, 0755)) {
- perror_msg("%s", p->pw_dir);
+ bb_perror_msg("%s", p->pw_dir);
}
/* Set the owner and group so it is owned by the new user. */
if (chown(p->pw_dir, p->pw_uid, p->pw_gid)) {
- perror_msg("%s", p->pw_dir);
+ bb_perror_msg("%s", p->pw_dir);
}
/* Now fix up the permissions to 2755. Can't do it before now
* since chown will clear the setgid bit */
if (chmod(p->pw_dir, 02755)) {
- perror_msg("%s", p->pw_dir);
+ bb_perror_msg("%s", p->pw_dir);
}
/* interactively set passwd */
passwd_wrapper(p->pw_name);
@@ -234,7 +234,7 @@ int adduser_main(int argc, char **argv)
/* init */
if (argc < 2) {
- show_usage();
+ bb_show_usage();
}
gecos = default_gecos;
shell = default_shell;
@@ -252,18 +252,18 @@ int adduser_main(int argc, char **argv)
shell = optarg;
break;
default:
- show_usage ();
+ bb_show_usage();
break;
}
/* got root? */
if (i_am_not_root()) {
- error_msg_and_die( "Only root may add a user or group to the system.");
+ bb_error_msg_and_die( "Only root may add a user or group to the system.");
}
/* get login */
if (optind >= argc) {
- error_msg_and_die( "no user specified");
+ bb_error_msg_and_die( "no user specified");
}
login = argv[optind];
@@ -273,7 +273,7 @@ int adduser_main(int argc, char **argv)
}
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
/* is /etc/shadow in use? */
- shadow_enabled = (0 == access(shadow_file, F_OK));
+ shadow_enabled = (0 == access(bb_path_shadow_file, F_OK));
#endif
/* create a passwd struct */
@@ -286,7 +286,7 @@ int adduser_main(int argc, char **argv)
pw.pw_shell = (char *)shell;
/* grand finale */
- return adduser(passwd_file, &pw);
+ return adduser(bb_path_passwd_file, &pw);
}
-/* $Id: adduser.c,v 1.4 2002/09/16 06:22:24 andersen Exp $ */
+/* $Id: adduser.c,v 1.5 2003/03/19 09:12:20 mjn3 Exp $ */
diff --git a/loginutils/deluser.c b/loginutils/deluser.c
index c7d6ece64..ad62d41e0 100644
--- a/loginutils/deluser.c
+++ b/loginutils/deluser.c
@@ -116,19 +116,19 @@ int delgroup_main(int argc, char **argv)
int failure;
if (argc != 2) {
- show_usage();
+ bb_show_usage();
} else {
- failure = del_line_matching(argv[1], group_file);
+ failure = del_line_matching(argv[1], bb_path_group_file);
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
- if (access(gshadow_file, W_OK) == 0) {
+ if (access(bb_path_gshadow_file, W_OK) == 0) {
/* EDR the |= works if the error is not 0, so he had it wrong */
- failure |= del_line_matching(argv[1], gshadow_file);
+ failure |= del_line_matching(argv[1], bb_path_gshadow_file);
}
#endif /* CONFIG_FEATURE_SHADOWPASSWDS */
/* if (!successful) { */
if (failure) {
- error_msg_and_die("%s: Group could not be removed\n", argv[1]);
+ bb_error_msg_and_die("%s: Group could not be removed\n", argv[1]);
}
}
@@ -142,38 +142,38 @@ int deluser_main(int argc, char **argv)
int failure;
if (argc != 2) {
- show_usage();
+ bb_show_usage();
} else {
- failure = del_line_matching(argv[1], passwd_file);
+ failure = del_line_matching(argv[1], bb_path_passwd_file);
/* if (!successful) { */
if (failure) {
- error_msg_and_die("%s: User could not be removed from %s\n",
- argv[1], passwd_file);
+ bb_error_msg_and_die("%s: User could not be removed from %s\n",
+ argv[1], bb_path_passwd_file);
}
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
- failure = del_line_matching(argv[1], shadow_file);
+ failure = del_line_matching(argv[1], bb_path_shadow_file);
/* if (!successful) { */
if (failure) {
- error_msg_and_die("%s: User could not be removed from %s\n",
- argv[1], shadow_file);
+ bb_error_msg_and_die("%s: User could not be removed from %s\n",
+ argv[1], bb_path_shadow_file);
}
- failure = del_line_matching(argv[1], gshadow_file);
+ failure = del_line_matching(argv[1], bb_path_gshadow_file);
/* if (!successful) { */
if (failure) {
- error_msg_and_die("%s: User could not be removed from %s\n",
- argv[1], gshadow_file);
+ bb_error_msg_and_die("%s: User could not be removed from %s\n",
+ argv[1], bb_path_gshadow_file);
}
#endif /* CONFIG_FEATURE_SHADOWPASSWDS */
- failure = del_line_matching(argv[1], group_file);
+ failure = del_line_matching(argv[1], bb_path_group_file);
/* if (!successful) { */
if (failure) {
- error_msg_and_die("%s: User could not be removed from %s\n",
- argv[1], group_file);
+ bb_error_msg_and_die("%s: User could not be removed from %s\n",
+ argv[1], bb_path_group_file);
}
}
return (EXIT_SUCCESS);
}
-/* $Id: deluser.c,v 1.2 2002/06/23 04:24:24 andersen Exp $ */
+/* $Id: deluser.c,v 1.3 2003/03/19 09:12:20 mjn3 Exp $ */
diff --git a/loginutils/getty.c b/loginutils/getty.c
index b8be8b603..4219ff821 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -169,6 +169,7 @@ struct chardata init_chardata = {
0, /* no capslock */
};
+#if 0
struct Speedtab {
long speed;
int code;
@@ -211,6 +212,7 @@ static struct Speedtab speedtab[] = {
#endif
{0, 0},
};
+#endif
static void parse_args(int argc, char **argv, struct options *op);
static void parse_speeds(struct options *op, char *arg);
@@ -263,7 +265,7 @@ int getty_main(int argc, char **argv)
};
#ifdef DEBUGGING
- dbf = xfopen(DEBUGTERM, "w");
+ dbf = bb_xfopen(DEBUGTERM, "w");
{
int i;
@@ -383,7 +385,7 @@ static void parse_args(int argc, char **argv, struct options *op)
switch (c) {
case 'I':
if (!(op->initstring = strdup(optarg)))
- error(memory_exhausted);
+ error(bb_msg_memory_exhausted);
{
const char *p;
@@ -396,7 +398,7 @@ static void parse_args(int argc, char **argv, struct options *op)
while (*p) {
if (*p == '\\') {
p++;
- *q++ = process_escape_sequence(&p);
+ *q++ = bb_process_escape_sequence(&p);
} else {
*q++ = *p++;
}
@@ -439,12 +441,12 @@ static void parse_args(int argc, char **argv, struct options *op)
op->flags |= F_WAITCRLF;
break;
default:
- show_usage();
+ bb_show_usage();
}
}
debug("after getopt loop\n");
if (argc < optind + 2) /* check parameter count */
- show_usage();
+ bb_show_usage();
/* we loosen up a bit and accept both "baudrate tty" and "tty baudrate" */
if ('0' <= argv[optind][0] && argv[optind][0] <= '9') {
@@ -953,6 +955,7 @@ static int caps_lock(const char *s)
/* bcode - convert speed string to speed code; return 0 on failure */
static int bcode(const char *s)
{
+#if 0
struct Speedtab *sp;
long speed = atol(s);
@@ -960,6 +963,14 @@ static int bcode(const char *s)
if (sp->speed == speed)
return (sp->code);
return (0);
+#else
+ int r;
+
+ if ((r = bb_value_to_baud(atol(s))) > 0) {
+ return r;
+ }
+ return 0;
+#endif
}
/* error - report errors to console or syslog; only understands %s and %m */
@@ -982,7 +993,7 @@ static void error(const char *fmt, ...)
buf[0] = '\0';
bp = buf;
#else
- strncpy(buf, applet_name, 256);
+ strncpy(buf, bb_applet_name, 256);
strncat(buf, ": ", 256);
buf[255] = 0;
bp = buf + strlen(buf);
diff --git a/loginutils/login.c b/loginutils/login.c
index c1ea165c8..e239f421c 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -94,10 +94,10 @@ extern int login_main(int argc, char **argv)
* (-f root, *NOT* -froot). --marekm
*/
if ( optarg != argv[optind-1] )
- show_usage ( );
+ bb_show_usage( );
if ( !amroot ) /* Auth bypass only if real UID is zero */
- error_msg_and_die ( "-f permission denied" );
+ bb_error_msg_and_die ( "-f permission denied" );
safe_strncpy(username, optarg, USERNAME_SIZE);
opt_fflag = 1;
@@ -106,7 +106,7 @@ extern int login_main(int argc, char **argv)
opt_host = optarg;
break;
default:
- show_usage ( );
+ bb_show_usage( );
}
}
@@ -275,11 +275,11 @@ static int login_prompt ( char *buf_name )
static int check_nologin ( int amroot )
{
- if ( access ( nologin_file, F_OK ) == 0 ) {
+ if ( access ( bb_path_nologin_file, F_OK ) == 0 ) {
FILE *fp;
int c;
- if (( fp = fopen ( nologin_file, "r" ))) {
+ if (( fp = fopen ( bb_path_nologin_file, "r" ))) {
while (( c = getc ( fp )) != EOF )
putchar (( c == '\n' ) ? '\r' : c );
@@ -304,9 +304,9 @@ static int check_tty ( const char *tty )
int i;
char buf[BUFSIZ];
- if (( fp = fopen ( securetty_file, "r" ))) {
+ if (( fp = fopen ( bb_path_securetty_file, "r" ))) {
while ( fgets ( buf, sizeof( buf ) - 1, fp )) {
- for ( i = xstrlen( buf ) - 1; i >= 0; --i ) {
+ for ( i = bb_strlen( buf ) - 1; i >= 0; --i ) {
if ( !isspace ( buf[i] ))
break;
}
@@ -348,7 +348,7 @@ static void motd ( )
FILE *fp;
register int c;
- if (( fp = fopen ( motd_file, "r" ))) {
+ if (( fp = fopen ( bb_path_motd_file, "r" ))) {
while (( c = getc ( fp )) != EOF )
putchar ( c );
fclose ( fp );
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index e02cc4b81..e8577066a 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -46,13 +46,13 @@ extern int update_passwd(const struct passwd *pw, char *crypt_pw)
struct stat sb;
struct flock lock;
- if (access(shadow_file, F_OK) == 0) {
+ if (access(bb_path_shadow_file, F_OK) == 0) {
has_shadow = 1;
}
if (has_shadow) {
- snprintf(filename, sizeof filename, "%s", shadow_file);
+ snprintf(filename, sizeof filename, "%s", bb_path_shadow_file);
} else {
- snprintf(filename, sizeof filename, "%s", passwd_file);
+ snprintf(filename, sizeof filename, "%s", bb_path_passwd_file);
}
if (((fp = fopen(filename, "r+")) == 0) || (fstat(fileno(fp), &sb))) {
@@ -167,30 +167,30 @@ extern int passwd_main(int argc, char **argv)
uflg++;
break;
default:
- show_usage();
+ bb_show_usage();
}
}
ruid = getuid();
pw = (struct passwd *) getpwuid(ruid);
if (!pw) {
- error_msg_and_die("Cannot determine your user name.");
+ bb_error_msg_and_die("Cannot determine your user name.");
}
- myname = (char *) xstrdup(pw->pw_name);
+ myname = (char *) bb_xstrdup(pw->pw_name);
if (optind < argc) {
name = argv[optind];
} else {
name = myname;
}
if ((lflg || uflg || dflg) && (optind >= argc || !amroot)) {
- show_usage();
+ bb_show_usage();
}
pw = getpwnam(name);
if (!pw) {
- error_msg_and_die("Unknown user %s\n", name);
+ bb_error_msg_and_die("Unknown user %s\n", name);
}
if (!amroot && pw->pw_uid != getuid()) {
syslog(LOG_WARNING, "can't change pwd for `%s'", name);
- error_msg_and_die("Permission denied.\n");
+ bb_error_msg_and_die("Permission denied.\n");
}
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
sp = getspnam(name);
@@ -209,12 +209,12 @@ extern int passwd_main(int argc, char **argv)
if (!amroot) {
if (cp[0] == '!') {
syslog(LOG_WARNING, "password locked for `%s'", np);
- error_msg_and_die( "The password for `%s' cannot be changed.\n", np);
+ bb_error_msg_and_die( "The password for `%s' cannot be changed.\n", np);
}
}
printf("Changing password for %s\n", name);
if (new_password(pw, amroot, algo)) {
- error_msg_and_die( "The password for %s is unchanged.\n", name);
+ bb_error_msg_and_die( "The password for %s is unchanged.\n", name);
}
} else if (lflg) {
if (crypt_passwd[0] != '!') {
@@ -238,7 +238,7 @@ extern int passwd_main(int argc, char **argv)
umask(077);
if (setuid(0)) {
syslog(LOG_ERR, "can't setuid(0)");
- error_msg_and_die( "Cannot change ID to root.\n");
+ bb_error_msg_and_die( "Cannot change ID to root.\n");
}
if (!update_passwd(pw, crypt_passwd)) {
syslog(LOG_INFO, "password for `%s' changed by user `%s'", name,
@@ -246,7 +246,7 @@ extern int passwd_main(int argc, char **argv)
printf("Password changed.\n");
} else {
syslog(LOG_WARNING, "an error occurred updating the password file");
- error_msg_and_die("An error occurred updating the password file.\n");
+ bb_error_msg_and_die("An error occurred updating the password file.\n");
}
return (0);
}
diff --git a/loginutils/su.c b/loginutils/su.c
index 6d427262e..5e40cf2e4 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -94,7 +94,7 @@ int su_main ( int argc, char **argv )
opt_loginshell = 1;
break;
default:
- show_usage ( );
+ bb_show_usage( );
break;
}
}
@@ -114,7 +114,7 @@ int su_main ( int argc, char **argv )
pw = getpwnam ( opt_username );
if ( !pw )
- error_msg_and_die ( "user %s does not exist", opt_username );
+ 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
@@ -127,15 +127,15 @@ int su_main ( int argc, char **argv )
the static data through the getlogin call from log_su. */
pw_copy = *pw;
pw = &pw_copy;
- pw-> pw_name = xstrdup ( pw-> pw_name );
- pw-> pw_dir = xstrdup ( pw-> pw_dir );
- pw-> pw_shell = xstrdup ( pw-> pw_shell );
+ pw-> pw_name = bb_xstrdup ( pw-> pw_name );
+ pw-> pw_dir = bb_xstrdup ( pw-> pw_dir );
+ pw-> pw_shell = bb_xstrdup ( pw-> pw_shell );
if (( getuid ( ) == 0 ) || correct_password ( pw ))
log_su ( pw, 1 );
else {
log_su ( pw, 0 );
- error_msg_and_die ( "incorrect password" );
+ bb_error_msg_and_die ( "incorrect password" );
}
if ( !opt_shell && opt_preserve )
@@ -152,7 +152,7 @@ int su_main ( int argc, char **argv )
}
if ( !opt_shell )
- opt_shell = xstrdup ( pw-> pw_shell );
+ opt_shell = bb_xstrdup ( pw-> pw_shell );
change_identity ( pw );
setup_environment ( opt_shell, opt_loginshell, !opt_preserve, pw );
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index a654ffb89..bb4716e0d 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -117,9 +117,9 @@ extern int sulogin_main(int argc, char **argv)
}
}
}
- if (access(passwd_file, 0) == -1) {
+ if (access(bb_path_passwd_file, 0) == -1) {
syslog(LOG_WARNING, "No password file\n");
- error_msg_and_die("No password file\n");
+ bb_error_msg_and_die("No password file\n");
}
if (!isatty(0) || !isatty(1) || !isatty(2)) {
exit(EXIT_FAILURE);
@@ -135,7 +135,7 @@ extern int sulogin_main(int argc, char **argv)
alarm(timeout);
if (!(pwd = getpwnam(name))) {
syslog(LOG_WARNING, "No password entry for `root'\n");
- error_msg_and_die("No password entry for `root'\n");
+ bb_error_msg_and_die("No password entry for `root'\n");
}
pwent = *pwd;
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
diff --git a/loginutils/vlock.c b/loginutils/vlock.c
index 18f4b9407..7abf120d9 100644
--- a/loginutils/vlock.c
+++ b/loginutils/vlock.c
@@ -29,6 +29,7 @@
* It now works with md5, sha1, etc passwords. */
#include <stdio.h>
+#include <stdlib.h>
#include <sys/vt.h>
#include <signal.h>
#include <string.h>
@@ -96,26 +97,26 @@ extern int vlock_main(int argc, char **argv)
struct termios term;
if (argc > 2) {
- show_usage();
+ bb_show_usage();
}
if (argc == 2) {
if (strncmp(argv[1], "-a", 2)) {
- show_usage();
+ bb_show_usage();
} else {
o_lock_all = 1;
}
}
if ((pw = getpwuid(getuid())) == NULL) {
- error_msg_and_die("no password for uid %d\n", getuid());
+ bb_error_msg_and_die("no password for uid %d\n", getuid());
}
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
if ((strcmp(pw->pw_passwd, "x") == 0)
|| (strcmp(pw->pw_passwd, "*") == 0)) {
if ((spw = getspuid(getuid())) == NULL) {
- error_msg_and_die("could not read shadow password for uid %d: %s\n",
+ bb_error_msg_and_die("could not read shadow password for uid %d: %s\n",
getuid(), strerror(errno));
}
if (spw->sp_pwdp) {
@@ -124,7 +125,7 @@ extern int vlock_main(int argc, char **argv)
}
#endif /* CONFIG_FEATURE_SHADOWPASSWDS */
if (pw->pw_passwd[0] == '!' || pw->pw_passwd[0] == '*') {
- error_msg_and_die("Account disabled for uid %d\n", getuid());
+ bb_error_msg_and_die("Account disabled for uid %d\n", getuid());
}
/* we no longer need root privs */
@@ -132,11 +133,11 @@ extern int vlock_main(int argc, char **argv)
setgid(getgid());
if ((vfd = open("/dev/tty", O_RDWR)) < 0) {
- error_msg_and_die("/dev/tty");
+ bb_error_msg_and_die("/dev/tty");
};
if (ioctl(vfd, VT_GETMODE, &vtm) < 0) {
- error_msg_and_die("/dev/tty");
+ bb_error_msg_and_die("/dev/tty");
};
/* mask a bunch of signals */