<?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: SHC compiles with error in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037868#M432227</link>
    <description>As Peter wrote,&lt;BR /&gt;most likely a syntax error in /etc/profile around line 225.&lt;BR /&gt;Btw, you can directly jump to this line when loading the file into vi,&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;# vi +225 /etc/profile&lt;BR /&gt;&lt;BR /&gt;Out of curiousity, what is shc?&lt;BR /&gt;Is it a compiler that converts shell scripts into executable binaries that need not be interpreted by the shell anymore?&lt;BR /&gt;</description>
    <pubDate>Tue, 03 Apr 2007 03:23:43 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2007-04-03T03:23:43Z</dc:date>
    <item>
      <title>SHC compiles with error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037866#M432225</link>
      <description>Hi All,&lt;BR /&gt;hope that you can help me with this free compiler&lt;BR /&gt;i've been using this compiler SHC on HP-UX 11.11 for quite few years and it works very well.&lt;BR /&gt;my co-worker just created a scripts to generate the password for our servers the script worked fine with out compiling, but if i compiled and ran the compiled version, it always thrown and error.&lt;BR /&gt;&lt;BR /&gt;/etc/profile[225]: Syntax error: `(' is not expected.&lt;BR /&gt;the  compiled script, we inserted it at the last line of global profile.&lt;BR /&gt;below is a portion of the scripts.&lt;BR /&gt;in the whole script there are only two bracket&lt;BR /&gt;locate at the " getpass () " function.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;Sgid=`id -gn`&lt;BR /&gt;Suid=`id -un`&lt;BR /&gt;Ssid1=`id -Gn | awk '{print $2}'`&lt;BR /&gt;Ssid2=`id -Gn | awk '{print $3}'`&lt;BR /&gt;pwdcode="zyxwvutsrqponmlkjihgfedcba"&lt;BR /&gt;getpass ()&lt;BR /&gt;{&lt;BR /&gt;i="1"&lt;BR /&gt;while [ $i -le 26 ]&lt;BR /&gt;do&lt;BR /&gt;  alpha=`echo $pwdcode | cut -c -$i-$i`&lt;BR /&gt;  if [ "$alpha" = "$1" ]&lt;BR /&gt;  then&lt;BR /&gt;   break&lt;BR /&gt;  else&lt;BR /&gt;   i=`expr $i + 1`&lt;BR /&gt;  fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;--------&lt;BR /&gt;-------there are few getpass -&lt;BR /&gt;  getpass u&lt;BR /&gt;  pass1=$i&lt;BR /&gt;  getpass s&lt;BR /&gt;  pass2=$i&lt;BR /&gt;  pass3=`expr $pass1 + $pass2`&lt;BR /&gt;  export PSWDUS="SUN"$pass3&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;please advice us how to fix this error or if you know of any commercial product please also advice.&lt;BR /&gt;we use this SHC to hide the password inside the script.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Apr 2007 01:49:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037866#M432225</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2007-04-03T01:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: SHC compiles with error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037867#M432226</link>
      <description>Tom,&lt;BR /&gt;you can debug by using "set -x" in the line following the #!/bin/sh.&lt;BR /&gt;&lt;BR /&gt;Also if you vi /etc/profile and go to line 225 that might give you some clue.&lt;BR /&gt;To go to line 225 in vi use : 225&lt;BR /&gt;&lt;BR /&gt;Please don't forget:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt; on how to reward any useful answers given to your questions.</description>
      <pubDate>Tue, 03 Apr 2007 02:45:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037867#M432226</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2007-04-03T02:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: SHC compiles with error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037868#M432227</link>
      <description>As Peter wrote,&lt;BR /&gt;most likely a syntax error in /etc/profile around line 225.&lt;BR /&gt;Btw, you can directly jump to this line when loading the file into vi,&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;# vi +225 /etc/profile&lt;BR /&gt;&lt;BR /&gt;Out of curiousity, what is shc?&lt;BR /&gt;Is it a compiler that converts shell scripts into executable binaries that need not be interpreted by the shell anymore?&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Apr 2007 03:23:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037868#M432227</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-04-03T03:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: SHC compiles with error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037869#M432228</link>
      <description>Forgot,&lt;BR /&gt;"'(' not expected", somehow implies to me that you put the invocation of a shell function in /etc/profile with round parentheses, wheras in common shell syntax parenths are completely omitted and arguments only whitespace separated passed.</description>
      <pubDate>Tue, 03 Apr 2007 03:26:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037869#M432228</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-04-03T03:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: SHC compiles with error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037870#M432229</link>
      <description>Thanks for the replies,&lt;BR /&gt;&lt;BR /&gt;sorry, my question was not clear.&lt;BR /&gt;This is the last line of /etc/profile&lt;BR /&gt;. /opt/shc/bin/pp.sh.x&lt;BR /&gt;&lt;BR /&gt;this file, when not compile is working just fine "pp.sh"&lt;BR /&gt;after compiled, i got the error as above.&lt;BR /&gt;&lt;BR /&gt;"out of curiousity, what is shc?&lt;BR /&gt;Is it a compiler that converts shell scripts into executable binaries that need not be interpreted by the shell anymore?"&lt;BR /&gt;Ralph you were right. we use this free program to compile scripts with password so users could not see it.&lt;BR /&gt;so the error was not from /etc/profile it was  from the file after compiled.&lt;BR /&gt;&lt;BR /&gt;Please advice.&lt;BR /&gt;Thank you very much.&lt;BR /&gt;Tom</description>
      <pubDate>Tue, 03 Apr 2007 10:46:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037870#M432229</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2007-04-03T10:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: SHC compiles with error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037871#M432230</link>
      <description>Are you certain that users cannot see the passwords in your executable? Have you executed the strings command against your executable? You may not be nearly as secure as you think you are. You can make your executables more secure by disabling the read bits on the file. Unlike shell scripts, true executabes need only the executable bit set.</description>
      <pubDate>Tue, 03 Apr 2007 10:53:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037871#M432230</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-04-03T10:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: SHC compiles with error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037872#M432231</link>
      <description>Thanks A. Clay,&lt;BR /&gt;&lt;BR /&gt;i will keep that in mind.&lt;BR /&gt;the problem i have now &lt;BR /&gt;the script is working as expected without a problem but when i use the free compile software " shc" to create an executable file&lt;BR /&gt;from pp.sh to pp.sh.x &lt;BR /&gt;then it shown an error when i executed it&lt;BR /&gt;"/etc/profile[225]: Syntax error: `(' is not expected."&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Tom</description>
      <pubDate>Tue, 03 Apr 2007 11:17:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037872#M432231</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2007-04-03T11:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: SHC compiles with error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037873#M432232</link>
      <description>thank you for all your helps.&lt;BR /&gt;&lt;BR /&gt;there was a bug in our script and we are working on this error.&lt;BR /&gt;&lt;BR /&gt;thanks again,&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Apr 2007 19:02:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037873#M432232</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2007-04-03T19:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: SHC compiles with error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037874#M432233</link>
      <description>Though this thread has already been closed,&lt;BR /&gt;the intervention Clay made is worth considering.&lt;BR /&gt;Clear text passwords should be avoided.&lt;BR /&gt;You could for instance store a hashed password like it is also kept in passwd or shadow files.&lt;BR /&gt;There are numerous ways to create those hashes.&lt;BR /&gt;&lt;BR /&gt;Probably you already have got installed the openssl binary, either as part of the separate depot of the whole lib like the free HP Internet Express is offering it, or as part of the HP apache depot.&lt;BR /&gt;The openssl binary is a kind of crypto swiss army knife.&lt;BR /&gt;For instance it can generate MD5 hashes of passwords (like many Linux distros store them in their shadow files), but legacy DES like the Unix crypt() syscall is using it is also available.&lt;BR /&gt;Though the MD5 algorithm has been challenged recently (I think some Chinese crypto analysts could lower the brute force combinations to abt. 2^31 which gets tangible to large scale grid computing attacks) for normal environments with usual processing resources it still is quite secure.&lt;BR /&gt;&lt;BR /&gt;For instance the MD5 hash of the password "secret" looks like this:&lt;BR /&gt;&lt;BR /&gt;$ /opt/hpws/apache/bin/openssl passwd -1&lt;BR /&gt;Password: &lt;BR /&gt;Verifying - Password: &lt;BR /&gt;$1$k10b0ykK$Vs.OTE9RAy5pQS/8Vbzi5/&lt;BR /&gt;&lt;BR /&gt;You could store such hashes safely even in a world readable file.&lt;BR /&gt;&lt;BR /&gt;For a more programmatic or scriptable approach I personally would recommend Perl modules such as Crypt::MD5 etc. but any decent programming or scripting language should come with an API for these tasks.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Apr 2007 03:15:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shc-compiles-with-error/m-p/5037874#M432233</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-04-04T03:15:17Z</dc:date>
    </item>
  </channel>
</rss>

