From 10749f0422686db7261f7da35a53d17e0d5a41d6 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 26 Nov 2023 14:50:21 -0600 Subject: Redo help text and add ~ to potential output. --- toys/other/pwgen.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/toys/other/pwgen.c b/toys/other/pwgen.c index 73627561..ded3df89 100644 --- a/toys/other/pwgen.c +++ b/toys/other/pwgen.c @@ -8,23 +8,21 @@ config PWGEN bool "pwgen" default y help - usage: pwgen [-cAn0yrsBhC1v] [LENGTH] [COUNT] + usage: pwgen [-cAn0yrsBC1v] [-r CHARS] [LENGTH] [COUNT] - Generate human-readable random passwords. When output is to tty produces - a screenfull to defeat shoulder surfing (pick one and clear the screen). + Generate human-readable random passwords. Default output to tty fills screen + with passwords to defeat shoulder surfing (pick one and clear the screen). - -c --capitalize Permit capital letters. - -A --no-capitalize Don't include capital letters. - -n --numerals Permit numbers. - -0 --no-numerals Don't include numbers. - -y --symbols Permit special characters ($#%...). - -r --remove= Don't include the given characters. - -s --secure Generate more random passwords. - -B --ambiguous Avoid ambiguous characters (e.g. 0, O). - -h --help Print this help message. - -C Print the output in columns. - -1 Print the output one line each. - -v Don't include vowels. + -0 No numbers (--no-numerals) + -1 Output one per line + -A No capital letters (--no-capitalize) + -B Avoid ambiguous characters like 0O and 1lI (--ambiguous) + -C Output in columns + -c Add capital letters (--capitalize) + -n Add numbers (--numerals) + -r Don't include the given CHARS (--remove) + -v No vowels. + -y Add punctuation (--symbols) */ #define FOR_pwgen @@ -52,8 +50,8 @@ void pwgen_main(void) for (ii = 0; ii102 less likely - if (FLAG(s)) randbuf[rand] = 0; + c = 33+randbuf[--rand]%94; // remainder 67 makes >102 less likely + randbuf[rand] = 0; if (c>='A' && c<='Z') { if (FLAG(A)) continue; -- cgit v1.2.3 From bf51dae965ff237007377edd93d44c4c682a7d26 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 27 Nov 2023 15:07:42 -0800 Subject: strace: fix arm64 test. We're not specifically looking for armv8; we want any aarch64. I've also changed the 32-bit arm test because (a) Linux doesn't support arm32 OABI any more, (b) it's clearer this way that 32-bit armv8 still belongs in this branch, and (c) __arm__ and __aarch64__ are the usual spellings everywhere. (Sure, the latter is ugly, but we have __i386__ rather than __x86__ one line later anyway! I still have to grep AOSP for mistaken uses of the non-existent __x86__ on a regular basis. And don't get me started on __riscv and __riscv_xlen!) --- toys/pending/strace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toys/pending/strace.c b/toys/pending/strace.c index 49ac2b69..24ec52a8 100644 --- a/toys/pending/strace.c +++ b/toys/pending/strace.c @@ -35,9 +35,9 @@ GLOBALS( // Syscall args from https://man7.org/linux/man-pages/man2/syscall.2.html // REG_ORDER is args 0-6, SYSCALL, RESULT -#if defined(__ARM_EABI__) +#if defined(__arm__) static const char REG_ORDER[] = {0,1,2,3,4,5,7,0}; -#elif defined(__ARM_ARCH) && __ARM_ARCH == 8 +#elif defined(__aarch64__) static const char REG_ORDER[] = {0,1,2,3,4,5,8,0}; #elif defined(__i386__) // ebx,ecx,edx,esi,edi,ebp,orig_eax,eax -- cgit v1.2.3