AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
Expand all | Collapse all

Problems with pwdrestrict_method subroutine.

  • 1.  Problems with pwdrestrict_method subroutine.

    Posted Wed July 25, 2012 07:59 AM

    Originally posted by: zuuooo


    Hi,

    I would like to improve AIX password policy by implementing pwdrestrict_method ( pwdchecks in /etc/security/user ). While it is working perfectly under AIX 6.1 and AIX 7.1 ( 7100-00 ) under 7100-01 it segfaults. While troubleshooting i prepared simple module, so i'm sure that problem lies somewhere above.

    cat pwdrestrict.c

    #include <stdlib.h>

    int pwdrestrict_method (UserName, NewPassword, OldPassword, Message)
    char * UserName;
    char * NewPassword;
    char * OldPassword;
    char ** Message;
    {
    *Message = NULL;
    return 0;
    }

    There are some native restrictions in AIX configuration files :
    histsize = 5
    maxage = 12
    maxexpired = 2
    mindiff = 3
    minlen = 8
    pwdwarntime = 7
    pwdchecks = pwdrestrict

    And pwd_algorithm is set to smd5.

    The problem occurs when putting as a new password one, that doesn't meet system policy. After another try it looks like there is some kind of NULL pointer dereference ( in libc? )

    $ passwd
    Changing password for "user"
    user's Old password:
    user's New password:

    3004-602 The required password characteristics are:
    a maximum of 8 repeated characters.
    a minimum of 3 characters not found in old password.
    a minimum of 8 characters in length.
    3004-603 Your password must have:
    a minimum of 8 characters in length.
    user's New password:
    Segmentation fault
    $

    Program received signal SIGSEGV, Segmentation fault.
    0xd02b27f0 in passwdpolicyx () from /usr/lib/libc.a(shr.o)

    0xd02b27e8 <+1736>: lil r4,1
    0xd02b27ec <+1740>: cal r5,136(r15)
    => 0xd02b27f0 <+1744>: stb r30,0(r6)
    0xd02b27f4 <+1748>: bl 0xd0108ca0 <load>
    0xd02b27f8 <+1752>: oril r0,r0,0
    0xd02b27fc <+1756>: mr. r27,r3
    0xd02b2800 <+1760>: beq 0xd02b286c <passwdpolicyx+1868>

    (gdb) info reg r30 r6
    r30 0x0 0
    r6 0x0 0
    #AIX-Forum


  • 2.  Re: Problems with pwdrestrict_method subroutine.

    Posted Mon August 20, 2012 10:30 PM

    Originally posted by: SystemAdmin


    I had a similar issue with pwdrestrict causing segmentation faults on AIX 6. It turned out that the problem was the compiler. This was initially installed when the system was AIX 5.3 and it needed to be upgraded/re-installed to be suitable for 6.1.
    #AIX-Forum