|
|
Subscribe / Log in / New account

Bricking systems using rm

Bricking systems using rm

Posted Feb 12, 2016 22:17 UTC (Fri) by jwilk (subscriber, #63328)
In reply to: Bricking systems using rm by anselm
Parent article: Bricking systems using rm

From the fstab(5) manpage:
> If the name of the mount point contains spaces these can be escaped as ‘\040’.
...
> The proper way to read records from fstab is to use the routines getmntent(3) or libmount.


to post comments

Bricking systems using rm

Posted Feb 12, 2016 22:41 UTC (Fri) by anselm (subscriber, #2796) [Link]

If the name of the mount point contains spaces these can be escaped as ‘\040’.

Great, so you have to learn this stuff over and over again for all of the various file formats from /etc/fstab to /etc/crontab to /etc/inetd.conf to /etc/inittab and so on. With systemd, there is one configuration file format which is used for everything, and you only have to learn the basic syntax of that once.

The proper way to read records from fstab is to use the routines getmntent(3) or libmount.

The previous poster suggested that being able to use scanf(3) to parse /etc/fstab was desirable (I don't think so). Also, I'm not entirely convinced that it's a great idea to come up with a completely new set of get*ent() library calls for every configuration file in the system. All of that is extra code that needs to be designed, written, debugged, documented, maintained (for decades), programmed against and so on. It's much easier to have to deal with one single file format only.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds