<?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 Not allowing ENTER as an option in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468769#M704802</link>
    <description>Hello everyone,&lt;BR /&gt;&lt;BR /&gt;I have written a script that asks the user for input.  I want to make it so that the user cannot simply hit the ENTER key to the input to continue.  How can I do this?  Thanks.</description>
    <pubDate>Fri, 21 Jan 2005 20:50:44 GMT</pubDate>
    <dc:creator>TheJuiceman</dc:creator>
    <dc:date>2005-01-21T20:50:44Z</dc:date>
    <item>
      <title>Not allowing ENTER as an option</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468769#M704802</link>
      <description>Hello everyone,&lt;BR /&gt;&lt;BR /&gt;I have written a script that asks the user for input.  I want to make it so that the user cannot simply hit the ENTER key to the input to continue.  How can I do this?  Thanks.</description>
      <pubDate>Fri, 21 Jan 2005 20:50:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468769#M704802</guid>
      <dc:creator>TheJuiceman</dc:creator>
      <dc:date>2005-01-21T20:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing ENTER as an option</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468770#M704803</link>
      <description>this as close as I can get - he can press enter, but it won't be accepted.&lt;BR /&gt;&lt;BR /&gt;while [ "X$input" = "X" ]&lt;BR /&gt;do &lt;BR /&gt;echo "Don't press enter, type something"&lt;BR /&gt;read input&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I looked through stty -a, maybe defineing &lt;BR /&gt;stty eol  does the trick, but I'm not sure.&lt;BR /&gt;(Wait for someone else's opinion on that)&lt;BR /&gt;&lt;BR /&gt;If the users are connecting with a graphics-enabled terminal (hpterm, dtterm, putty, ...) You could use ncurses.&lt;BR /&gt;&lt;BR /&gt;A friend of mine also wrote a shell widget library, but I don't find his cvs-web site right now, so no access to that, but I'll try to add it tomorrow.</description>
      <pubDate>Fri, 21 Jan 2005 23:01:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468770#M704803</guid>
      <dc:creator>Florian Heigl (new acc)</dc:creator>
      <dc:date>2005-01-21T23:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing ENTER as an option</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468771#M704804</link>
      <description>Hi,&lt;BR /&gt;I usualy do the following in sh/ksh:&lt;BR /&gt;&lt;BR /&gt;while true; do&lt;BR /&gt;echo "Please answer &lt;A&gt;"&lt;BR /&gt;read INP&lt;BR /&gt;case $INP in&lt;BR /&gt;A) doA;break;;&lt;BR /&gt;B) doB;break;;&lt;BR /&gt;C) doC;break;;&lt;BR /&gt;*) echo "Invalid answer &amp;lt;$INP&amp;gt;"&lt;BR /&gt;esac&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;HTH&lt;/A&gt;</description>
      <pubDate>Sat, 22 Jan 2005 02:42:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468771#M704804</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2005-01-22T02:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing ENTER as an option</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468772#M704805</link>
      <description>Ask questions that require a Y or N, and intermix them. Back in the days when I wrote code for banks we used to ask the operator at least 10 questions, randomly, with mixed responses (at least one Y or N in the sequence) required to really continue.&lt;BR /&gt;&lt;BR /&gt;Here's a simple sample:&lt;BR /&gt;&lt;BR /&gt;Do you want to continue &lt;BR /&gt;Would you like to stop now&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The funny thing is that if they are bright they could use tck/tl to fool you!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Sat, 22 Jan 2005 07:59:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468772#M704805</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-01-22T07:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing ENTER as an option</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468773#M704806</link>
      <description>Thank you for the suggestions.  However, I cannot make a bullet list of objects because it is to allow a programmer to su as another person (being done in restricted sam).  The list of users changes daily and there are hundreds of them.  If they simply hit the ENTER key, they will su as root.  And I do not want to use su-do for this function.  There has to be a way to accept a typed in response and disallow a blank ENTER response.</description>
      <pubDate>Sun, 23 Jan 2005 18:05:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468773#M704806</guid>
      <dc:creator>TheJuiceman</dc:creator>
      <dc:date>2005-01-23T18:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing ENTER as an option</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468774#M704807</link>
      <description>Try something like this:&lt;BR /&gt;&lt;BR /&gt;input=""&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;read input?"Please type something... "&lt;BR /&gt;if [[ -z $input ]]&lt;BR /&gt;then&lt;BR /&gt;echo "You cannot enter a blank line!"&lt;BR /&gt;else&lt;BR /&gt;echo "thank you"&lt;BR /&gt;break&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Jan 2005 12:34:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468774#M704807</guid>
      <dc:creator>Gordon  Morrison</dc:creator>
      <dc:date>2005-01-24T12:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing ENTER as an option</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468775#M704808</link>
      <description>this won't work that easy - if he doesn't type &lt;ENTER&gt; but a few blanks, he'll be root anyhow.&lt;BR /&gt;&lt;BR /&gt;neither my string-compare nor test -z prohibit this. &lt;BR /&gt;&lt;BR /&gt;please consider a different way of doing this.&lt;BR /&gt;&lt;BR /&gt;for example, /etc/default/security has the option SU_ROOT_GROUP which could be set to =wheel , then only users which are members of the wheel group will be able to become root. (wheel is the de-facto standard name for that thingy)&lt;/ENTER&gt;</description>
      <pubDate>Mon, 24 Jan 2005 13:13:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468775#M704808</guid>
      <dc:creator>Florian Heigl (new acc)</dc:creator>
      <dc:date>2005-01-24T13:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing ENTER as an option</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468776#M704809</link>
      <description>I have used with success after testing myself on HPUX 11.0 and 11i &lt;BR /&gt;stty -brkint and&lt;BR /&gt;stty -isig</description>
      <pubDate>Mon, 24 Jan 2005 16:00:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468776#M704809</guid>
      <dc:creator>derek b smith_1</dc:creator>
      <dc:date>2005-01-24T16:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing ENTER as an option</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468777#M704810</link>
      <description>Thank you all again for the posts.&lt;BR /&gt;&lt;BR /&gt;As you can tell, script writing is not my "area of expertise".  I do not have a trusted system (due to some software issues) and do not have a /etc/default/security file.  I am also a bit unsure how to use the "stty" commands. &lt;BR /&gt;&lt;BR /&gt;I did have an idea however.  If I redirected a ls of /home into a file, could I write a script that will only allow them to pick something that is in that file?  Thanks again for your help.</description>
      <pubDate>Mon, 24 Jan 2005 21:43:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468777#M704810</guid>
      <dc:creator>TheJuiceman</dc:creator>
      <dc:date>2005-01-24T21:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing ENTER as an option</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468778#M704811</link>
      <description>With the help of some people on the "general" board, I think I've found something that works.  It will allow a user to su as another user inside restricted sam without become root or its equivalent.  It also will prevent them from simply hitting the ENTER key or some spaces to become root.  Since there are no services or root logins in the /home directory, this seems to work really well.&lt;BR /&gt;&lt;BR /&gt;echo "\n\n Please enter the user ID that you want to assume: \c"&lt;BR /&gt;ls /home &amp;gt; /tmp/TEMP&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;read INPUT&lt;BR /&gt;[[ "a$INPUT" = "a" ]] &amp;amp;&amp;amp; continue&lt;BR /&gt;grep -q $INPUT /tmp/TEMP&lt;BR /&gt;[[ $? !=0 ]] &amp;amp;&amp;amp; echo "\n\n Access denied." &amp;amp;&amp;amp; exit&lt;BR /&gt;break&lt;BR /&gt;done&lt;BR /&gt;su - $INPUT&lt;BR /&gt;rm /tmp/TEMP&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;Thanks...Bob&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Mar 2005 22:32:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/not-allowing-enter-as-an-option/m-p/3468778#M704811</guid>
      <dc:creator>TheJuiceman</dc:creator>
      <dc:date>2005-03-02T22:32:06Z</dc:date>
    </item>
  </channel>
</rss>

