Live data from Hacker News

Why the Unix newgrp command exists (sort of)

utcc.utoronto.ca

1–10 of 35 posts

Re: Why the Unix newgrp command exists (sort of)

#7
At a previous job, I had to use newgrp quite frequently. There's a limit on the number of "active" groups you can be in at a time, typically 16. Groups were used for permissions for directories on network storage and our version control system at the time. As far as I'm aware, I was the only person at the company affected because I touched so many different repositories, I was a member of around 20 groups. I had to bounce between them using newgrp (albeit without passwords as in TFA).

I forget the exact reason for the limit of 16, but I think it was an NFS limit.

Re: Why the Unix newgrp command exists (sort of)

#8

At a previous job, I had to use newgrp quite frequently. There's a limit on the number of "active" groups you can be in at a time, typically 16. Groups were used for permissions for directories on network storage and our version control system at the time. As far as I'm aware, I was the only person at the company affected because I touched so many different repositories, I was a member of around 20 groups. I had to b…

> There's a limit on the number of "active" groups you can be in at a time, typically 16. Groups were used for permissions for directories on network storage and our version control system at the time.

This is a limitation of NFS, or more specifically AUTH_SYS per RFC 5531 (§A):

* https://tools.ietf.org/html/rfc5531#page-25

A lot (most?) NFS appliances tend to have a setting where you can tell them to ignore the group list that comes in on the RPC call and just do a look-up on the UID themselves: this way they get the full list via LDAP/NIS/AD/whatever and then do permission checks from that.

Re: Why the Unix newgrp command exists (sort of)

#9
I remember years ago the behavior of groups in Solaris was quite different than in Linux or FreeBSD. Some standard functionality required running newgrp in order to be able to execute a file based on fs permissions. It was very annoying.

This was 20ish years ago, so I have no idea what the behavior of now.

Re: Why the Unix newgrp command exists (sort of)

#10

The real question is: why not just suck it up and include that "ou"?

Not sure if it was actually relevant at the time of Unix v6, but Brian Kernighan writes in his memoir that "Arguably, one reason why many commands on Unix are short is that it took considerable physical force to type on a Model 33, and printing was slow. [10 characters/second]"
Post reply on HN