{"id":85,"date":"2012-01-14T19:18:25","date_gmt":"2012-01-14T19:18:25","guid":{"rendered":"https:\/\/trouble.org\/wp\/?p=85"},"modified":"2012-01-26T17:25:07","modified_gmt":"2012-01-26T17:25:07","slug":"85","status":"publish","type":"post","link":"https:\/\/trouble.org\/?p=85","title":{"rendered":"walk like a \/usr\/bin\/man"},"content":{"rendered":"<p>Sometime, probably in the paleozoic era, I wrote a little perl script I just came across again. \u00a0At the time \u00a0I was frustrated by commands in \/bin or \/usr\/bin not having documentation, even on a cleanly installed system&#8230; I guess I would think if something is important enough to install on a system you might want to tell your users what it does&#8230;\u00a0so I thought I&#8217;d look at how good\/bad it was.<\/p>\n<p>The little perl script below tries to run through the important command directories to find man pages in all the usual locations (or your MANPATH vars, also in \/etc\/man**{config,conf,cf} if set). \u00a0 The documentation tends to go down over time (as you install more commands in key places.)<\/p>\n<p>On my current ubuntu system (a now ancient 9.x)<\/p>\n<p><strong>[table id=1\/]<\/strong><\/p>\n<p>Kinda blows. \u00a0Almost 20% undocumented?<\/p>\n<p>On the really blows side of things \/usr\/bin\/screen.real was SGID, \/usr\/bin\/X SGID\/SUID, and \/usr\/bin\/kde_init was SUID. \u00a0 How could you put a SUID program and not put a frickin&#8217; man page?<\/p>\n<p>Back in the day I used to have a table I kept with this stuff with various OS&#8217;s, but I can&#8217;t find it now. \u00a0As I recall commercial systems (such as solaris, etc) did tend to document more. \u00a0Well, what about\u00a0my mac? \u00a0Snow leopard mac (my script doesn&#8217;t look at things in \/Application and \/System&#8230; but there&#8217;s some interesting stuff there too, hmm; until then just looking at\u00a0traditional \/usr\/bin, \/bin, etc. types):<\/p>\n<p><strong>[table id=2\/]<\/strong><\/p>\n<p>Well, 5% isn&#8217;t too bad. \u00a0Note the separate window commands; it used to be more interesting, but at least under my ubuntu \/usr\/X11R6\/bin is just linking back to \/usr\/bin and all the window stuff has been mashed in the general executable areas.<\/p>\n<p>Although&#8230; on my personal system (I ran this on a fresher version) there&#8217;s actually one undocumented SUID: \/usr\/sbin\/qmasterd? \u00a0 Hmm &#8211; &#8220;site:apple.com \u00a0qmasterd -site:discussions.apple.com -site:discussions.info.apple.com&#8221; gives me 6 hits in english. \u00a0None document qmasterd, although it looks like part of the compressor package. \u00a0Shame, apple.<\/p>\n<p>And&#8230; just in, a Centos 5.6, the Red Hat enterprise clone addition.<\/p>\n<p><strong>[table id=3\/]<\/strong><br \/>\nand&#8230; almost 50% of SUID\/SGID without a man page?<\/p>\n<div class=\"codecolorer-container text blackboard\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">\/sbin\/mount.nfs4<br \/>\n\/sbin\/umount.nfs4<br \/>\n\/usr\/bin\/same-gnome<br \/>\n\/usr\/bin\/gnibbles<br \/>\n\/usr\/bin\/iagno<br \/>\n\/usr\/bin\/gnotravex<br \/>\n\/usr\/bin\/gataxx<br \/>\n\/usr\/bin\/gtali<br \/>\n\/usr\/bin\/mahjongg<br \/>\n\/usr\/bin\/gnomine<br \/>\n\/usr\/bin\/gnotski<br \/>\n\/usr\/bin\/gnobots2<br \/>\n\/usr\/bin\/glines<br \/>\n\/usr\/sbin\/userisdnctl<br \/>\n\/usr\/sbin\/ccreds_validate<br \/>\n\/usr\/libexec\/libvirt_proxy<\/div><\/div>\n<p>OK, you might say mount.nfs4 &amp; umount.nfs4 are the same as *mount.nfs, which is documented&#8230; but they actually are different programs, with different sizes and at least some different code. \u00a0 Hmm, 14 unique and 17 total mount commands in \/sbin. \u00a0 Most look like games &#8211; do we still need the SGID bit on those? :)  And&#8230; &#8220;find \/ -perm -4000&#8221; gives two more undocumented ones, \/usr\/*\/nspluginwrapper (actually 2 of those), and \/lib64\/dbus-1\/dbus-daemon-launch-helper.<\/p>\n<p>So down to only 5 or more.  And those 700+ others.<\/p>\n<p>[attachments]<\/p>\n<!-- WP Attachments -->\r\n        <div style=\"width:100%;margin:10px 0 10px 0;\">\r\n            <h3>Attachments<\/h3>\r\n        <ul class=\"post-attachments\"><li class=\"post-attachment mime-application-x-perl\"><a href=\"https:\/\/trouble.org\/wp-content\/uploads\/2012\/01\/man-dir.pl\">man-dir<\/a> <small>(ERROR)<\/small><\/li><\/ul><\/div>","protected":false},"excerpt":{"rendered":"<p>Sometime, probably in the paleozoic era, I wrote a little perl script I just came across again. \u00a0At the time \u00a0I was frustrated by commands in \/bin or \/usr\/bin not having documentation, even on a cleanly installed system&#8230; I guess I would think if something is important enough to install on a system you might [&hellip;]<\/p>\n","protected":false},"author":44,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,33,32,4,6],"tags":[42,43,44],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-code","category-dinosaur","category-mac","category-security","category-tech","tag-back-in-the-day","tag-man-pages","tag-unix"],"_links":{"self":[{"href":"https:\/\/trouble.org\/index.php?rest_route=\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trouble.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trouble.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trouble.org\/index.php?rest_route=\/wp\/v2\/users\/44"}],"replies":[{"embeddable":true,"href":"https:\/\/trouble.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=85"}],"version-history":[{"count":24,"href":"https:\/\/trouble.org\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":97,"href":"https:\/\/trouble.org\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions\/97"}],"wp:attachment":[{"href":"https:\/\/trouble.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trouble.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trouble.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}