亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2661 | 回復(fù): 0
打印 上一主題 下一主題

[Mail] courier-authlib和sasl2認(rèn)證不同 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2011-03-22 19:53 |只看該作者 |倒序瀏覽
【引用】
jobesky 2011-03-18 10:11  NEW
版主  你好
再次打擾到你確實不好意思,不過最近項目確實碰到幾個棘手的問題?
我想問一下courier-authlib和sasl2認(rèn)證到底有什么不一樣呢?
為什么有必須有mysql又必須有l(wèi)dap,到底分別是做什么的認(rèn)證呢?

一個CUer的提問,回答提問的同時順便跟大家分享。

第一問:
The Courier Authentication Library is a generic authentication API that encapsulates the process of validating account passwords. In addition to reading the traditional account passwords from /etc/passwd, the account information can alternatively be obtained from an LDAP directory; a MySQL or a PostgreSQL database; or a GDBM or a DB file. The Courier authentication library must be installed before building any Courier packages that needs direct access to mailboxes .

簡單的說是給Courier mail server 提供好了驗證API接口,能允許訪問/etc/passwd,Mysql,LDAP等數(shù)據(jù)庫。
詳細(xì)說,可以看這個

  1. /tmp/courier-authlib-0.63.0$ ls *.c
  2. authcustom.c      authldaplib.c   authpgsql.c           authsaslclientcrammd5.c   authsasltobase64.c  checkpasswordsha1.c  preauthpgsql.c
  3. authdaemon.c      authmksock.c    authpgsqllib.c        authsaslclientcramsha1.c  authshadow.c        cramlib.c            preauthpwd.c
  4. authdaemond.c     authmoduser2.c  authpipe.c            authsaslclientexternal.c  authsyschangepwd.c  cryptpassword.c      preauthshadow.c
  5. authdaemonlib.c   authmoduser3.c  authpipelib.c         authsaslclientlogin.c     authsyscommon.c     debug.c              preauthuserdb.c
  6. authdaemontest.c  authmysql.c     authpwd.c             authsaslclientplain.c     authtest.c          preauthcustom.c      preauthuserdbcommon.c
  7. authenumerate.c   authmysqllib.c  authpwdenumerate.c    authsaslcram.c            authuserdb.c        preauthdaemon.c
  8. authinfo.c        authoption.c    authsasl.c            authsaslfrombase64.c      authuserdbpwd.c     preauthldap.c
  9. authldap.c        authpam.c       authsaslclient.c      authsasllogin.c           checkpassword.c     preauthmysql.c
  10. authldapescape.c  authpasswd.c    authsaslclientcram.c  authsaslplain.c           checkpasswordmd5.c  preauthpam.c
復(fù)制代碼
這些都是C源碼文件,以這幾個 authmysql.c     authmysql.h     authmysqllib.c 為例,他們主要作用就是訪問MYSQL數(shù)據(jù)庫中賬戶資料。那其它的有 authpam.c authpgsql.c  authsasl.c等等這些有訪問pam 、pgsql 、sasl ,有的是數(shù)據(jù)庫,有的是本地數(shù)據(jù)文件,有的驗證應(yīng)用接口。好比你買了一個手機(jī)萬能沖,對不同電池要更換不同接口。這里可以看到SASL也是接口之一。


SASL is the Simple Authentication and Security Layer, a method for adding authentication support to connection-based protocols. To use SASL, a protocol includes a command for identifying and authenticating a user to a server and for optionally negotiating protection of subsequent protocol interactions. If its use is negotiated, a security layer is inserted between the protocol and the connection.


簡單的說SASL使用一個協(xié)議,其作用提供驗證支持。
  1. #ls /var/run/saslauthd/* -l
  2. srwxrwxrwx 1 root root 0 Mar 22 19:00 /var/run/saslauthd/mux
  3. -rw------- 1 root root 0 Mar 22 19:00 /var/run/saslauthd/mux.accept
  4. -rw------- 1 root root 5 Mar 22 19:00 /var/run/saslauthd/saslauthd.pid
復(fù)制代碼
  1. #saslauthd -v
  2. saslauthd 2.1.22
  3. authentication mechanisms: getpwent kerberos5 pam rimap shadow ldap
復(fù)制代碼
先說點別的,有一個老板想看電影,叫秘書去買票,秘書買票的時候可以有很多選擇,例如網(wǎng)購、電話訂購、影院排隊等。最后老板拿到兩張票,但是絲毫不關(guān)心票是怎么買的。
通過這個小故事你不難發(fā)現(xiàn),老板<---->秘書是很簡單關(guān)系。秘書->(網(wǎng)購、電話訂購、影院排隊)復(fù)雜了一些。


正題拓?fù)潢P(guān)系:
Client -------用戶密碼請求-------> Service App  (老板)
                                                |   ^
                                                v   |
                                             ---SASL----/var/run/saslauthd/mux   (秘書)
                                             -------------  /etc/init.d/saslauthd
                                                |   ^
                                                v   |
                                          getpwent kerberos5 pam rimap shadow ldap  (網(wǎng)購、電話訂購、影院排隊)
                                       
沒什么多說的,應(yīng)該看的明白。Service App 不知道用戶密碼真?zhèn),把驗證的事情交給saslauthd,而saslauthd又著其它機(jī)制來驗證這個用戶密碼。


第二個問題
       選擇那一個都可以,不是必須兩都具備。




PS:以上如有錯誤,歡迎大家指正。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP