to attempt to hide the original length of the file name.
[bug introduced in coreutils-8.28]
+ stty no longer crashes when processing settings with -F also specified.
+ [bug introduced in fileutils-4.0]
+
timeout will again notice its managed command exiting, even when
invoked with blocked CHLD signal, or in a narrow window where
this CHLD signal from the exiting child was missed. In each case
struct termios *mode, bool *speed_was_set,
bool *require_set_attr)
{
+#define check_argument(arg) \
+ if (k == n_settings - 1 || ! settings[k+1]) \
+ { \
+ error (0, 0, _("missing argument to %s"), quote (arg)); \
+ usage (EXIT_FAILURE); \
+ }
+
for (int k = 1; k < n_settings; k++)
{
char const *arg = settings[k];
{
if (STREQ (arg, control_info[i].name))
{
- if (k == n_settings - 1)
- {
- error (0, 0, _("missing argument to %s"), quote (arg));
- usage (EXIT_FAILURE);
- }
+ check_argument (arg);
match_found = true;
++k;
set_control_char (&control_info[i], settings[k], mode);
{
if (STREQ (arg, "ispeed"))
{
- if (k == n_settings - 1)
- {
- error (0, 0, _("missing argument to %s"), quote (arg));
- usage (EXIT_FAILURE);
- }
+ check_argument (arg);
++k;
if (checking)
continue;
}
else if (STREQ (arg, "ospeed"))
{
- if (k == n_settings - 1)
- {
- error (0, 0, _("missing argument to %s"), quote (arg));
- usage (EXIT_FAILURE);
- }
+ check_argument (arg);
++k;
if (checking)
continue;
#ifdef TIOCGWINSZ
else if (STREQ (arg, "rows"))
{
- if (k == n_settings - 1)
- {
- error (0, 0, _("missing argument to %s"), quote (arg));
- usage (EXIT_FAILURE);
- }
+ check_argument (arg);
++k;
if (checking)
continue;
else if (STREQ (arg, "cols")
|| STREQ (arg, "columns"))
{
- if (k == n_settings - 1)
- {
- error (0, 0, _("missing argument to %s"), quote (arg));
- usage (EXIT_FAILURE);
- }
+ check_argument (arg);
++k;
if (checking)
continue;
else if (STREQ (arg, "line"))
{
unsigned long int value;
- if (k == n_settings - 1)
- {
- error (0, 0, _("missing argument to %s"), quote (arg));
- usage (EXIT_FAILURE);
- }
+ check_argument (arg);
++k;
mode->c_line = value = integer_arg (settings[k], ULONG_MAX);
if (mode->c_line != value)
returns_ 1 stty $(echo $saved_state |sed 's/:[0-9a-f]*$/:'$hex_2_64/) \
2>/dev/null || fail=1
+# From coreutils 5.3.0 to 8.28, the following would crash
+# due to incorrect argument handling.
+if tty -s </dev/tty; then
+ returns_ 1 stty eol -F /dev/tty || fail=1
+ returns_ 1 stty -F /dev/tty eol || fail=1
+ returns_ 1 stty -F/dev/tty eol || fail=1
+ returns_ 1 stty eol -F/dev/tty eol || fail=1
+fi
+
# Just in case either of the above mistakenly succeeds (and changes
# the state of our tty), try to restore the initial state.
stty $saved_state || fail=1