News for hackers. Stuff that matters.
Re:The Unix-Haters Handbook [pdf] by kelnos on Monday April 22, 2024 @02:07AM (#40111775)
When I was much younger I used to find this funny and entertaining, but nowadays I just find it boring. It always seems fashionable to hate on things, and I'm just tired of the depressing, defeatist attitudes that support that fashion.

I do wonder, though, if this were (re)written today, how much of it would be the same, how much of it would be outdated, and how much new stuff the haters would come up with.

The chapter on file systems is mostly no longer relevant (some file systems do still suck, but the defaults are pretty solid now). NFS still sucks (IMO it sucks more than it used to), but far fewer people need to use it nowadays. C and C++ are still unfortunately prevalent, but there are at least quite a few systems programming alternatives, and they're gaining ground. Sendmail isn't the only game in town anymore, and I expect most outfits use something else these days, and USENET is a distant memory for most people, so there go another two chapters.

But then the terminal/TTY situation has barely changed, and how all that works is just as (if not more) divorced from the reality of daily usage. Security has improved, but most people still have a god-mode root account, and most of the security improvements have come out of necessity; the world of networked computing is much more "dangerous" today than it was in the early 90s. Documentation is still often poor, and many systems still seem designed more for programmers than less-technical users.

I wonder what they'd think of systemd and Wayland!

Re:The Unix-Haters Handbook [pdf] by lubutu on Monday April 22, 2024 @02:25AM (#40111854)
> NFS still sucks (IMO it sucks more than it used to)

Any chance you could elaborate?

Re:The Unix-Haters Handbook [pdf] by kelnos on Monday April 22, 2024 @02:32AM (#40111879)
Several of the criticisms the book lists are still true today. File locking is unreliable, deletions are weird, security is either garbage (in that you set it up in a way where there's very little security) or trash (in that you have to set up Kerberos infrastructure to make it work, and no one wants to have to do that).

Perhaps I was a bit hyperbolic about it sucking more nowadays. At least you can use TCP with it and not UDP, and you can configure it so you can actually interrupt file operations when the server unexpectedly goes away and doesn't come back, instead of having to reboot your machine to clear things out. But most of what the book says is still the NFS status quo today, 30 years later.

Re:The Unix-Haters Handbook [pdf] by chungy on Monday April 22, 2024 @04:37AM (#40112453)
Everything you listed was fixed in NFSv4. Don't use the ancient versions of NFS.
Re:The Unix-Haters Handbook [pdf] by yrro on Monday April 22, 2024 @04:47AM (#40112514)
We're not there with authentication yet (although I've no problem with Kerberos myself).
Re:The Unix-Haters Handbook [pdf] by kiney on Monday April 22, 2024 @05:14AM (#40112627)
easist way nowadays to get secure NFS is to just set up a wireguard tunnel
Re:The Unix-Haters Handbook [pdf] by yrro on Monday April 22, 2024 @05:32AM (#40112697)
No because you still have to trust the client.

With Kerberos a hacked client where user 1 has authenticated can't impersonate user 2 unless that user has also authenticated on the client.

With sec=sys the client is simply trusted without any per-user authentication.

Re:The Unix-Haters Handbook [pdf] by kiney on Wednesday April 24, 2024 @06:59AM (#40142875)
in most cases you can just use more fine-grained exports. e.g. export /home/user1 to 10.0.0.1 and /home/user2 to 10.0.0.2 instead of /home to 10.0.0.0/24 etc.
Re:The Unix-Haters Handbook [pdf] by gnufx on Monday April 22, 2024 @10:30AM (#40114743)
How are we not there? The only real issue I know is allegedly requiring host keys for gssd (e.g. "joining the domain"), but rpc.gssd(8) documents "anyname" principals.
Re:The Unix-Haters Handbook [pdf] by yrro on Monday April 22, 2024 @01:26PM (#40116588)
The only per-user authentication option is Kerberos. Username/password based authentication is not possible.
Re:The Unix-Haters Handbook [pdf] by gnufx on Tuesday April 23, 2024 @04:46PM (#40137055)
That seems like a feature; mounting SMB is done on a local system on the basis of password, and it's horrible. (I assume you could, in principle, use some other GSSAPI mechanism.)
Re:The Unix-Haters Handbook [pdf] by lubutu on Monday April 22, 2024 @11:26AM (#40115284)
There has been recent work on RPC-with-TLS (RFC 9289), xprtsec=mtls.
Re:The Unix-Haters Handbook [pdf] by yrro on Tuesday April 23, 2024 @08:19AM (#40131080)
AIUI this is still not user level authentication. It rather secures the communication between hosts, but you still have to choose between sec=sys ("trust me bro") or sec=krb5* at the upper layer.
Re:The Unix-Haters Handbook [pdf] by anthk on Monday April 22, 2024 @03:04AM (#40112014)
On Unix and the rest of the comment: plan9/9front superseded it well:

- 9p+encryption on top instead of NFS, much better.

- C under plan9 it's far better and easier than POSIX. Also, we had Golang under Unix which almost made that better C philosophy into Unix with a better systems language.

- Usenet/IRC works and you'll get far more trolls under the web.

- The terminal makes things better in most cases than freezing UI's or Emacs, see my another post. But 9front doesn't use terminals, it's graphical from the start and composable.

- On security, plan9/9front uses namespaces and factotum plus decoupled servers/devices for hardware, a much better design.

- On documentation, the rest of the OSes have it far worse. But it was almost the same case with ITS and Macsyma/Maclisp, where you had a reference book and not starting guides to ease the learning of the language. GNU Texinfo made at least an Elisp intro a Maxima it's far better docummented wth on-line guides and examples.

- SystemD it's a disaster, and Wayland destroys any scriptabilily/hacks with wmctrl/xdotool/custom WM/DE's or something simple like remapping keys on broken keyboards (I use the "<>" key as "\ |" as my physical one it's broken, and I already have < and > near 'm') and it works.

Re:The Unix-Haters Handbook [pdf] by jclulow on Monday April 22, 2024 @04:35AM (#40112446)
> 9p+encryption on top instead of NFS, much better

NFS with IPsec for authentication and privacy seems similar in principle, with the added benefit that it's widely available.

Re:The Unix-Haters Handbook [pdf] by gnufx on Monday April 22, 2024 @10:32AM (#40114765)
Re:The Unix-Haters Handbook [pdf] by MisterTea on Monday April 22, 2024 @02:38PM (#40117372)
> NFS with IPsec for authentication and privacy seems similar in principle,

But a total hack and duct taped together.

> with the added benefit that it's widely available.

On plan 9/ 9front 9p over TLS is out of the box. ipsec isnt.

Re:The Unix-Haters Handbook [pdf] by boxed on Monday April 22, 2024 @04:50AM (#40112522)
> The chapter on file systems is mostly no longer relevant (some file systems do still suck, but the defaults are pretty solid now)

Really? Afaik filesystems still do `rm` immediately and with no recourse. GUIs on top like Finder and Explorer do something more sane though, but that doesn't save us terminal users.

POSIX shell expansion is just as crazy as it has ever been too.

Those are the two gigantic foot guns I can recall from memory from having read this 20 years ago.

Re:The Unix-Haters Handbook [pdf] by isametry on Monday April 22, 2024 @05:36AM (#40112711)
I know this is a discussion of Unix in general, but on your own Mac, you can get `trash` packages for the terminal [0] [1].

I use the former, I haven’t tried the latter. But afaict, they should be pretty much identical – they both supply `trash <path>` which could, for most intents and purposes, probably be aliased as `rm`.

One thing to note is that none of these tools seem to support the “Put Back” feature of Finder. Trashed files don’t remember their original locations. But I’ll personally still choose that over being nervous before every `rm`.

[0] – https://formulae.brew.sh/formula/trash [1] – https://formulae.brew.sh/formula/macos-trash

Re:The Unix-Haters Handbook [pdf] by boxed on Tuesday April 23, 2024 @05:21AM (#40130070)
Yea sure.. but again a big recurring theme of The Unix Haters Manual is "broken by default". That things can be fixed isn't the point, if the fix is local, ephemeral, easily forgotten, and the fix not being implemented is blamed on the user because "you can fix it".

Broken by default is itself exactly the problem.

Re:The Unix-Haters Handbook [pdf] by skissane on Monday April 22, 2024 @05:22AM (#40112659)
I think some of its criticisms (see e.g. pages numbered 20-21, PDF pages 60-61) remain valid:

(1) Unlike OpenVMS/TOPS-20/LispMachines/etc, mainstream POSIX file systems lack built-in versioning (there are a small number of POSIX systems which implemented it, e.g. SCO OpenServer's HTFS, but for whatever reason more mainstream systems like Linux or *BSD never did)

(2) Directly related to (1), the fact that the unlink() system call is normally irreversible, and the rm command is (normally) a direct interface to unlink()

(3) The simplicity of the interface between the shell and the commands it runs (just a list of strings, only slightly better than the DOS/Windows approach of a single string), and the potential issues induced by the fact that wildcards are implemented by the shell not the command itself.

Regarding (3), OpenVMS DCL, IBM OS/400 and Microsoft PowerShell are all examples of systems where option parsing/etc happens in the shell, and the command is passed a parsed command line structure instead. However, although they are better in this regard, they have other disadvantages (the first two are super-proprietary; PowerShell is open source, but weighed down by the heaviness of .Net)

I think a lot of historical issues with Unix are due to the fact that shared libraries didn't exist until much later, so seemingly obvious things like "put wildcard parsing in a shared library like getopt() is" weren't possible at the start. Also, Unix has never had any kind of standard structured data format (JSON would work, but it didn't exist for the first 30 years of Unix's existence), which is a problem for ideas like passing command arguments as structured data.

> But then the terminal/TTY situation has barely changed,

POSIX TTYs are a horrific pile of kludges, especially when one considers stuff like ECMA-48 (which isn't technically part of the POSIX TTY stack, but de facto is). Someone should just redo it as something more sensible, like exchanging null-terminated JSON packets. But getting everyone to agree on that is probably too hard.

Re:The Unix-Haters Handbook [pdf] by nusuth31416 on Monday April 22, 2024 @06:09AM (#40112867)
From the point of view of an end user, I remember versioning on the Vax using EDT when I spent hours on end entering data from our local emergency department in quite large text files. Over the years, every now and then I have been looking for this functionality on Windows.

Dropbox and OneDrive do this nowadays, in that I can just right click a file and see the different versions and change to a previous one. I work with long documents I write, and this functionality has saved the day a few times.

Re:The Unix-Haters Handbook [pdf] by anthk on Monday April 22, 2024 @07:53AM (#40113457)
OpenDCL for Unix:

https://github.com/johnsonjh/PC-DCL

patch: https://0x0.st/XoDG.patch

         git clone https://github.com/johnsonjh/PC-DCL
         cd PC-DCL
         wget -O corr.patch https://0x0.st/XoDG.patch
         git apply corr.patch
         make NDBUG=1 
Enjoy.
Re:The Unix-Haters Handbook [pdf] by Bene592 on Monday April 22, 2024 @05:34AM (#40112700)
For (1) there's stuff like BTRFS snapshots, or you could use Git on top of the FS
Re:The Unix-Haters Handbook [pdf] by skissane on Monday April 22, 2024 @05:48AM (#40112765)
> For (1) there's stuff like BTRFS snapshots,

From what I understand, BTRFS snapshots are time-based. Whereas, in classic versioned file systems, a "snapshot" is triggered by open/close operations – each time you open a file for writing, that creates a new snapshot.

> or you could use Git on top of the FS

Git requires your application to have explicit support for working with Git repos, it isn't seamless. And I know some people have built FUSE-on-Git implementations (there are a few around), but (I believe) they've all got various limitations and I don't believe (I could be wrong) that any of them is quite the same experience as a true versioned filesystem

Re:The Unix-Haters Handbook [pdf] by rini17 on Monday April 22, 2024 @12:05PM (#40115662)
Since mmap I/O is popular, together with long lived processes like databases, snapshot on open/close might not help you much.

With these caveats, using FUSE it should be easy to do, wonder why noone actually implemented it.

Re:The Unix-Haters Handbook [pdf] by skissane on Monday April 22, 2024 @05:48PM (#40121531)
> Since mmap I/O is popular, together with long lived processes like databases, snapshot on open/close might not help you much.

Classic versioned file systems were generally not designed for the use case of databases, they were designed for the use case of lots of small text files (config files, source code, shell scripts, etc). For something like a database file you would turn versioning off

Re:The Unix-Haters Handbook [pdf] by anthk on Monday April 22, 2024 @07:20AM (#40113236)
I think the OpenVMS's DCL interface has a libre implementation. I've seen things like mpsh and the ITS debugger/shell (DDT) ported to Unix...
Re:The Unix-Haters Handbook [pdf] by skissane on Monday April 22, 2024 @07:47AM (#40113393)
> I think the OpenVMS's DCL interface has a libre implementation.

I know about https://github.com/rroart/freevms/tree/master/dcl/src but my impression was FreeVMS is too incomplete to use in anger.

> I've seen things like mpsh

You mean https://cca.org/mpsh/ ? I am wondering how close it is to DCL, in terms of the specific aspect of it I’m talking about here

> and the ITS debugger/shell (DDT) ported to Unix...

Do you have a link?

One aspect of ITS I find fascinating is a debugged program can execute debugger commands. I actually implemented that before using a GDB Python script - have a do-nothing function passed a memory buffer containing a GDB command go run, the Python script sets a breakpoint on the function, and when that breakpoint is hit, it runs the GDB command, it can even write the results back into the buffer, and then it continues execution

Re:The Unix-Haters Handbook [pdf] by anthk on Monday April 22, 2024 @08:06AM (#40113547)
Re:The Unix-Haters Handbook [pdf] by tankenmate on Monday April 22, 2024 @12:02PM (#40115627)
Just reading about DDT reminds me of the "WizBiz"[0] series of fantasy novels, it's funny how just the mention of something from so long ago can evoke memories.

[0] https://tvtropes.org/pmwiki/pmwiki.php/Literature/WizBiz

Re:The Unix-Haters Handbook [pdf] by anthk on Tuesday April 23, 2024 @06:29AM (#40130330)
DDT in the 60's was a bug killing spray which soon was banned because it was toxic.
Re:The Unix-Haters Handbook [pdf] by eadmund on Monday April 22, 2024 @10:08AM (#40114549)
> Also, Unix has never had any kind of standard structured data format (JSON would work, but it didn't exist for the first 30 years of Unix's existence), which is a problem for ideas like passing command arguments as structured data.

JSON is a serialisation of structured data, not structured data itself.

Its data model is not great, either: maps have no inherent canonical serialisation (one has to assert things such as ‘keys are sorted in Unicode lexicographical order’), and there is no way to shadow map value.

A list-based s-expression format would be preferable, as it immediately lends itself to canonicalisation and associative lists support shadowing (e.g. ((a 123) (b 456) (a 789))).

Re:The Unix-Haters Handbook [pdf] by msla on Monday April 22, 2024 @11:38AM (#40115404)
> Unlike OpenVMS/TOPS-20/LispMachines/etc, mainstream POSIX file systems lack built-in versioning

We have git, which is strictly better.

> Directly related to (1), the fact that the unlink() system call is normally irreversible, and the rm command is (normally) a direct interface to unlink()

You'd be complaining about how a really_really_unlink_now_i_mean_it() syscall was irreversible, too.

> and the potential issues induced by the fact that wildcards are implemented by the shell not the command itself.

I like not having to rely on arbitrary commands implementing (or not) wildcards.

(Plus, even in the best of worlds, all commands would implement wildcards by linking in the same library, which brings us back to square one.)

Re:The Unix-Haters Handbook [pdf] by tankenmate on Monday April 22, 2024 @11:58AM (#40115591)
Firstly, largely agree.

> You'd be complaining about how a really_really_unlink_now_i_mean_it() syscall was irreversible, too.

Or the converse; what file (or worse hundreds/thousands of files) is using up all my disk and what's the sane way to delete all the old versions, and which files are important to keep all the old versions of?

> I like not having to rely on arbitrary commands implementing (or not) wildcards.

Indeed and being able to use meta tools like xargs. "The unreasonable effectiveness of plain text".

Re:The Unix-Haters Handbook [pdf] by anthk on Monday April 22, 2024 @04:30PM (#40119885)
>git... No, and you know it. ITS' versioning (or VMS/TOPS-20 too I think) it's tons better. Even 9front has it.
Re:The Unix-Haters Handbook [pdf] by yjftsjthsd-h on Monday April 22, 2024 @02:21PM (#40117172)
> (1) Unlike OpenVMS/TOPS-20/LispMachines/etc, mainstream POSIX file systems lack built-in versioning (there are a small number of POSIX systems which implemented it, e.g. SCO OpenServer's HTFS, but for whatever reason more mainstream systems like Linux or *BSD never did)

Linux does have that in NILFS2, it's just that almost nobody cares to use it: https://www.kernel.org/doc/html/latest/filesystems/nilfs2.ht... / https://man.archlinux.org/man/nilfs.8.en

Re:The Unix-Haters Handbook [pdf] by skissane on Monday April 22, 2024 @05:45PM (#40121440)
> Linux does have that in NILFS2, it's just that almost nobody cares to use it

I don’t believe that NILFS2 is quite the same thing.

In HTFS, you turn versioning on or off on a per-directory basis, and then each individual file in that directory is versioned independently.

NILFS2 looks more like whole filesystem snapshotting, which is further away from the classic versioned filesystem approach

Re:The Unix-Haters Handbook [pdf] by nurettin on Monday April 22, 2024 @05:36AM (#40112708)
> C and C++ are still unfortunately prevalent

come now, they look nothing like they were 30 years ago.

Re:The Unix-Haters Handbook [pdf] by anthk on Monday April 22, 2024 @08:32AM (#40113730)
Don't confuse C and C++ because C99 covers a lot and it's 25 years old.
Re:The Unix-Haters Handbook [pdf] by nurettin on Tuesday April 23, 2024 @05:38AM (#40130172)
That's how long I've been using C++. I would appreciate more chariable interpretations.
Re:The Unix-Haters Handbook [pdf] by anthk on Tuesday April 23, 2024 @11:14AM (#40132882)
C and C++ are different enough.
Re:The Unix-Haters Handbook [pdf] by nurettin on Wednesday April 24, 2024 @01:06AM (#40140790)
Yes I know, I'm glad you're noticing the distinction. Just take them as a whole.
Re:The Unix-Haters Handbook [pdf] by rho4 on Monday April 22, 2024 @06:10AM (#40112875)
Went through the same progression with Dilbert comics. Colleagues with a positive general attitude are priceless.
Re:The Unix-Haters Handbook [pdf] by msla on Monday April 22, 2024 @11:35AM (#40115374)
I can't get over the idea that this is a bunch of people who were angry their favorite proprietary systems got killed by open standards and, ultimately, open source. Compatibility and not being dependent on a single company are good things!
Re:The Unix-Haters Handbook [pdf] by rini17 on Monday April 22, 2024 @12:03PM (#40115640)
When the book was written most of the UNIX world was proprietary too, GNU and BSD existed but were marginal.
Re:The Unix-Haters Handbook [pdf] by panick21_ on Monday April 22, 2024 @01:36PM (#40116671)
X was a partial example. It did kill NeWS thanks to being open and Sun not willing to open it up.