<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Truly read-only viewer like more or vi? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747181#M753534</link>
    <description>hai Danny&lt;BR /&gt;&lt;BR /&gt;Lynx is a ocean.. if you are not familiar with that you might end up having more troubles...&lt;BR /&gt;&lt;BR /&gt;you can get more or less the same functions using basic unix commands&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;george</description>
    <pubDate>Thu, 27 Jun 2002 14:37:01 GMT</pubDate>
    <dc:creator>George Abraham_1</dc:creator>
    <dc:date>2002-06-27T14:37:01Z</dc:date>
    <item>
      <title>Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747155#M753508</link>
      <description>Hi, folks -&lt;BR /&gt;&lt;BR /&gt;Do any of you know of a read-only editor like vi/less/more/rvim/rvi?  I guess I don't want an editor at all, but a secure ascii file viewer - without shell escapes or command execution - that otherwise acts like vi.  I've been over a few items, but I've found problems with each:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; rview allows saves with a !, i.e., "wq!"&lt;BR /&gt;&amp;gt; more allows calling vi (or other editor) with 'v'.&lt;BR /&gt;&amp;gt; less ditto.&lt;BR /&gt;&amp;gt; Various options on vim including -Z -R, etc. still allow saving files with "wq!"&lt;BR /&gt;&amp;gt; pg -r behaves differently than vi (learning curve for my users).&lt;BR /&gt;&lt;BR /&gt;Any ideas are greatly appreciated.  HP-UX-only ideas supremely appreciated.</description>
      <pubDate>Tue, 18 Jun 2002 14:53:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747155#M753508</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-06-18T14:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747156#M753509</link>
      <description>Hi Daniel&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Did you try view , man view .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Tue, 18 Jun 2002 14:57:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747156#M753509</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-06-18T14:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747157#M753510</link>
      <description>view allows "wq!" - and shell escapes.&lt;BR /&gt;&lt;BR /&gt;As part of the charityware package vim, there are rvim and rview, which cut off the shell escapes:&lt;BR /&gt;&lt;BR /&gt;:shell&lt;BR /&gt;:!ksh&lt;BR /&gt;&lt;BR /&gt;However, I can still do:&lt;BR /&gt;&lt;BR /&gt;:w!&lt;BR /&gt;&lt;BR /&gt;And overwrite files.</description>
      <pubDate>Tue, 18 Jun 2002 15:02:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747157#M753510</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-06-18T15:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747158#M753511</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;What about cat &lt;FILENAME&gt; | more  ??&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paula&lt;/FILENAME&gt;</description>
      <pubDate>Tue, 18 Jun 2002 15:19:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747158#M753511</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2002-06-18T15:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747159#M753512</link>
      <description>Take a look at "mas" from the HPUX porting center. I remembered using it at one point in time. It's relatively simple and the way to run it is just "./mas filename". It brings up X and you have capbility to search within the viewer. I think it does not allow you to modify and save the file (so strictly viewing).&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Editors/mas-1.0/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Editors/mas-1.0/&lt;/A&gt;</description>
      <pubDate>Tue, 18 Jun 2002 15:21:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747159#M753512</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-06-18T15:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747160#M753513</link>
      <description>Or just&lt;BR /&gt;more /path/to/filename&lt;BR /&gt;all by itself.&lt;BR /&gt;You can search w/more - just use the "/" as you would in vi as well as go to line numbers using "G".&lt;BR /&gt;&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 18 Jun 2002 15:24:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747160#M753513</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-06-18T15:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747161#M753514</link>
      <description>more in the case of 'cat x | more' does prevent file overwriting.  This is good.&lt;BR /&gt;&lt;BR /&gt;However, I can still do:&lt;BR /&gt;&lt;BR /&gt;!ksh&lt;BR /&gt;&lt;BR /&gt;I will look at mas.  Does it look like vi?</description>
      <pubDate>Tue, 18 Jun 2002 15:24:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747161#M753514</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-06-18T15:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747162#M753515</link>
      <description>more in the case of 'more x' ...&lt;BR /&gt;&lt;BR /&gt;Try pressing the 'v' key while viewing a file with more.  This throws you into your editor - vi typically.  This is not the desired behavior.</description>
      <pubDate>Tue, 18 Jun 2002 15:27:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747162#M753515</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-06-18T15:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747163#M753516</link>
      <description>mas is for GUIs.  I neglected to mention that the system I'm on is almost completely terminal based.</description>
      <pubDate>Tue, 18 Jun 2002 15:29:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747163#M753516</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-06-18T15:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747164#M753517</link>
      <description>Looks like a regular hpterm/xterm window and all it has for it's menu bar (on top) are ..&lt;BR /&gt;- find (to find a certain text match)&lt;BR /&gt;- find same (not sure what's this)&lt;BR /&gt;- copy (presumbly allows you to copy text from this viewer to another window or editor)&lt;BR /&gt;- quit&lt;BR /&gt;- about&lt;BR /&gt;There is no other options for save/edit/cut/paste. It allows you to scroll the window text.</description>
      <pubDate>Tue, 18 Jun 2002 15:35:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747164#M753517</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-06-18T15:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747165#M753518</link>
      <description>Hi Daniel:&lt;BR /&gt;&lt;BR /&gt;If you want to defeat the shell escape, you could create a wrapper for 'vi' for your users that sets the SHELL variable to null, exports it and then invokes 'vi':&lt;BR /&gt;&lt;BR /&gt;#/usr/bin/sh&lt;BR /&gt;export SHELL=&lt;BR /&gt;vi $1&lt;BR /&gt;exit 0&lt;BR /&gt;#.end &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 18 Jun 2002 15:35:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747165#M753518</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-06-18T15:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747166#M753519</link>
      <description>Daniel,&lt;BR /&gt;&lt;BR /&gt; Yep, you're right.&lt;BR /&gt;I was not aware of that.&lt;BR /&gt;Learned something new today.&lt;BR /&gt;&lt;BR /&gt;A point I would make is that even *if* you find a suitable candidate, there is no substitute for proper dir/file perms. The user can still do&lt;BR /&gt;&amp;gt; filename&lt;BR /&gt;&amp;amp; poof it's zeroed.&lt;BR /&gt;You can keep them out of shells, but it sounds like you don't. &lt;BR /&gt;Definitely attack this on both fronts.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 18 Jun 2002 15:36:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747166#M753519</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-06-18T15:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747167#M753520</link>
      <description>Hi Daniel&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What about strings filename | more&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Tue, 18 Jun 2002 15:36:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747167#M753520</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-06-18T15:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747168#M753521</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Instead of them viewing the file let them view a copy of it which is discarded afterwards.&lt;BR /&gt;&lt;BR /&gt;so they see:-&lt;BR /&gt;&lt;BR /&gt;view xyz&lt;BR /&gt;&lt;BR /&gt;But in the background:-&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cp xyz /tmp/tmpxyz&lt;BR /&gt;more /tmp/tmpxyz&lt;BR /&gt;rm /tmp/tmpxyz&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Just an idea&lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;  &lt;BR /&gt;</description>
      <pubDate>Tue, 18 Jun 2002 15:38:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747168#M753521</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2002-06-18T15:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747169#M753522</link>
      <description>Jeff, you are correct - there is no substitute for correct permissions.  However, consider the following scenario:&lt;BR /&gt;&lt;BR /&gt;I've got a SUID root program that allows a particular set of users to 'view' a file - otherwise unviewable.  I don't want them to be able to change the file, nor escape to a shell.&lt;BR /&gt;&lt;BR /&gt;James, I wish there were a rating for coolness.  The null SHELL wrapper is a very good idea.  THANK YOU!!!  This gets me half-way there.&lt;BR /&gt;&lt;BR /&gt;Now, I can reduce the question to:&lt;BR /&gt;&lt;BR /&gt;Is there an editor which does not allow overwriting with "w!"?  I think that this has been covered with the 'cat x | more'.&lt;BR /&gt;&lt;BR /&gt;So, I try a script like:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;cat $1 | SHELL="/dev/null" /usr/bin/more&lt;BR /&gt;&lt;BR /&gt;and I have the results:&lt;BR /&gt;&lt;BR /&gt;'v' produces: "Cannot edit standard input  (press RETURN)"&lt;BR /&gt;&lt;BR /&gt;'!ksh' produces: "sh: /dev/null: Execute permission denied."&lt;BR /&gt;&lt;BR /&gt;And I am happy, unless I'm missing some other escape from more.  10 points to whomever has an alternate suggestion or can quantify the answer more concisely!</description>
      <pubDate>Tue, 18 Jun 2002 15:55:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747169#M753522</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-06-18T15:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747170#M753523</link>
      <description>I can't think of anything like what you're looking for either... but...&lt;BR /&gt;&lt;BR /&gt;You could always get the source code to 'vi' from a Linux or FreeBSD system (it's downloadable for free), and modify it to disallow saving, shell escapes, etc.&lt;BR /&gt;&lt;BR /&gt;It would be some work, but it might not be as bad as you think.  I've done things like that a lot.&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Jun 2002 16:13:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747170#M753523</guid>
      <dc:creator>Vincent Fleming</dc:creator>
      <dc:date>2002-06-18T16:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747171#M753524</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Another option, but will only work on files that are satatic.&lt;BR /&gt;&lt;BR /&gt;When a user selects to view a file by whatever method then take away its write capability:-&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So if file is normally :-&lt;BR /&gt;&lt;BR /&gt;-rwxrwxrwx 1 root sys 4492 Dec 15  2000 vm2&lt;BR /&gt;&lt;BR /&gt;As it is selected to view chmod it to:-&lt;BR /&gt;&lt;BR /&gt;-r-xr-xr-x 1 root sys 4492 Dec 15  2000 vm2&lt;BR /&gt;&lt;BR /&gt;And restore it on their exit.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Jun 2002 16:19:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747171#M753524</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2002-06-18T16:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747172#M753525</link>
      <description>If the files are static you could always mount them on a read-only filesystem.  This sounds weird but we had a read-only database and mounted the data as above.  &lt;BR /&gt;&lt;BR /&gt;Ive even activated whole volume groups as read-only (vgchange -a r &lt;VG&gt;) for sanity checks &amp;amp; stuff.&lt;BR /&gt;&lt;BR /&gt;just a thought&lt;BR /&gt;&lt;BR /&gt;Tim&lt;BR /&gt;&lt;BR /&gt;&lt;/VG&gt;</description>
      <pubDate>Tue, 18 Jun 2002 18:58:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747172#M753525</guid>
      <dc:creator>Tim D Fulford</dc:creator>
      <dc:date>2002-06-18T18:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747173#M753526</link>
      <description>Paula, &lt;BR /&gt;&lt;BR /&gt;Changing the rights on the file is easily overcome with "w!".&lt;BR /&gt;&lt;BR /&gt;Tim, &lt;BR /&gt;&lt;BR /&gt;Though interesting, the mount solution is highly impractical.&lt;BR /&gt;&lt;BR /&gt;Thanks for the replies.</description>
      <pubDate>Tue, 18 Jun 2002 19:11:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747173#M753526</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-06-18T19:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Truly read-only viewer like more or vi?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747174#M753527</link>
      <description>Hi,&lt;BR /&gt;well I think you nearly have everything found you need.&lt;BR /&gt;To "more" from a pipe is quite safe, esp. if "vi" is not call-able at all, because it can not read from a pipe.&lt;BR /&gt;&lt;BR /&gt;A point you might keep in mind is that the real problem with "vi" in a suid-root script might not be&lt;BR /&gt;:wq!&lt;BR /&gt;but&lt;BR /&gt;:w/dev/rdsk/c....!     -- DO NOT TEST THIS !!!&lt;BR /&gt;&lt;BR /&gt;You should consider a cronjob or some other kind of interface, that "chown"s this file you like to give away to seperate non-root account and call your script with a special suid-accessuser.&lt;BR /&gt;&lt;BR /&gt;Play it safe&lt;BR /&gt;Volker</description>
      <pubDate>Tue, 18 Jun 2002 19:12:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/truly-read-only-viewer-like-more-or-vi/m-p/2747174#M753527</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2002-06-18T19:12:24Z</dc:date>
    </item>
  </channel>
</rss>

