Thread: AIX passwdpolicy() subroutine

  1. #1
    Registered User
    Join Date
    Oct 2008

    Thumbs down AIX passwdpolicy() subroutine

    Okay, so in AIX, there are various subroutines that is built in to the OS. The subroutine is I want to use is passwdpolicy(). So I want to construct a C program that will be able to pass credentials into the program and thusly into the subroutine.

    I'm not asking for homework, or for someone to do it. All I'm asking is how do I USE the subroutine. Here is the subroutine:

    #include <pwdpolicy.h>
    int passwdpolicy (const char *name, int type, const char *old_password,
    const char *new_password, time64_t last_update);

    Now. Let's say I want to test the password for the user testy, with an old password of a1s2d3f4 and a new password of q1w2e3r4.

    Here is the link to the subroutine, via IBM: IBM Systems Information Center

    I have no idea how to construct this. Basically in the subroutine you have to pass some variables: username, password, old password etc.

    Here is the documentation on it:

    Can anyone help me out?

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Visalia, CA, USA
    This function seems to do basically all of what you are needing. And don't worry, it doesn't sound like a homework question. It sounds like an "All work and no play make Jack a dull boy" question.

    The last param seems entirely optional, so I would just pass 0 in for it.

    int r = passwdpolicy("testy", "a1s2d3f4", "q1w2e3r4", 0ULL);
    It seems like the return value just tells you if something went wrong, I got kind of lazy.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C subroutine
    By curious in forum C Programming
    Replies: 2
    Last Post: 05-30-2009, 09:36 PM
  2. Assembler Language Subroutine 2
    By John_L in forum Tech Board
    Replies: 8
    Last Post: 03-30-2008, 04:48 PM
  3. Best way to call a subroutine
    By N3BPM in forum C Programming
    Replies: 7
    Last Post: 11-11-2007, 11:11 PM
  4. problem with subroutine
    By pankleks in forum C Programming
    Replies: 2
    Last Post: 11-24-2005, 02:57 AM
  5. fgets in a function subroutine
    By wbeasl in forum C Programming
    Replies: 1
    Last Post: 12-03-2003, 03:51 AM