passdb/pdb_smbpasswd.c

ソースコードを見る。

データ構造

struct  smb_passwd
struct  smbpasswd_privates

列挙型

enum  pwf_access_type { PWF_READ, PWF_UPDATE, PWF_CREATE }

関数

static void gotalarm_sig (void)
static BOOL do_file_lock (int fd, int waitsecs, int type)
static BOOL pw_file_lock (int fd, int type, int secs, int *plock_depth)
static BOOL pw_file_unlock (int fd, int *plock_depth)
static void pdb_init_smb (struct smb_passwd *user)
static FILE * startsmbfilepwent (const char *pfile, enum pwf_access_type type, int *lock_depth)

変数

static SIG_ATOMIC_T gotalarm


列挙型

enum pwf_access_type

列挙型の値:
PWF_READ 
PWF_UPDATE 
PWF_CREATE 

pdb_smbpasswd.c65 行で定義されています。


関数

static void gotalarm_sig ( void   )  [static]

pdb_smbpasswd.c73 行で定義されています。

参照先 gotalarm.

00074 {
00075         gotalarm = 1;
00076 }

static BOOL do_file_lock ( int  fd,
int  waitsecs,
int  type 
) [static]

pdb_smbpasswd.c83 行で定義されています。

参照先 CatchSignal()gotalarmgotalarm_sig().

参照元 pw_file_lock()pw_file_unlock().

00084 {
00085         SMB_STRUCT_FLOCK lock;
00086         int             ret;
00087         void (*oldsig_handler)(int);
00088 
00089         gotalarm = 0;
00090         oldsig_handler = CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig);
00091 
00092         lock.l_type = type;
00093         lock.l_whence = SEEK_SET;
00094         lock.l_start = 0;
00095         lock.l_len = 1;
00096         lock.l_pid = 0;
00097 
00098         alarm(waitsecs);
00099         /* Note we must *NOT* use sys_fcntl here ! JRA */
00100         ret = fcntl(fd, SMB_F_SETLKW, &lock);
00101         alarm(0);
00102         CatchSignal(SIGALRM, SIGNAL_CAST oldsig_handler);
00103 
00104         if (gotalarm) {
00105                 DEBUG(0, ("do_file_lock: failed to %s file.\n",
00106                         type == F_UNLCK ? "unlock" : "lock"));
00107                 return False;
00108         }
00109 
00110         return (ret == 0);
00111 }

static BOOL pw_file_lock ( int  fd,
int  type,
int  secs,
int *  plock_depth 
) [static]

pdb_smbpasswd.c117 行で定義されています。

参照先 do_file_lock()errnostrerror().

参照元 startsmbfilepwent().

00118 {
00119         if (fd < 0) {
00120                 return False;
00121         }
00122 
00123         if(*plock_depth == 0) {
00124                 if (!do_file_lock(fd, secs, type)) {
00125                         DEBUG(10,("pw_file_lock: locking file failed, error = %s.\n",
00126                                 strerror(errno)));
00127                         return False;
00128                 }
00129         }
00130 
00131         (*plock_depth)++;
00132 
00133         return True;
00134 }

static BOOL pw_file_unlock ( int  fd,
int *  plock_depth 
) [static]

pdb_smbpasswd.c140 行で定義されています。

参照先 do_file_lock()errnostrerror().

参照元 startsmbfilepwent().

00141 {
00142         BOOL ret=True;
00143 
00144         if (fd == 0 || *plock_depth == 0) {
00145                 return True;
00146         }
00147 
00148         if(*plock_depth == 1) {
00149                 ret = do_file_lock(fd, 5, F_UNLCK);
00150         }
00151 
00152         if (*plock_depth > 0) {
00153                 (*plock_depth)--;
00154         }
00155 
00156         if(!ret) {
00157                 DEBUG(10,("pw_file_unlock: unlocking file failed, error = %s.\n",
00158                         strerror(errno)));
00159         }
00160         return ret;
00161 }

static void pdb_init_smb ( struct smb_passwd user  )  [static]

pdb_smbpasswd.c167 行で定義されています。

参照先 smb_passwd::pass_last_set_time.

参照元 startsmbfilepwent().

00168 {
00169         if (user == NULL) 
00170                 return;
00171         ZERO_STRUCTP (user);
00172         
00173         user->pass_last_set_time = (time_t)0;
00174 }

static FILE* startsmbfilepwent ( const char *  pfile,
enum pwf_access_type  type,
int *  lock_depth 
) [static]

pdb_smbpasswd.c183 行で定義されています。

参照先 smb_passwd::acct_ctrlcerrnofdfpsmb_passwd::pass_last_set_timepdb_decode_acct_ctrl()pdb_gethexpwd()pdb_init_smb()smbpasswd_privates::pw_bufpw_file_lock()pw_file_unlock()PWF_CREATEPWF_READPWF_UPDATEsmb_passwd::smb_namesmb_passwd::smb_nt_passwdsmb_passwd::smb_passwdsmb_passwd::smb_useridsmbpasswd_privates::smbntpwdsmbpasswd_privates::smbpwdstatusstrchr_m()strerror()StrnCaseCmp()strnequal()sys_fopen()sys_fstat()sys_open()sys_stat()sys_usleep()smbpasswd_privates::user_nameuser_name.


変数

SIG_ATOMIC_T gotalarm [static]

pdb_smbpasswd.c67 行で定義されています。


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