diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-06-12 17:09:43 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-06-12 17:11:17 +0200 |
| commit | 2d6fc0f9a6a60bc96ef9c4a10e450ed6a8247435 (patch) | |
| tree | 1f3edc4a4937c46cfaa3b60f958b1a90f8f0f7e7 | |
| parent | 32af8ddd3d63fe0936f9ae5b6ca09285bed1baff (diff) | |
usergen: Fix error on empty $QUOTA
When no quota is entered, printf(1) could fail because '%d' would expect
at least one argument. Whereas some printf(1) implementations, such as
the one by GNU coreutils, are somewhat tolerant, stricter
implementations such as Busybox would (correctly) refuse this.
| -rwxr-xr-x | usergen | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -59,7 +59,7 @@ echo echo "Quota, in MiB (leave empty for unlimited quota):" >&2 read -r QUOTA -QUOTA="$(printf '%d' "$QUOTA")" +QUOTA="${QUOTA:+"$(printf '%d' "$QUOTA")"}" PWD=$(printf '%s' "$PWD" | to_hex) SALT=$(openssl rand -hex 32) |
