Operating System - HP-UX
1753792 Members
7721 Online
108799 Solutions
New Discussion юеВ

Re: pw_age field using getpwnam

 
SOLVED
Go to solution
TTr
Honored Contributor

Re: pw_age field using getpwnam

Alex,

The very first reply from JRF contains the URL that has exactly the explanation that you were asking. If only you had read it carefully...


The characters used to represent "digits" are . for 0, / for 1, 0 through 9 for 2 through 11, A through Z for 12 through 37, and a through z for 38 through 63.
...
The first character of the age, M, denotes the maximum number...
If m = M = 0 (derived from the string . or ..), the user is forced to change...

Dennis,Hein thanks for the code. I have been using a shell script I wrote with 64 variables in it to make the conversion.

Alex Feng
Advisor

Re: pw_age field using getpwnam

Ok
Dennis Handly
Acclaimed Contributor

Re: pw_age field using getpwnam

>TTr: If only you had read it carefully.

There is a big difference between words and an actual program. See my comments in mine.
I don't see anywhere in passwd(4) where it explains my comment:
k = mapped[3] * 64 + mapped[2]; /* swapped order? */
And Hein's comment: or if I have those reversed