libsmb/pwd_cache.c

説明を見る。
00001 /* 
00002    Unix SMB/CIFS implementation.
00003    Password cacheing.  obfuscation is planned
00004    Copyright (C) Luke Kenneth Casson Leighton 1996-1998
00005    
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015    
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software
00018    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 */
00020 
00021 #include "includes.h"
00022 
00023 /****************************************************************************
00024  Initialises a password structure.
00025 ****************************************************************************/
00026 
00027 static void pwd_init(struct pwd_info *pwd)
00028 {
00029         memset((char *)pwd->password  , '\0', sizeof(pwd->password  ));
00030 
00031         pwd->null_pwd  = True; /* safest option... */
00032 }
00033 
00034 /****************************************************************************
00035  Stores a cleartext password.
00036 ****************************************************************************/
00037 
00038 void pwd_set_cleartext(struct pwd_info *pwd, const char *clr)
00039 {
00040         pwd_init(pwd);
00041         if (clr) {
00042                 fstrcpy(pwd->password, clr);
00043                 pwd->null_pwd = False;
00044         } else {
00045                 pwd->null_pwd = True;
00046         }
00047 
00048         pwd->cleartext = True;
00049 }
00050 
00051 /****************************************************************************
00052  Gets a cleartext password.
00053 ****************************************************************************/
00054 
00055 void pwd_get_cleartext(struct pwd_info *pwd, fstring clr)
00056 {
00057         if (pwd->cleartext)
00058                 fstrcpy(clr, pwd->password);
00059         else
00060                 clr[0] = 0;
00061 
00062 }

Sambaに対してSat Aug 29 21:23:06 2009に生成されました。  doxygen 1.4.7