2 Unix SMB/CIFS implementation.
3 Password cacheing. obfuscation is planned
4 Copyright (C) Luke Kenneth Casson Leighton 1996-1998
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 /****************************************************************************
23 Initialises a password structure.
24 ****************************************************************************/
26 static void pwd_init(struct pwd_info
*pwd
)
28 memset((char *)pwd
->password
, '\0', sizeof(pwd
->password
));
30 pwd
->null_pwd
= True
; /* safest option... */
33 /****************************************************************************
34 Stores a cleartext password.
35 ****************************************************************************/
37 void pwd_set_cleartext(struct pwd_info
*pwd
, const char *clr
)
41 fstrcpy(pwd
->password
, clr
);
42 pwd
->null_pwd
= False
;
47 pwd
->cleartext
= True
;
50 /****************************************************************************
51 Gets a cleartext password.
52 ****************************************************************************/
54 void pwd_get_cleartext(struct pwd_info
*pwd
, fstring clr
)
57 fstrcpy(clr
, pwd
->password
);