Re: permanently_set_uid: was able to restore old [e]gid

From: Neil W Rickert (rickert+nn_at_cs.niu.edu)
Date: 08/24/04

  • Next message: Darren Tucker: "Re: permanently_set_uid: was able to restore old [e]gid"
    Date: Tue, 24 Aug 2004 02:52:41 +0000 (UTC)
    
    

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    dtucker@dodgy.net.au (Darren Tucker) writes:
    >Neil W Rickert <rickert+nn@cs.niu.edu> wrote:
    >>Solaris 8, openssh-3.9p1. The message

    >> permanently_set_uid: was able to restore old [e]gid

    >>occurs when a root user attempts to ssh. There
    >>is no corresponding problem for ssh by non-root users (so far).
    >[snip description]

    >I could not reproduce this from your description, even logging into a
    >test account with uid 0. Could you please post/send the output of "id"
    >from the account where it occurs? Also, is your ssh binary setuid?

    Here is how to reproduce.

    As root:

      newgrp xyz ### change to some group other than the default for root
      ssh hostname

    Sorry if my earlier comments were a little misleading.

    The problem occurs whether or not the binary is setuid.

    On a cursory reading of the code, it seems that it is:

            getpwuid()

    and using the gid from the pw entry to reset the gid. In my opinion
    you should be resetting to the original realgid, rather than to
    the gid from the passwd entry.

    The "newgrp" above demonstrates the problem in case they are different.

    >Lastly, does this patch solve it?

    Yes it does.

    I did post a different patch which also solves the problem.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.3.6 (SunOS)

    iD8DBQFBKq11vmGe70vHPUMRAvQnAKDztFJSI4mUWKMLuPVai2VSmLWwDACeIYja
    fhl9A6O0iJ28RcsSlmJnKFs=
    =MOBm
    -----END PGP SIGNATURE-----


  • Next message: Darren Tucker: "Re: permanently_set_uid: was able to restore old [e]gid"