Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Sep 2001 14:11:46 -0700
From:      "Crist J. Clark" <cristjc@earthlink.net>
To:        "Kozlovsky, Marek" <Marek.Kozlovsky@KPNQwest.com>
Cc:        "'stable@freebsd.org'" <stable@FreeBSD.ORG>
Subject:   Re: weird group membership
Message-ID:  <20010905141146.B321@blossom.cjclark.org>
In-Reply-To: <31FD3FA70CBED31189E700508B6401718E0CF1@ntexgpra01>; from Marek.Kozlovsky@KPNQwest.com on Wed, Sep 05, 2001 at 03:58:54PM %2B0200
References:  <31FD3FA70CBED31189E700508B6401718E0CF1@ntexgpra01>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 05, 2001 at 03:58:54PM +0200, Kozlovsky, Marek wrote:
> Hi,
> 
> I wanted to use 'cu -l /dev/cuaa1' so I found out I have to be in 'dialer'
> group:
> buki@hal9000:/home/buki>ll /dev/cuaa1
> crw-rw----  1 uucp  dialer   28, 129 Aug 29 16:29 /dev/cuaa1
> 
> So I su-ed to root and did 'pw user mod buki -G wheel dialer' checked with
> 'id buki':
> root@hal9000#id buki
> uid=1001(buki) gid=1001(users) groups=1001(users), 0(wheel), 68(dialer)
> 
> it seems OK, so logged in as buki again, but:
> 
> buki@hal9000:/home/buki>cu -l /dev/cuaa1
> cu: /dev/cuaa1: Permission denied
> buki@hal9000:/home/buki>whoami
> buki
> buki@hal9000:/home/buki>id
> uid=1001(buki) gid=1001(users) groups=1001(users), 0(wheel)
> buki@hal9000:/home/buki>groups buki
> users wheel dialer
> 
> The difference between output from 'id' and 'groups' makes me feel dizzy :(
> but when I (logged as buki) specify username (ie. 'id buki') the answer is
> right

I am not sure if I believe that you really, 'logged in as buki again.'
Did you actually log in again as buki and not just go to some already
exisiting session? That would explain the differences. Using groups(1)
(which is a shell script that calls id(1)) or id(1) with a user
argument reads the group(5) file whereas using id(1) with no arguments
tells you what the system believes your group membership in the
current session to be. This would make sense if you did something
like,

  1. Log in as buki
  2. su(1) to root
  3. Make group changes for buki
  4. Exit root shell
  5. Run the above group(1) and id(1) commands

You need to add,

  6. Log out from buki's session
  7. Log is as buki
  8. Run the above group(1) and id(1) commands

And see what happens.
-- 
Crist J. Clark                           cjclark@alum.mit.edu

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010905141146.B321>