linux/net/sunrpc/auth_null.c
<<
" " " o/spa> " ospa> class="lxr_search">" ="+search" method="post" onsubmit="return do_search(this);">" " " Search " ospa> class="lxr_prefs" " " o/spa> < ="ajax+*" method="post" onsubmit="return false;">" oinput typ="vhidden" nam="vajax_lookup" id"vajax_lookup" alue="v">" <
odiv id"vfile_contents"
< <1o/a>ospa> class="comment">/*o/spa>
 < <2o/a>ospa> class="comment"> * linux/net/sunrpc/auth_null.co/spa>
 < <3o/a>ospa> class="comment"> *o/spa>
 < <4o/a>ospa> class="comment"> * AUTH_NULL authenticaion>. Really :-)o/spa>
 < <5o/a>ospa> class="comment"> *o/spa>
 < <6o/a>ospa> class="comment"> * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>o/spa>
 < <7o/a>ospa> class="comment"> */o/spa>
 < <8o/a>"< <9o/a>#include <linux/typ=s.ho/a>>"< 1#include <linux/module.ho/a>>"< 11/oa>#include <linux/sunrpc/clnt.ho/a>>"< 12o/a>"< 13/oa>#ifdefRPC_DEBUGo/a>"< 14o/a># defineRPCDBG_FACILITYo/a>        oa href="+code=RPCDBG_AUTH" class="sref">RPCDBG_AUTHo/a>"< 15o/a>#endif"< 16o/a>"< 17o/a>static struct oa href="+code=rpc_auth" class="sref">rpc_autho/a> oa href="+code=null_auth" class="sref">null_autho/a>;"< 18o/a>static struct oa href="+code=rpc_cred" class="sref">rpc_credo/a> oa href="+code=null_cred" class="sref">null_credo/a>;"< 19o/a>"< 20o/a>static struct oa href="+code=rpc_auth" class="sref">rpc_autho/a> *"< 21o/a>oa href="+code=nul_create" class="sref">nul_createo/a>(struct oa href="+code=rpc_clnt" class="sref">rpc_clnto/a> *oa href="+code=clnt" class="sref">clnto/a>, oa href="+code=rpc_authflavor_t" class="sref">rpc_authflavor_to/a> oa href="+code=flavor" class="sref">flavoro/a>)"< 22o/a>{"< 23o/a>        oa href="+code=atnmic_inc" class="sref">atnmic_inco/a>(&oa href="+code=null_auth" class="sref">null_autho/a>.oa href="+code=au_count" class="sref">au_counto/a>);"< 24o/a>        return &oa href="+code=null_auth" class="sref">null_autho/a>;"< 25o/a>}"< 26o/a>"< 27o/a>static void"< 28o/a>oa href="+code=nul_destroy" class="sref">nul_destroyo/a>(struct oa href="+code=rpc_auth" class="sref">rpc_autho/a> *oa href="+code=auth" class="sref">autho/a>)"< 29o/a>{"< 30o/a>}"< 31o/a>"< 32o/a>ospa> class="comment">/*o/spa>
 < 33o/a>ospa> class="comment"> * Lookup NULL creds for current processo/spa>
 < 34o/a>ospa> class="comment"> */o/spa>
 < 35o/a>static struct oa href="+code=rpc_cred" class="sref">rpc_credo/a> *"< 36o/a>oa href="+code=nul_lookup_cred" class="sref">nul_lookup_credo/a>(struct oa href="+code=rpc_auth" class="sref">rpc_autho/a> *oa href="+code=auth" class="sref">autho/a>, struct oa href="+code=auth_cred" class="sref">auth_credo/a> *oa href="+code=acred" class="sref">acredo/a>, int oa href="+code=flags" class="sref">flagso/a>)"< 37o/a>{"< 38o/a>        return oa href="+code=get_rpccred" class="sref">get_rpccredo/a>(&oa href="+code=null_cred" class="sref">null_credo/a>);"< 39o/a>}"< 40o/a>"< 41o/a>ospa> class="comment">/*o/spa>
 < 42o/a>ospa> class="comment"> * Destroy cred handle.o/spa>
 < 43o/a>ospa> class="comment"> */o/spa>
 < 44o/a>static void"< 45o/a>oa href="+code=nul_destroy_cred" class="sref">nul_destroy_credo/a>(struct oa href="+code=rpc_cred" class="sref">rpc_credo/a> *oa href="+code=cred" class="sref">credo/a>)"< 46o/a>{"< 47o/a>}"< 48o/a>"< 49o/a>ospa> class="comment">/*o/spa>
 < 50o/a>ospa> class="comment"> * Match cred handle against current processo/spa>
 < 51o/a>ospa> class="comment"> */o/spa>
 < 52o/a>static int < 53o/a>oa href="+code=nul_match" class="sref">nul_matcho/a>(struct oa href="+code=auth_cred" class="sref">auth_credo/a> *oa href="+code=acred" class="sref">acredo/a>, struct oa href="+code=rpc_cred" class="sref">rpc_credo/a> *oa href="+code=cred" class="sref">credo/a>, int oa href="+code=taskflags" class="sref">taskflagso/a>)"< 54o/a>{"< 55o/a>        return 1;"< 56o/a>}"< 57o/a>"< 58o/a>ospa> class="comment">/*o/spa>
 < 59o/a>ospa> class="comment"> * Marshal credential.o/spa>
 < 60o/a>ospa> class="comment"> */o/spa>
 < 61o/a>static oa href="+code=__be32" class="sref">__be32o/a> *"< 62o/a>oa href="+code=nul_marshal" class="sref">nul_marshalo/a>(struct oa href="+code=rpc_task" class="sref">rpc_tasko/a> *oa href="+code=task" class="sref">tasko/a>, oa href="+code=__be32" class="sref">__be32o/a> *oa href="+code=p" class="sref">po/a>)"< 63o/a>{"< 64o/a>        *oa href="+code=p" class="sref">po/a>++ = oa href="+code=htonl" class="sref">htonlo/a>(oa href="+code=RPC_AUTH_NULL" class="sref">RPC_AUTH_NULLo/a>);"< 65o/a>        *oa href="+code=p" class="sref">po/a>++ = 0;"< 66o/a>        *oa href="+code=p" class="sref">po/a>++ = oa href="+code=htonl" class="sref">htonlo/a>(oa href="+code=RPC_AUTH_NULL" class="sref">RPC_AUTH_NULLo/a>);"< 67o/a>        *oa href="+code=p" class="sref">po/a>++ = 0;"< 68o/a>"< 69o/a>        return oa href="+code=p" class="sref">po/a>;"< 70o/a>}"< 71o/a>"< 72o/a>ospa> class="comment">/*o/spa>
 < 73o/a>ospa> class="comment"> * Refresh credential. This is a no-op for AUTH_NULLo/spa>
 < 74o/a>ospa> class="comment"> */o/spa>
 < 75o/a>static int < 76o/a>oa href="+code=nul_refresh" class="sref">nul_refresho/a>(struct oa href="+code=rpc_task" class="sref">rpc_tasko/a> *oa href="+code=task" class="sref">tasko/a>)"< 77o/a>{"< 78o/a>        oa href="+code=set_bit" class="sref">set_bito/a>(oa href="+code=RPCAUTH_CRED_UPTODATE" class="sref">RPCAUTH_CRED_UPTODATEo/a>, &oa href="+code=task" class="sref">tasko/a>->oa href="+code=tk_rqstp" class="sref">tk_rqstpo/a>->oa href="+code=rq_cred" class="sref">rq_credo/a>->oa href="+code=cr_flags" class="sref">cr_flagso/a>);"< 79o/a>        return 0;"< 80o/a>}"< 81o/a>"< 82o/a>static oa href="+code=__be32" class="sref">__be32o/a> *"< 83o/a>oa href="+code=nul_validate" class="sref">nul_validateo/a>(struct oa href="+code=rpc_task" class="sref">rpc_tasko/a> *oa href="+code=task" class="sref">tasko/a>, oa href="+code=__be32" class="sref">__be32o/a> *oa href="+code=p" class="sref">po/a>)"< 84o/a>{"< 85o/a>        oa href="+code=rpc_authflavor_t" class="sref">rpc_authflavor_to/a>        oa href="+code=flavor" class="sref">flavoro/a>;"< 86o/a>        oa href="+code=u32" class="sref">u32o/a>                     oa href="+code=size" class="sref">sizeo/a>;"< 87o/a>"< 88o/a>        oa href="+code=flavor" class="sref">flavoro/a> = oa href="+code=ntohl" class="sref">ntohlo/a>(*oa href="+code=p" class="sref">po/a>++);"< 89o/a>        if (oa href="+code=flavor" class="sref">flavoro/a> != oa href="+code=RPC_AUTH_NULL" class="sref">RPC_AUTH_NULLo/a>) {"< 90o/a>                oa href="+code=printk" class="sref">printko/a>(ospa> class="string">"RPC: bad verf flavor: %u\n"o/spa>
, oa href="+code=flavor" class="sref">flavoro/a>);"< 91o/a>                return oa href="+code=NULL" class="sref">NULLo/a>;"< 92o/a>        }"< 93o/a>"< 94o/a>        oa href="+code=size" class="sref">sizeo/a> = oa href="+code=ntohl" class="sref">ntohlo/a>(*oa href="+code=p" class="sref">po/a>++);"< 95o/a>        if (oa href="+code=size" class="sref">sizeo/a> != 0) {"< 96o/a>                oa href="+code=printk" class="sref">printko/a>(ospa> class="string">"RPC: bad verf size: %u\n"o/spa>
, oa href="+code=size" class="sref">sizeo/a>);"< 97o/a>                return oa href="+code=NULL" class="sref">NULLo/a>;"< 98o/a>        }"< 99o/a>"<100o/a>        return oa href="+code=p" class="sref">po/a>;"<101o/a>}"<102o/a>"<103o/a>const struct oa href="+code=rpc_authops" class="sref">rpc_authopso/a> oa href="+code=authnull_ops" class="sref">authnull_opso/a> = {"<104o/a>        .oa href="+code=owner" class="sref">ownero/a>          = oa href="+code=THIS_MODULE" class="sref">THIS_MODULEo/a>,"<105o/a>        .oa href="+code=au_flavor" class="sref">au_flavoro/a>      = oa href="+code=RPC_AUTH_NULL" class="sref">RPC_AUTH_NULLo/a>,"<106o/a>        .oa href="+code=au_nam=" class="sref">au_nam=o/a>        = ospa> class="string">"NULL"o/spa>
,"<107o/a>        .oa href="+code=create" class="sref">createo/a>         = oa href="+code=nul_create" class="sref">nul_createo/a>,"<108o/a>        .oa href="+code=destroy" class="sref">destroyo/a>        = oa href="+code=nul_destroy" class="sref">nul_destroyo/a>,"<109o/a>        .oa href="+code=lookup_cred" class="sref">lookup_credo/a>    = oa href="+code=nul_lookup_cred" class="sref">nul_lookup_credo/a>,"<11};"<111o/a>"<112o/a>static"<113/oa>struct oa href="+code=rpc_auth" class="sref">rpc_autho/a> oa href="+code=null_auth" class="sref">null_autho/a> = {"<114o/a>        .oa href="+code=au_cslack" class="sref">au_cslacko/a>      = 4,"<115o/a>        .oa href="+code=au_rslack" class="sref">au_rslacko/a>      = 2,"<116o/a>        .oa href="+code=au_ops" class="sref">au_opso/a>         = &oa href="+code=authnull_ops" class="sref">authnull_opso/a>,"<117o/a>        .oa href="+code=au_flavor" class="sref">au_flavoro/a>      = oa href="+code=RPC_AUTH_NULL" class="sref">RPC_AUTH_NULLo/a>,"<118o/a>        .oa href="+code=au_count" class="sref">au_counto/a>       = oa href="+code=ATOMIC_INIT" class="sref">ATOMIC_INITo/a>(0),"<119o/a>};"<120o/a>"<121o/a>static"<122o/a>const struct oa href="+code=rpc_credops" class="sref">rpc_credopso/a> oa href="+code=null_credops" class="sref">null_credopso/a> = {"<123o/a>        .oa href="+code=cr_nam=" class="sref">cr_nam=o/a>        = ospa> class="string">"AUTH_NULL"o/spa>
,"<124o/a>        .oa href="+code=crdestroy" class="sref">crdestroyo/a>      = oa href="+code=nul_destroy_cred" class="sref">nul_destroy_credo/a>,"<125o/a>        .oa href="+code=crbind" class="sref">crbindo/a>         = oa href="+code=rpcauth_generic_bind_cred" class="sref">rpcauth_generic_bind_credo/a>,"<126o/a>        .oa href="+code=crmatch" class="sref">crmatcho/a>        = oa href="+code=nul_match" class="sref">nul_matcho/a>,"<127o/a>        .oa href="+code=crmarshal" class="sref">crmarshalo/a>      = oa href="+code=nul_marshal" class="sref">nul_marshalo/a>,"<128o/a>        .oa href="+code=crrefresh" class="sref">crrefresho/a>      = oa href="+code=nul_refresh" class="sref">nul_refresho/a>,"<129o/a>        .oa href="+code=crvalidate" class="sref">crvalidateo/a>     = oa href="+code=nul_validate" class="sref">nul_validateo/a>,"<13};"<131o/a>"<132o/a>static"<133/oa>struct oa href="+code=rpc_cred" class="sref">rpc_credo/a> oa href="+code=null_cred" class="sref">null_credo/a> = {"<134o/a>        .oa href="+code=cr_lru" class="sref">cr_lruo/a>         = oa href="+code=LIST_HEAD_INIT" class="sref">LIST_HEAD_INITo/a>(oa href="+code=null_cred" class="sref">null_credo/a>.oa href="+code=cr_lru" class="sref">cr_lruo/a>),"<135o/a>        .oa href="+code=cr_auth" class="sref">cr_autho/a>        = &oa href="+code=null_auth" class="sref">null_autho/a>,"<136o/a>        .oa href="+code=cr_ops" class="sref">cr_opso/a>         = &oa href="+code=null_credops" class="sref">null_credopso/a>,"<137o/a>        .oa href="+code=cr_count" class="sref">cr_counto/a>       = oa href="+code=ATOMIC_INIT" class="sref">ATOMIC_INITo/a>(1),"<138o/a>        .oa href="+code=cr_flags" class="sref">cr_flagso/a>       = 1UL << oa href="+code=RPCAUTH_CRED_UPTODATE" class="sref">RPCAUTH_CRED_UPTODATEo/a>,"<139o/a>#ifdefRPC_DEBUGo/a>"<140o/a>        .oa href="+code=cr_magic" class="sref">cr_magico/a>       = oa href="+code=RPCAUTH_CRED_MAGIC" class="sref">RPCAUTH_CRED_MAGICo/a>,"<141o/a>#endif"<142o/a>};"<143o/a>o/pre>
The original LXR software by theLXR communityo/a>, this experimental verson vby oa href="mailto:lxr@linux.no">lxr@linux.noo/a>. o/div odiv class="subfooter"> lxr.linux.no kindly hostedvby oa href="http://www.redpill-linpro.no">Redpill Linpro ASo/a>, provider of Linux consulting and operaion>s services since 1995. o/div o/body o/html