[Bug 2856] New: key-options.sh fails when pty /dev/ttyp1 is not owned by testing user

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Wed Apr 11 18:31:37 AEST 2018


https://bugzilla.mindrot.org/show_bug.cgi?id=2856

            Bug ID: 2856
           Summary: key-options.sh fails when pty /dev/ttyp1 is not owned
                    by testing user
           Product: Portable OpenSSH
           Version: 7.6p1
          Hardware: ix86
                OS: NetBSD
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Regression tests
          Assignee: unassigned-bugs at mindrot.org
          Reporter: openssh at vega.pgw.jp

This is report for OpenSSH-7.7p1, but the version dropbox lacks this
version. Probably also applicable for other versions.

Running "make t-exec" test on NetBSD as non-root.

This OS doesn't have /dev/ptmx, and relies on sshd(running as root) 
to chown the pty's ownership, so
chown("/dev/ttyp1", myuid, ttygid) by sshd invoked by user privilege
during the test will fail, unless
/dev/ttyp1 had been chown'ed to the user by previous ssh login.

run test key-options.sh seems to stumble on this:
=======
run test key-options.sh ...
key option command="echo bar"
key option no-pty,command="echo bar"
key option pty default
key option failed default
key option pty no-pty
key option pty restrict
key option pty restrict,pty
key option failed restrict,pty
key option environment
key option from="127.0.0.1"
key option from="127.0.0.0/8"
key option expiry-time default
key option expiry-time invalid
key option expiry-time expired
key option expiry-time valid
failed key options
*** Error code 1

========
regress/failed-sshd.log:
...
debug1: session_new: session 0
chown(/dev/ttyp1, 901, 4) failed: Operation not permitted
debug1: do_cleanup
debug1: session_pty_cleanup: session 0 release /dev/ttyp1
Attempt to write login records by non-root user (aborting)
...

=======
steps to reproduce:
- ssh otheruser at localhost, then logout, or
  just "chown root:tty /dev/ttyp1", to make next vacant pty slot
  to not be owned by the user.
- make t-exec ;# the test

=======
Workaround: Do "ssh localhost", then logout to fill the 
next vacant pty slot to be owned by myself.
This made key-options.sh (and perhaps other tests) to pass.
Running the test as root also works (but unrecommended for obvious
reasons).

I wonder whether this could be "fixed" or not.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list