6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

User Private Group (UPG) はいつから存在するのか?

Last updated at Posted at 2024-03-01

はじめに

User Private Group (UPG) がいつから存在するのか調べてみました。この記事はメモ書きみたいなもので User Private Group についての説明はしません。User Private Groupを採用しているのはLinux系だけだと思っていたのですが、よくよく見てみるとFreeBSDでも採用しており、こちらはUNIQUE GROUPS (UNIQ GROUP) と呼んでいるようです。

User Private Group を採用しているUnix/Linux

採用しているOSは以下の通り

  • Red Hat 系 Linux
  • Debian 系 Linux
  • FreeBSD
  • OpenBSD

採用していないOSは以下の通り

  • SUSE Linux
  • macOS
  • Solaris
  • NetBSD

1995年5月のRed Hat Linux 1.0にある

Red Hat Linux 1.0 は当初は Red Hat Commercial Linux と名乗っていたようですが、このバージョンにすでに User Private Group があるようです。

Managing user and groups has traditionally been tedious. RHC Linux has a few tools and conventions that make user and groups easier to manage, and more useful.

補足情報: https://www.linux.co.cr/distributions/red-hat.html

1995年6月のFreeBSD 2.0.5にある

1995 年の FreeBSD 2.0.5 に記述を見つけました。一つ前の FreeBSD 2.0 にはなさそうです。現在は UNIQUE GROUPS と呼ばれていますが当時は UNIQ GROUP だったようです。

Rod Grimes(FreeBSDの最初の3人の開発者の1人)によると当時の10年ぐらい前からこのモデルを使用しているようです。

UNIQ GROUP

Perhaps your missing what *can* be done with this scheme that falls apart with most other schemes. With each user in his/her own group the user can safely run with a umask of 002 and have files created in there home directory and not worry about others being able to read them.

For a shared area you create a seperate uid/gid (like cvs or ncvs on freefall), you place each person that should be able to access this area into that new group.

This model of uid/gid administration allows far greater flexibilty that lumping users into groups and having to muck with the umask when working in a shared area.

I have been using this model for almost 10 years and found that it works for most situations, and has never gotten in the way. (Rod Grimes)

1983年9月の4.2BSDのグループスキーム?

以下のスレッドより 4.2BSD の頃に現在使われている新しいグループスキームが登場したと書かれています。詳しく調べきれていませんが、これが大元になるのかもしれません。

歴史的な Unix は同時に一つのグループにしか所属できませんでした。4.1c/4.2 BSDで最大8個(システムビルドで変更可能)のグループに所属できるようになりました。そこから新しく生まれたグループスキルのような気がします。以下に1983年12月に「とりあえず思いついた方法」としてUPGと同じ?ような方法が提案されています。

ちなみに System V は 1989 年頃の System V Release 4 になるまで複数のグループが使えなかったようです。

おまけ: 一般ユーザーの umask は 0002 (002) とは限らない

UPG を使っているからと言って umask を 0002 にしなければならないわけではありません。0002 にしても安全というだけです。0002 にする必要があるのは他のユーザーとディレクトリを共有して作業をするような場合です。

以下の環境では一般ユーザーの umask は 0022 のようです。

以下の環境では一般ユーザーの umask は 0002 のようです。

  • Ubuntu 23.10
  • AlmaLinux 8

さいごに

UPG はもう少し新しいものだと思っていたのですがかなり古いですね。Linuxカーネルのバージョンが1.0になったのが1994年なので、Linuxが知られるようになったほとんど最初からUPGという名前はあったも言って良いようです。UPGについて調べると Red Hat の名前が出てきますが、考え方自体が登場したのはその10年前ぐらいの BSD にさかのぼるようです。

6
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?