From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fa528,12793f1ad6be6163 X-Google-Attributes: gidfa528,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!news.compaq.com!news.cpqcorp.net!53ab2750!not-for-mail From: "Ann Majeske" Newsgroups: comp.unix.tru64 References: <1130481650.298216.166020@g47g2000cwa.googlegroups.com> Subject: Re: Tru64 5.1a Enhanced security u_oldcrypt u_newcrypt values changing X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Message-ID: Date: Fri, 28 Oct 2005 15:00:35 GMT NNTP-Posting-Host: 16.115.192.131 X-Complaints-To: abuse@HP.com X-Trace: news.cpqcorp.net 1130511635 16.115.192.131 (Fri, 28 Oct 2005 08:00:35 PDT) NNTP-Posting-Date: Fri, 28 Oct 2005 08:00:35 PDT Organization: Hewlett-Packard Company Xref: g2news1.google.com comp.unix.tru64:394 u_newcrypt is the encryption method used to encrypt future passwords. The OS will first look for it in the user's account, if it doesn't find it there it will take the value from the default file. So, if you want your custom application to accurately reflect the Enhanced Security encryption method that has been set you should be looking at this value and using it to determine how the user's password is encrypted. One easy way to do this would be to use the sia_chg_password() routine. It will work for any SIA security mechanism you have enabled on your system (Base, Enhanced, etc). u_oldcrypt is the encryption method used to encrypt the current password. This should always be in the user's account information, it doesn't make sense to have it in the default file. u_oldcrypt is used by the OS to determine how to encrypt the password to compare it with the current password. Apparently your custom application is setting it to the wrong value (1 instead of 2). This would explain why the user can't login, the same password encrypted using two different methods will not match. The OS encryption values for u_oldcrypt and u_newcrypt (there is a way for you to define your own additional encryption values, but I'm assuming that this is not the case here) are in prot.h: /* Indices for fd_{old,new}crypt algorithms */ #define AUTH_CRYPT_BIGCRYPT 0 /* index to use bigcrypt */ #define AUTH_CRYPT_CRYPT16 1 /* index to use crypt16 */ #define AUTH_CRYPT_OLDCRYPT 2 /* index to use old crypt */ #define AUTH_CRYPT_C1CRYPT 3 /* index to use /etc/passwd */ #define AUTH_CRYPT__MAX 3 /* last legal index */ So, if you're using crypt() to encrypt the password, you should be setting u_oldcrypt to 2 not 1 in your custom application. Basically, you need to set the fg_oldcrypt field to 1 (to indicate that the u_oldcrypt value should be set) and the fd_oldcrypt field to 2 (to indicate the value to set for u_oldcrypt). See the Security Programming manual and the putespwnam() man page for more information. But, as I stated above, the easiest way to deal with this would be to use the sia_chg_password() routine instead. Ann Majeske "Sumedh" wrote in message news:1130481650.298216.166020@g47g2000cwa.googlegroups.com... > Hi, > I have a custom application running on a tru64 box..it is basically > used to provision user accounts and their passwords,etc..i run it with > root privileges..the default database shows u_newcrypt#2 as one of the > entries..when i use the OS api functions through my application to > update a user passwd(i write to the auth.db) i can login with my new > passwd for the same user..also,when i do a edauth -dp -g ,i > dont see any values for the u_oldcrypt and u_newcrypt > attributes..now,immediately after this I do a passwd change on the box > using "passwd " ..i do an edauth and now I see u_oldcrypt is > 2,the output doesnt have any mention of u_newcrypt....i can login with > this new passwd as well ..I run another passwd change through my custom > application on the same user and I get u_oldcrypt as 1 in my edauth > output..but now I cant login with this password or even the previously > set password..the user account has become unusable.I suspect u_oldcrypt > is causing this problem in this sequence of operations..but i cant > figure out what its used for and how does it relate to u_newcrypt?Can > anyone throw any light on how these two values correalte whether > u_oldcrypt=u_newcrypt after a password change?My custom code uses > crypt() which is I believe corresponds to u_newcrypt value 2 encryption > mechanism..any help is highly appreciated, > Many Thanks, > Sumedh >