busybox/libbb
Denys Vlasenko 7485086f1e die_if_bad_username: tighten up a bit
function                                             old     new   delta
die_if_bad_username                                   77      97     +20

Based on patches from Tito.
The changes are:
better comments
we disallow '@' now - in practice such usernames will be unusable
use of the portable filename character set plus '$'
don't use isalnum as it allows non-ASCII letters in legacy 8-bit locales (pointed out by Rich Felker)
enforce maximum length of LOGIN_NAME_MAX (including NUL)
don't allow '$', '.', and '-' as first char
don't print the illegal char in error message as if it is a wide char it will be unreadable
print the position of the illegal character

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-08-09 04:05:13 +02:00
..
appletlib.c appletlib.c: do not use PAGE_SIZE for malloc tweaking 2011-06-03 21:39:42 +02:00
ask_confirmation.c
bb_askpass.c
bb_bswap_64.c
bb_do_delay.c
bb_pwd.c libbb: make user/group name cache strings longer (~27 chars) 2011-03-01 16:27:13 +01:00
bb_qsort.c
bb_strtod.c
bb_strtonum.c
change_identity.c
chomp.c
compare_string_array.c
concat_path_file.c
concat_subpath_file.c
Config.src libbb/lineedit: implement optional Ctrl-R history search 2011-07-11 07:36:59 +02:00
copy_file.c
copyfd.c
correct_password.c
crc32.c whitespace fixes 2011-02-03 00:05:48 +01:00
create_icmp6_socket.c
create_icmp_socket.c
default_error_retval.c
device_open.c
die_if_bad_username.c die_if_bad_username: tighten up a bit 2011-08-09 04:05:13 +02:00
dump.c fix "variable 'foo' set but not used" warnings 2011-05-13 20:57:01 +02:00
execable.c libbb: make BB_EXECVP/LP try to exec real binary if there's no /proc/self/exe 2011-02-02 03:28:56 +01:00
fclose_nonstdin.c
fflush_stdout_and_exit.c
fgets_str.c
find_mount_point.c
find_pid_by_name.c
find_root_device.c
full_write.c
get_console.c
get_cpu_count.c
get_last_path_component.c find: cater for libc w/o FNM_CASEFOLD 2011-05-23 00:40:54 +02:00
get_line_from_file.c libbb: split bb_get_chunk_from_file and bb_get_chunk_with_continuation 2011-06-17 03:37:43 +02:00
get_shell_name.c forgot to add libbb/get_shell_name.c 2011-03-08 21:02:42 +01:00
get_volsize.c
getopt32.c fix !ENABLE_FEATURE_GETOPT_LONG build. Closes 3775 2011-05-29 04:24:52 +02:00
getpty.c
hash_md5_sha.c
hash_md5prime.c
herror_msg.c
human_readable.c
inet_common.c a few tweaks for bionic 2011-07-08 08:34:28 +02:00
info_msg.c
inode_hash.c
isdirectory.c
Kbuild.src platform.h: tweaks for cygwin 2011-07-08 04:41:38 +02:00
kernel_version.c
last_char_is.c
lineedit_ptr_hack.c
lineedit.c libbb/lineedit: implement optional Ctrl-R history search 2011-07-11 07:36:59 +02:00
llist.c main: free suid_config list after use 2011-05-16 12:21:31 +02:00
login.c
loop.c
make_directory.c
makedev.c
match_fstype.c
messages.c save 10 bytes on strings 2011-02-10 10:01:49 +01:00
mode_string.c
mtab.c
obscure.c a few tweaks for bionic 2011-07-08 08:34:28 +02:00
parse_config.c parse_config: use getline. BIG speedup with glibc (~40%). 2011-06-20 09:49:56 +02:00
parse_mode.c
perror_msg.c
perror_nomsg_and_die.c
perror_nomsg.c
pidfile.c
platform.c platform.c: provide getline implementation 2011-06-29 02:19:58 +02:00
print_flags.c
printable_string.c
printable.c
process_escape_sequence.c
procps.c libbb/read_cmdline: prepend {comm} if different from argv0. Closes 3835. 2011-06-18 15:51:16 +02:00
progress.c libbb: make warning go away 2011-03-12 02:19:50 +01:00
ptr_to_globals.c
pw_encrypt_des.c
pw_encrypt_md5.c
pw_encrypt_sha.c
pw_encrypt.c adduser: safe username passing to passwd/addgroup 2011-05-13 03:19:01 +02:00
read_key.c less: optionally query terminal size via "ESC [ 6 n". Closes bug 2659. 2011-07-25 15:18:20 +02:00
read_printf.c hush: make read builtin interruptible. 2011-05-08 21:23:43 +02:00
read.c
README
recursive_action.c
remove_file.c
rtc.c
run_shell.c
safe_gethostname.c
safe_poll.c
safe_strncpy.c
safe_write.c
selinux_common.c
setup_environment.c libbb/login/su: do not sanitize shell name twice 2011-03-06 18:49:40 +01:00
signals.c
simplify_path.c
single_argv.c basename,dirname,freeramdisk,rx,raidautorun,runsv,chvt: skip "--" argument 2011-04-11 03:58:30 +02:00
skip_whitespace.c
speed_table.c
str_tolower.c
strrstr.c
systemd_support.c typo fix 2011-02-12 01:56:25 +01:00
time.c
trim.c
u_signal_names.c
udp_io.c
unicode.c lineedit: fixes for CONFIG_UNICODE_USING_LOCALE=y 2011-03-27 01:18:07 +01:00
update_passwd.c
utmp.c
uuencode.c
vdprintf.c
verror_msg.c
vfork_daemon_rexec.c libbb: spawn should remove child which failed to exec 2011-02-03 14:14:09 +01:00
warn_ignoring_args.c
wfopen_input.c
wfopen.c
write.c
xatonum_template.c
xatonum.c
xconnect.c libbb: make set_nport accept pointer to sockaddr, not to len_and_sockaddr. 2011-04-07 17:52:20 +02:00
xfunc_die.c
xfuncs_printf.c
xfuncs.c
xgetcwd.c
xgethostbyname.c
xreadlink.c
xrealloc_vector.c
xregcomp.c

Please see the LICENSE file for copyright information (GPLv2)

libbb is BusyBox's utility library.  All of this stuff used to be stuffed into
a single file named utility.c.  When I split utility.c to create libbb, some of
the very oldest stuff ended up without their original copyright and licensing
information (which is now lost in the mists of time).  If you see something
that you wrote that is mis-attributed, do let me know so we can fix that up.

	Erik Andersen
	<andersen@codepoet.org>