nsswitch/idmap_passdb.c

ソースコードを見る。

関数

static NTSTATUS idmap_pdb_init (struct idmap_domain *dom)
static NTSTATUS idmap_pdb_unixids_to_sids (struct idmap_domain *dom, struct id_map **ids)
static NTSTATUS idmap_pdb_sids_to_unixids (struct idmap_domain *dom, struct id_map **ids)
static NTSTATUS idmap_pdb_close (struct idmap_domain *dom)
NTSTATUS idmap_passdb_init (void)

変数

static struct idmap_methods passdb_methods


関数

static NTSTATUS idmap_pdb_init ( struct idmap_domain dom  )  [static]

idmap_passdb.c32 行で定義されています。

参照先 idmap_domain::initialized.

00033 {       
00034         dom->initialized = True;
00035         return NT_STATUS_OK;
00036 }

static NTSTATUS idmap_pdb_unixids_to_sids ( struct idmap_domain dom,
struct id_map **  ids 
) [static]

idmap_passdb.c42 行で定義されています。

参照先 ID_MAPPEDID_TYPE_GIDID_TYPE_UIDID_UNMAPPEDidmap_domain::initializedpdb_gid_to_sid()pdb_uid_to_sid()id_map::sidid_map::statusstatus.

00043 {
00044         int i;
00045 
00046         if (! dom->initialized) {
00047                 return NT_STATUS_UNSUCCESSFUL;
00048         }
00049 
00050         for (i = 0; ids[i]; i++) {
00051 
00052                 /* unmapped by default */
00053                 ids[i]->status = ID_UNMAPPED;
00054 
00055                 switch (ids[i]->xid.type) {
00056                 case ID_TYPE_UID:
00057                         if (pdb_uid_to_sid((uid_t)ids[i]->xid.id, ids[i]->sid)) {
00058                                 ids[i]->status = ID_MAPPED;
00059                         }
00060                         break;
00061                 case ID_TYPE_GID:
00062                         if (pdb_gid_to_sid((gid_t)ids[i]->xid.id, ids[i]->sid)) {
00063                                 ids[i]->status = ID_MAPPED;
00064                         }
00065                         break;
00066                 default: /* ?? */
00067                         ids[i]->status = ID_UNKNOWN;
00068                 }
00069         }
00070 
00071         return NT_STATUS_OK;
00072 }

static NTSTATUS idmap_pdb_sids_to_unixids ( struct idmap_domain dom,
struct id_map **  ids 
) [static]

idmap_passdb.c78 行で定義されています。

参照先 unixid::ididID_MAPPEDID_TYPE_GIDID_TYPE_UIDID_UNKNOWNID_UNMAPPEDidmap_domain::initializedpdb_sid_to_id()SID_NAME_ALIASSID_NAME_DOM_GRPSID_NAME_USERSID_NAME_WKN_GRPid_map::statusunixid::typetypeid_map::xid.

00079 {
00080         int i;
00081 
00082         if (! dom->initialized) {
00083                 return NT_STATUS_UNSUCCESSFUL;
00084         }
00085 
00086         for (i = 0; ids[i]; i++) {
00087                 enum lsa_SidType type;
00088                 union unid_t id;
00089                 
00090                 if (pdb_sid_to_id(ids[i]->sid, &id, &type)) {
00091                         switch (type) {
00092                         case SID_NAME_USER:
00093                                 ids[i]->xid.id = id.uid;
00094                                 ids[i]->xid.type = ID_TYPE_UID;
00095                                 ids[i]->status = ID_MAPPED;
00096                                 break;
00097 
00098                         case SID_NAME_DOM_GRP:
00099                         case SID_NAME_ALIAS:
00100                         case SID_NAME_WKN_GRP:
00101                                 ids[i]->xid.id = id.gid;
00102                                 ids[i]->xid.type = ID_TYPE_GID;
00103                                 ids[i]->status = ID_MAPPED;
00104                                 break;
00105 
00106                         default: /* ?? */
00107                                 /* make sure it is marked as unmapped */
00108                                 ids[i]->status = ID_UNKNOWN;
00109                                 break;
00110                         }
00111                 } else {
00112                         /* Query Failed */
00113                         ids[i]->status = ID_UNMAPPED;
00114                 }
00115         }
00116 
00117         return NT_STATUS_OK;
00118 }

static NTSTATUS idmap_pdb_close ( struct idmap_domain dom  )  [static]

idmap_passdb.c124 行で定義されています。

00125 {
00126         return NT_STATUS_OK;
00127 }

NTSTATUS idmap_passdb_init ( void   ) 

idmap_passdb.c137 行で定義されています。

参照先 passdb_methodssmb_register_idmap().

00138 {
00139         return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "passdb", &passdb_methods);
00140 }


変数

struct idmap_methods passdb_methods [static]

初期値:

 {

        .init = idmap_pdb_init,
        .unixids_to_sids = idmap_pdb_unixids_to_sids,
        .sids_to_unixids = idmap_pdb_sids_to_unixids,
        .close_fn =idmap_pdb_close
}

idmap_passdb.c129 行で定義されています。

参照元 idmap_passdb_init().


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