Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/loginutils/passwd.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (8 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/loginutils/passwd.c
r3232 r3621 3 3 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 4 */ 5 //config:config PASSWD 6 //config: bool "passwd" 7 //config: default y 8 //config: select FEATURE_SYSLOG 9 //config: help 10 //config: passwd changes passwords for user and group accounts. A normal user 11 //config: may only change the password for his/her own account, the super user 12 //config: may change the password for any account. The administrator of a group 13 //config: may change the password for the group. 14 //config: 15 //config: Note that Busybox binary must be setuid root for this applet to 16 //config: work properly. 17 //config: 18 //config:config FEATURE_PASSWD_WEAK_CHECK 19 //config: bool "Check new passwords for weakness" 20 //config: default y 21 //config: depends on PASSWD 22 //config: help 23 //config: With this option passwd will refuse new passwords which are "weak". 24 25 //applet:/* Needs to be run by root or be suid root - needs to change /etc/{passwd,shadow}: */ 26 //applet:IF_PASSWD(APPLET(passwd, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) 27 28 //kbuild:lib-$(CONFIG_PASSWD) += passwd.o 5 29 6 30 //usage:#define passwd_trivial_usage … … 17 41 #include <syslog.h> 18 42 #include <sys/resource.h> /* setrlimit */ 19 20 static void nuke_str(char *str)21 {22 if (str) memset(str, 0, strlen(str));23 }24 43 25 44 static char* new_password(const struct passwd *pw, uid_t myuid, const char *algo) … … 212 231 if (rc < 0) 213 232 bb_error_msg_and_die("can't update password file %s", filename); 214 bb_ info_msg("Password for %s changed by %s", name, myname);233 bb_error_msg("password for %s changed by %s", name, myname); 215 234 216 235 /*if (ENABLE_FEATURE_CLEAN_UP) free(newp); - can't, it may be non-malloced */
Note:
See TracChangeset
for help on using the changeset viewer.