Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Setuid in Unix created to enable a game (tuhs.org)
93 points by zdw on Feb 4, 2023 | hide | past | favorite | 24 comments


The history blurb in the Wikipedia article for setuid doesn't conflict, confirms a bit, and adds some details:

      The setuid bit was invented by Dennis Ritchie and included in su. His employer, then Bell Telephone Laboratories, applied for a patent in 1972; the patent was granted in 1979 as patent number US 4135240 "Protection of data file contents." The patent was later placed in the public domain.[1]
[1] https://en.wikipedia.org/wiki/Setuid#History


Man parents are insane. How could something like that possibly be patentable? How does giving gigantic companies monopoly on a fucking setuid bit do us any good?

Do/did intelligent people like Dennis Ritchie really not feel any discomfort by the fact that their great work robs the world of that very work through the parent system?


No that's not the insane part. The insane part is that this is the only patent that came out of entire Research UNIX project [1].

[1] See the answer to question 25 on Rob Pike's blog: https://commandcenter.blogspot.com/2020/01/unix-quiz-answers....


> How could something like that possibly be patentable?

If, _back_then_, it was new, non-obvious to a person having ordinary skill in the art (https://en.wikipedia.org/wiki/Person_having_ordinary_skill_i...), and not the only way to do what it does, why wouldn’t it?

Now, was it, back then? I wouldn’t know, but I think there is a decent chance it was.


I should probably have been more clear, but I'm not that concerned about whether it's patentable from a legal perspective as patent law currently exists. Clearly current laws are interpreted to allow such patents. I'm more concerned about, why do we think it's a Good Thing™ that companies just get state-enforced legal monopolies over those kinds of ideas.


Not just companies, people. That's why. It means that if I came up with a really novel way to solve the problem of protecting file contents I, an individual, can protect myself from some massive company just copying the idea and selling it.

As with most laws there's good and bad.


I wasn't concerning myself with people here, but with companies. Corporations are not people. Whether patents are appropriate for the lone independent inventor is its own discussion.


Once a person starts the company they typically sign the patent over to it although they are still listed as the investors. This is how intellectual property works.

It would be very difficult to have a patent system where patents are owned exclusively by individuals, especially single individuals.


I don't understand why you are saying this. The issue I brought up was giving a state-backed legal monopoly of a basic idea to a company. I have not said I'm in favour of giving a similar monopoly to an individual, just that it's a different discussion which frankly isn't very relevant here since the patent in question is owned by AT&T and NCR.

But to address what you said directly, I don't think it would be hard to have a system where patents are owned by an individual rather than a corporation. There's no fundamental law of the universe which says that patents must be assignable to corporations, or that patents must be assignable to someone other than the inventor at all. Though again, I am not advocating for such a system, and again, I am not sure why you are bringing it up.


Let’s establish the principle first: could a person patent it?


It's possible Bell Labs had the patent but also was entirely open to others using the idea freely.


So is it good to give a company the state-backed legal monopoly on the idea of a permission bit to run an executable as a different user, as long as the company elects to be real nice about it?


Yeah i don’t get that either, and agree that it does seem weird.

maybe it was one of those that slipped through the patent office as outside their true expertise?


It's novel and useful.


Notice the author of this message!

This mailing list is full of actual legends, speaking casually about minutiae of unix history. Do not go there unless you have a strong antidote against time sinks.


Later on early GNU/Linux games followed the same idea by requiring setuid to use games written against SVGALib.


I think it's worth pointing out, in case it's not clear to people, that the SUID file mode bit is not synonymous with elevating to root privileges. Many programs use SUID or SGID to switch permissions to non-root users and groups. For example, games often use SUID or SGID so they can write to a shared scores files owned by, e.g., a "games" user or group. In such cases root privileges are never involved, not even to pivot.

I prefer "SUID" to "setuid" because setuid is also a syscall and in fact the setuid syscall is more often used to drop privileges. In fact, in order to use setuid to elevate privileges a process needs to have already had that UID/GID as its saved UID/GID. Also, with all due respect to Douglas McIlroy (who of course is one of the fathers of Unix), the patent by Dennis Ritchie mentioned elsewhere refers to "SUID", not "setuid". Wikipedia treats SUID and setuid synonymously, too, but this is one of those times where Wikipedia should be a little more pedantic, notwithstanding the popular usage of "setuid" to refer to both concepts; especially because in practice they're typically referring to completely opposite changes in direction of privileges.


That's because direct i/o and device access for VGA card manipulation requires root access, it's not directly relates to file permissions. Same with X11 servers for the longest time (until the kernel started providing APIs for this)


Devices are files on UNIX, as we all know from its design.

It was more due to lack of userspace APIs for graphics programming than anything else.


Minor nitpick from someone who wrote device drivers at a FAANG whose name starts with A and who is not based in Seattle: devices can have a presence as a device special file in the filesystem, but they might be not represented in the filesystem also...they might be hiding down some hardware bus, for example.


Depends on which UNIX.


Eh you also need to call iopl() which is a privileged operation, it's not just about file permissions


It is a Linux specific API.


On x86, i/o permissions could easily be delegated to a user-level task; although you'd need some mechanism to request/grant the access, as you probably wouldn't want to allow all programs to access the i/o ports. You'd probably need a mechanism to disable the built in VGA console as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: