<?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: problems with programmatically executing usermod/userdel on 11.11 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163144#M159809</link>
    <description>Thanks, Jeff.  I'll look into that.&lt;BR /&gt;&lt;BR /&gt;Points forthcoming.&lt;BR /&gt;&lt;BR /&gt;kellye</description>
    <pubDate>Tue, 13 Jan 2004 11:50:11 GMT</pubDate>
    <dc:creator>kellye bernecker_1</dc:creator>
    <dc:date>2004-01-13T11:50:11Z</dc:date>
    <item>
      <title>problems with programmatically executing usermod/userdel on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163142#M159807</link>
      <description>Hello everyone,&lt;BR /&gt;&lt;BR /&gt;I am new to this forum, so please forgive me if I make any mistakes.&lt;BR /&gt;&lt;BR /&gt;I am working on an application that performs account manipulation, such as useradd, userdel and the like.  This application works great on 11.00, but I have some problems on 11.11 with the shadow password bundle.  I am compiling on 11.00, for what it's worth.&lt;BR /&gt;&lt;BR /&gt;I have no problems with the useradd command.&lt;BR /&gt;&lt;BR /&gt;My application is getting an error when trying to execute usermod -g &lt;GROUPNAME&gt; &lt;USERNAME&gt; or usermod -s &lt;SHELLNAME&gt; &lt;USERNAME&gt;.  The error is 15, which according to the man page for usermod indicates :&lt;BR /&gt;Cannot modify the entry in the /etc/passwd file.&lt;BR /&gt;&lt;BR /&gt;The command actually does perform the action. When I check the /etc/passwd file, the  group/shell has been changed as requested.&lt;BR /&gt;&lt;BR /&gt;My application is also getting an error when trying to execute a userdel &lt;USERNAME&gt;.  The return code is 17, indicating: &lt;BR /&gt;Cannot delete entry from /etc/passwd file.&lt;BR /&gt;&lt;BR /&gt;The entry DOES get deleted from the passwd file, but remains in /etc/shadow.&lt;BR /&gt;&lt;BR /&gt;If I execute these commands from the command line, they work perfectly.  &lt;BR /&gt;&lt;BR /&gt;I installed patch PHCO_29269 in the hopes that it would help, but it did not.&lt;BR /&gt;&lt;BR /&gt;I have written a small C program to test with, and have attached the source to this post.  To execute it, I compile it as commandTest and type ./commandTest "&lt;COMMAND&gt; &lt;PARAMETERS&gt;", for example, ./commandTest "userdel dummy".  It's not a very fancy program, but it helps to illustrate my problem.  This code is similar to the code in my application.&lt;BR /&gt;&lt;BR /&gt;I appreciate your time.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;kellye&lt;BR /&gt;&lt;/PARAMETERS&gt;&lt;/COMMAND&gt;&lt;/USERNAME&gt;&lt;/USERNAME&gt;&lt;/SHELLNAME&gt;&lt;/USERNAME&gt;&lt;/GROUPNAME&gt;</description>
      <pubDate>Tue, 13 Jan 2004 11:18:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163142#M159807</guid>
      <dc:creator>kellye bernecker_1</dc:creator>
      <dc:date>2004-01-13T11:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: problems with programmatically executing usermod/userdel on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163143#M159808</link>
      <description>Hi Kellye,&lt;BR /&gt;&lt;BR /&gt;Verify that there is no corruption in the passwd or group files - run&lt;BR /&gt;pwck &amp;amp; grpck&lt;BR /&gt;and fix any problems reported.&lt;BR /&gt;Also verify that you have *all* the pre-enablement as well as required patches for shadow - there were a lot of them IIRC.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 13 Jan 2004 11:26:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163143#M159808</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2004-01-13T11:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: problems with programmatically executing usermod/userdel on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163144#M159809</link>
      <description>Thanks, Jeff.  I'll look into that.&lt;BR /&gt;&lt;BR /&gt;Points forthcoming.&lt;BR /&gt;&lt;BR /&gt;kellye</description>
      <pubDate>Tue, 13 Jan 2004 11:50:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163144#M159809</guid>
      <dc:creator>kellye bernecker_1</dc:creator>
      <dc:date>2004-01-13T11:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: problems with programmatically executing usermod/userdel on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163145#M159810</link>
      <description>Hi Kellye,&lt;BR /&gt;&lt;BR /&gt;Since your program does nothing but running the commands, I guess the problem is with the tcb database itself.&lt;BR /&gt;&lt;BR /&gt;Do you get the same results if you run the command "userdel dummy" instead through the c-program?. If not, then you will need to follow Jeff's suggestions.&lt;BR /&gt;&lt;BR /&gt;I infact compiled your program onto my workstation and ran it. It worked just fine. My workstation is with June 2003 bundles.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Tue, 13 Jan 2004 12:39:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163145#M159810</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-01-13T12:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: problems with programmatically executing usermod/userdel on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163146#M159811</link>
      <description>Also make sure the user you are trying to modify or delete is not logged in.  These commands will fail if they are.  This is consistant with what you are seeing (useradd works fine). &lt;BR /&gt;&lt;BR /&gt;Just a thought.</description>
      <pubDate>Tue, 13 Jan 2004 13:46:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163146#M159811</guid>
      <dc:creator>Tom Danzig</dc:creator>
      <dc:date>2004-01-13T13:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: problems with programmatically executing usermod/userdel on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163147#M159812</link>
      <description>Sri,&lt;BR /&gt;&lt;BR /&gt;When I manually run the commands, they work perfectly.  The only time I have a problem is when I execute them from my program.  &lt;BR /&gt;&lt;BR /&gt;I'm currently investigating which patches I need and which ones I'm missing.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;kellye</description>
      <pubDate>Tue, 13 Jan 2004 14:05:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163147#M159812</guid>
      <dc:creator>kellye bernecker_1</dc:creator>
      <dc:date>2004-01-13T14:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: problems with programmatically executing usermod/userdel on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163148#M159813</link>
      <description>Tom,&lt;BR /&gt;&lt;BR /&gt;I'm sequentially creating the user, modifying the user then deleting the user (programmatically), so having the user logged in shouldn't be a problem.  I'm currently the only person using this particular machine.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;kellye</description>
      <pubDate>Tue, 13 Jan 2004 14:07:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163148#M159813</guid>
      <dc:creator>kellye bernecker_1</dc:creator>
      <dc:date>2004-01-13T14:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: problems with programmatically executing usermod/userdel on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163149#M159814</link>
      <description>Because this is working from the command line, I suspect that the commands are failing because of your popen() and problems with stderr redirection. I suggest that you use the system() function instead using sprintf to buld up as complex a command as you like and making sure to redirect stdout and stderr to separate temp files. &lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jan 2004 14:17:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163149#M159814</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-01-13T14:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: problems with programmatically executing usermod/userdel on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163150#M159815</link>
      <description>Clay,&lt;BR /&gt;&lt;BR /&gt;You hit it on the head, when I modified the program to use system() instead of popen(), all of the calls worked.&lt;BR /&gt;&lt;BR /&gt;My question now has to be why would these calls work with popen() on 11.00 and have a problem on 11.11.  Is it due to the shadow file somehow?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;kellye&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jan 2004 14:39:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163150#M159815</guid>
      <dc:creator>kellye bernecker_1</dc:creator>
      <dc:date>2004-01-13T14:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: problems with programmatically executing usermod/userdel on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163151#M159816</link>
      <description>I doubt that there are fundamental differences in the popen()/pclose() functions in 11.11 but rather that the usermod et al commands are a little different in their use of stderr. I would capture the stdout/stderr files from the system() function and compare them across the OS releases. Handling stderr is something you always have to be aware of in any popen() command.&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jan 2004 14:44:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-programmatically-executing-usermod-userdel-on-11/m-p/3163151#M159816</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-01-13T14:44:29Z</dc:date>
    </item>
  </channel>
</rss>

