<?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: compile problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893591#M820122</link>
    <description>No Sridhar, I did not mean that I was going to compile the program.  I really don't feel like logging into a work machine. And I don't have a home HP-UX box. :(&lt;BR /&gt;&lt;BR /&gt;I meant that I was going to fill out the comments section, which I did, in the document link that was given and complain about the lack of properly formatted #include lines.</description>
    <pubDate>Fri, 31 Jan 2003 03:25:37 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2003-01-31T03:25:37Z</dc:date>
    <item>
      <title>compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893584#M820115</link>
      <description>Does anyone know why I can't compile this C program I got off of the ITRC for changing passwords.&lt;BR /&gt;&lt;BR /&gt;Here is C code that may be used to programmatically change a user's password on a trusted system. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt; *  When run as root and given a "username" as a first argument&lt;BR /&gt; *  and "password" as a second argument, this program modifies&lt;BR /&gt; *  that user's password entry with a new encrypted password.&lt;BR /&gt; *  This is for a trusted system.&lt;BR /&gt; *&lt;BR /&gt; *  Compile with "-lsec" option.&lt;BR /&gt; *&lt;BR /&gt; *  Exit values are:&lt;BR /&gt; *    0 : Success&lt;BR /&gt; *    1 : Incorrect argument count&lt;BR /&gt; *    2 : Failure to getprpwnam(3) the password information&lt;BR /&gt; *    3 : Failure to putprpwnam(3) the password information&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;#include &lt;BR /&gt;&lt;BR /&gt;char get_salt_char() {&lt;BR /&gt;  int random_number;&lt;BR /&gt;  random_number = abs(time(0) * random(time(0)) * getpid()) % 65;&lt;BR /&gt;  if (random_number &amp;lt; 26) return('a' + random_number);&lt;BR /&gt;  if (random_number &amp;lt; 52) return('A' + random_number - 26);&lt;BR /&gt;  if (random_number &amp;lt; 62) return('0' + random_number - 52);&lt;BR /&gt;  if (random_number == 62) return('.');&lt;BR /&gt;  if (random_number == 63) return('/');&lt;BR /&gt;  if (random_number == 64) return(get_salt_char());&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;main(argc, argv) int argc; char *argv[]; {&lt;BR /&gt;&lt;BR /&gt;  char username[10];&lt;BR /&gt;  char password[10];&lt;BR /&gt;  char salt[2];&lt;BR /&gt;  struct pr_passwd *prpwd_entry;&lt;BR /&gt;&lt;BR /&gt;  strcpy(username, argv[1]);&lt;BR /&gt;  strcpy(password, argv[2]);&lt;BR /&gt;&lt;BR /&gt;  salt[0] = get_salt_char();&lt;BR /&gt;  salt[1] = get_salt_char();&lt;BR /&gt;&lt;BR /&gt;  if (argc != 3) {&lt;BR /&gt;    printf("Incorrect argument count: %d\n", argc-1);&lt;BR /&gt;    printf ("Usage: %s username password \n", argv[0]);      exit(1);&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  if ((prpwd_entry = getprpwnam(argv[1])) == NULL) {&lt;BR /&gt;    printf("failed to get password information for '%s'\n", username);&lt;BR /&gt;    printf ("Usage: %s username password \n", argv[0]);      exit(2);&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  strcpy(prpwd_entry-&amp;gt;ufld.fd_encrypt, crypt(password, salt));&lt;BR /&gt;  if (putprpwnam(argv[1], prpwd_entry) == NULL) {&lt;BR /&gt;    printf("failed to put password information for '%s'\n", username);&lt;BR /&gt;    exit(3);&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  endprpwent();&lt;BR /&gt;  return(0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;I am getting a "bad syntax for #include directive error.  Please help.  thanks  MPW</description>
      <pubDate>Fri, 31 Jan 2003 00:36:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893584#M820115</guid>
      <dc:creator>Matt Williamson</dc:creator>
      <dc:date>2003-01-31T00:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893585#M820116</link>
      <description>I'm no C expert, but in the #include section, you have nothing there listed to include.&lt;BR /&gt;&lt;BR /&gt;Remember that in C the # is NOT a comment.  Go back and check where you got the C program from and see if there is anything else for the include statement there.&lt;BR /&gt;&lt;BR /&gt;Perhaps you could post the link you got the program from?</description>
      <pubDate>Fri, 31 Jan 2003 00:47:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893585#M820116</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-01-31T00:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893586#M820117</link>
      <description>Patrick has nailed it.&lt;BR /&gt;&lt;BR /&gt;You need something like &lt;BR /&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include "./myfile.h"&lt;BR /&gt;&lt;BR /&gt;Multiple include files are allowed; those within &amp;lt; &amp;gt; indicate look in the standard locations (e.g. /usr/include) while those with "filename" indicate a pathname.&lt;BR /&gt;&lt;BR /&gt;There may be more errors but your first task is to identify any needed header files.&lt;BR /&gt;&lt;/STDLIB.H&gt;</description>
      <pubDate>Fri, 31 Jan 2003 00:54:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893586#M820117</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-01-31T00:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893587#M820118</link>
      <description>Thanks. I think you are both right.  I'm new to C and a little lost here.  I am posting the link to the C code.  I actually got it off of the ITRC site and thought it would be simple.  I guess I need to go learn C and try it again.  Anymore feedback you have would be helpful...otherwise thanks for your help!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&amp;amp;docId=200000062769744" target="_blank"&gt;http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&amp;amp;docId=200000062769744&lt;/A&gt;</description>
      <pubDate>Fri, 31 Jan 2003 01:16:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893587#M820118</guid>
      <dc:creator>Matt Williamson</dc:creator>
      <dc:date>2003-01-31T01:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893588#M820119</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try the following includes&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;#include &lt;CRYPT.H&gt;&lt;BR /&gt;#include &lt;STRINGS.H&gt; &lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;CTYPE.H&gt; &lt;BR /&gt;#include &lt;PROT.H&gt; &lt;BR /&gt;#include &lt;HPSECURITY.H&gt;&lt;BR /&gt;#include &lt;SHADOW.H&gt; &lt;BR /&gt;&lt;BR /&gt;One or more may not be required but there is no harm. prot.h and crypt.h are definitely required.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;/SHADOW.H&gt;&lt;/HPSECURITY.H&gt;&lt;/PROT.H&gt;&lt;/CTYPE.H&gt;&lt;/STDLIB.H&gt;&lt;/STRINGS.H&gt;&lt;/CRYPT.H&gt;&lt;/UNISTD.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 31 Jan 2003 01:29:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893588#M820119</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-01-31T01:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893589#M820120</link>
      <description>That links C code is definitely flawed as they have the #include statments there, but nothing listed to include.&lt;BR /&gt;&lt;BR /&gt;I would follow Sridhar's advice and use the include statements he specifies.&lt;BR /&gt;&lt;BR /&gt;I would also go down to the comments section in that document and explain the difficulties and the incorrect #include statements in the document.&lt;BR /&gt;&lt;BR /&gt;In fact, I'm going to do that right now. :)</description>
      <pubDate>Fri, 31 Jan 2003 02:33:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893589#M820120</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-01-31T02:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893590#M820121</link>
      <description>Patrick,&lt;BR /&gt;&lt;BR /&gt;Did you say you were going to compile the program?&lt;BR /&gt;&lt;BR /&gt;What else could be called dedication?&lt;BR /&gt;&lt;BR /&gt;I bow to thee.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Fri, 31 Jan 2003 02:53:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893590#M820121</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-01-31T02:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893591#M820122</link>
      <description>No Sridhar, I did not mean that I was going to compile the program.  I really don't feel like logging into a work machine. And I don't have a home HP-UX box. :(&lt;BR /&gt;&lt;BR /&gt;I meant that I was going to fill out the comments section, which I did, in the document link that was given and complain about the lack of properly formatted #include lines.</description>
      <pubDate>Fri, 31 Jan 2003 03:25:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893591#M820122</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-01-31T03:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893592#M820123</link>
      <description>I suspect that this is a problem with the ITRC submission process.  Some folks who regularly submit documents speak of the trouble that they have with embedded greater than and less than symbols because the ITRC tries to interpret it as HTML.  It thinkis that (let's see if this actually gets posted) &lt;STDIO.H&gt; is some sort of HTML directive.  &lt;BR /&gt;&lt;BR /&gt;The code that the submitter references has just the #includes with no header file referenced. &lt;BR /&gt;&lt;BR /&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 31 Jan 2003 13:11:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893592#M820123</guid>
      <dc:creator>Rick Beldin</dc:creator>
      <dc:date>2003-01-31T13:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893593#M820124</link>
      <description>I suspect that this is a problem with the ITRC submission process.  Some folks who regularly submit documents speak of the trouble that they have with embedded greater than and less than symbols because the ITRC tries to interpret it as HTML.  It thinks  that (let's see if this actually gets posted) &lt;STDIO.H&gt; is some sort of HTML directive.  &lt;BR /&gt;&lt;BR /&gt;The code that the submitter references has just the #includes with no header file referenced. &lt;BR /&gt;&lt;BR /&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 31 Jan 2003 13:11:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893593#M820124</guid>
      <dc:creator>Rick Beldin</dc:creator>
      <dc:date>2003-01-31T13:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893594#M820125</link>
      <description>I think you'll also need &lt;BR /&gt;#include &lt;PASSWD.H&gt;  for the passwd directives&lt;BR /&gt;you will need &lt;BR /&gt;#&lt;INCLUDE math.h=""&gt; for random numbers&lt;BR /&gt;other than that the problem seems pretty much nailed&lt;/INCLUDE&gt;&lt;/PASSWD.H&gt;</description>
      <pubDate>Sat, 01 Feb 2003 14:28:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893594#M820125</guid>
      <dc:creator>Paddy_1</dc:creator>
      <dc:date>2003-02-01T14:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: compile problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893595#M820126</link>
      <description>Thanks fellas!  I finally got this compiled and it works great.  What I did was view the "source" for the page where the code was posted.  I cut the code out of the source and all the proper "includes" where there.  I had to remove a few tags here and there but it compiled just fine.  Thanks again for your help on this one!  Matt Williamso, SHPS</description>
      <pubDate>Tue, 04 Feb 2003 16:44:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compile-problem/m-p/2893595#M820126</guid>
      <dc:creator>Matt Williamson</dc:creator>
      <dc:date>2003-02-04T16:44:08Z</dc:date>
    </item>
  </channel>
</rss>

