Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix handling of Ctrl-SPACE (NUL) over job ptys (e.g. under flux job attach) #5833

Merged
merged 3 commits into from
Mar 26, 2024

Commits on Mar 26, 2024

  1. libterminus: fix handling of NUL input on terminal

    Problem: The NUL character, generated by Ctrl-SPACE, Ctrl-2, etc, is
    dropped by the libterminus pty server, making this sequence impossible
    to use with terminal programs running under Flux establish ptys such
    as under flux-alloc(1).
    
    Use json_unpack_ex(3) instead of flux_msg_unpack(3) so that the
    JSON_ALLOW_NUL flag can be used to avoid ignoring a NUL character
    encoded by the client. Also simplify the code by using size_t for
    the unpacked length so the variable doesn't have to be reassigned.
    
    Fixes flux-framework#5832
    grondo committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    06d4656 View commit details
    Browse the repository at this point in the history
  2. libterminus: fix write to client pty if stdin is closed

    Problem: libterminus writes client pty input to STDIN_FILENO, but this
    can fail if stdin becomes closed, e.g. if a user does something like
    
      echo foo | flux run -o pty.interactive ...
    
    Write to STDOUT_FILENO instead, which is unlikely to be closed.
    
    Also, update a misleading error message in this case.
    grondo committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    347bcdd View commit details
    Browse the repository at this point in the history
  3. testsuite: test that NUL can be sent over pty

    Problem: There's no test that ensures NUL can be transmitted over
    a pty allocated for a job.
    
    Add a test to t2612-job-shell-pty.t that sends a NUL as input to a
    job with a pty and ensures it is received by the job task.
    grondo committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    72bb395 View commit details
    Browse the repository at this point in the history