Operating System - HP-UX
1748261 Members
3663 Online
108760 Solutions
New Discussion юеВ

Change HP-UX 11.0 Password with in PowerBuilder App

 
Joseph Jamison
New Member

Change HP-UX 11.0 Password with in PowerBuilder App

Has anyone written an application to change a UNIX password?

We have a custom built application built in PowerBuilder that access our UNIX system and a SQL database. I need a way to change the UNIX password from with in the PowerBuilder application. I am looking for sample code for ideas, even if not in PB.
If it's not broken, improve it.
2 REPLIES 2
Darren Prior
Honored Contributor

Re: Change HP-UX 11.0 Password with in PowerBuilder App

Hi,

You don't mention whether your system is trusted and/or uses NIS+, but a good starting point would be to have a look at the man page for the system calls getpwent(3C) [and its' counterpart putpwent(3C)] and crypt(3C).

Another option would be to write a wrapper for the passwd(1) command (although there is the possibility that this command could be changed in the future by patches) or run the passwd command within your app so the user is able to interact with it.

regards,

Darren.
Calm down. It's only ones and zeros...
Mark Seaman
Advisor

Re: Change HP-UX 11.0 Password with in PowerBuilder App

The only methods I see for doing this are:

1. Execute an external program/script from within the database server (stored procedure, server-side Java, or other DBMS-dependent mechanism). The procedure could be called from PB. It will not be possible for every RDBMS. What database are you using?

2. Remotely execute a command from the client on the server using rexec(). I wrote a DLL a long time ago (PB 3.0) to do this so users could kick off a batch job on the server. You can execute a function in a DLL using PowerBuilder.