* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <utime.h>
-#include <syslog.h>
-#include <time.h>
-#include <sys/resource.h>
-#include <errno.h>
-
#include "busybox.h"
+#include <syslog.h>
static char crypt_passwd[128];
bb_show_usage();
}
}
- myname = (char *) bb_xstrdup(bb_getpwuid(NULL, getuid(), -1));
+ myname = (char *) xstrdup(bb_getpwuid(NULL, getuid(), -1));
/* exits on error */
if (optind < argc) {
name = argv[optind];
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
umask(077);
- if (setuid(0)) {
- syslog(LOG_ERR, "can't setuid(0)");
- bb_error_msg_and_die( "Cannot change ID to root.\n");
- }
+ xsetuid(0);
if (!update_passwd(pw, crypt_passwd)) {
syslog(LOG_INFO, "password for `%s' changed by user `%s'", name,
myname);