linux/net/sunrpc/auth_unix.c
<<
Searchi div id55file_contents"t
   1 /a> spap class="comment">/* /spapti   2 /a> spap class="comment"> * linux/net/sunrpc/auth_unix.c /spapti   3 /a> spap class="comment"> * /spapti   4 /a> spap class="comment"> * UNIX-style authentica   5 /a> spap class="comment"> * /spapti   6 /a> spap class="comment"> * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> /spapti   7 /a> spap class="comment"> */ /spapti   8 /a><   9 /a>#include <linux/slab.h /a>><  3luea>#include <linux/typ.s.h /a>><  11 /a>#include <linux/sched.h /a>><  12 /a>#include <linux/module.h /a>><  13 /a>#include <linux/sunrpc/clnt.h /a>><  14 /a>#include <linux/sunrpc/auth.h /a>><  15 /a>#include <linux/user_nam.space.h /a>><  16 /a><  17 /a>#define  a href="+code=NFS_NGROUPS" class="sref">NFS_NGROUPS /a>p
   16<  18 /a><  19 /a>struct  a href="+code=unx_cred" class="sref">unx_cred /a>p{i  20 /a>p
      struct  a href="+code=rpc_cred" class="sref">rpc_cred /a>p
        a href="+code=uc_base" class="sref">uc_base /a>;<  21 /a>p
       a href="+code=gid_t" class="sref">gid_t /a>p
        p
        a href="+code=uc_gid" class="sref">uc_gid /a>;<  22 /a>p
       a href="+code=gid_t" class="sref">gid_t /a>p
        p
        a href="+code=uc_gids" class="sref">uc_gids /a>[ a href="+code=NFS_NGROUPS" class="sref">NFS_NGROUPS /a>];<  23 /a>};<  24 /a>#define  a href="+code=uc_uid" class="sref">uc_uid /a>p
        p
       a href="+code=uc_base" class="sref">uc_base /a>. a href="+code=cr_uid" class="sref">cr_uid /a><  25 /a><  26 /a>#define  a href="+code=UNX_WRITESLACK" class="sref">UNX_WRITESLACK /a>p
        (21 + ( a href="+code=UNX_MAXNODENAME" class="sref">UNX_MAXNODENAME /a>p>> 2))<  27 /a><  28 /a>#ifdef  a href="+code=RPC_DEBUG" class="sref">RPC_DEBUG /a><  29 /a># define  a href="+code=RPCDBG_FACILITY" class="sref">RPCDBG_FACILITY /a>p
       a href="+code=RPCDBG_AUTH" class="sref">RPCDBG_AUTH /a><  3luea>#endif<  31 /a><  32 /a>static struct  a href="+code=rpc_auth" class="sref">rpc_auth /a>p
         a href="+code=unix_auth" class="sref">unix_auth /a>;<  33 /a>static const struct  a href="+code=rpc_credops" class="sref">rpc_credops /a>p a href="+code=unix_credops" class="sref">unix_credops /a>;<  34 /a><  35 /a>static struct  a href="+code=rpc_auth" class="sref">rpc_auth /a>p*<  36 /a> a href="+code=unx_create" class="sref">unx_create /a>(struct  a href="+code=rpc_clnt" class="sref">rpc_clnt /a>p* a href="+code=clnt" class="sref">clnt /a>,  a href="+code=rpc_authflavor_t" class="sref">rpc_authflavor_t /a>p a href="+code=flavor" class="sref">flavor /a>)<  37 /a>{i  38 /a>p
       a href="+code=dprintk" class="sref">dprintk /a>( spap class="string">"RPC:
      creating UNIX authentica  39 /a>p
        p
             a href="+code=clnt" class="sref">clnt /a>);<  40 /a>p
       a href="+code=aa(& a href="+code=unix_auth" class="sref">unix_auth /a>. a href="+code=au_count" class="sref">au_count /a>);<  41 /a>p
      return & a href="+code=unix_auth" class="sref">unix_auth /a>;<  42 /a>}<  43 /a><  44 /a>static void<  45 /a> a href="+code=unx_destroy" class="sref">unx_destroy /a>(struct  a href="+code=rpc_auth" class="sref">rpc_auth /a>p* a href="+code=auth" class="sref">auth /a>)<  46 /a>{i  47 /a>p
       a href="+code=dprintk" class="sref">dprintk /a>( spap class="string">"RPC:
      destroying UNIX authenticaauth /a>);<  48 /a>p
       a href="+code=rpcauth_clear_credcache" class="sref">rpcauth_clear_credcache /a>( a href="+code=auth" class="sref">auth /a>-> a href="+code=au_credcache" class="sref">au_credcache /a>);<  49 /a>}<  50 /a><  51 /a> spap class="comment">/* /spapti  52 /a> spap class="comment"> * Lookup AUTH_UNIX creds for current process /spapti  53 /a> spap class="comment"> */ /spapti  54 /a>static struct  a href="+code=rpc_cred" class="sref">rpc_cred /a>p*<  55 /a> a href="+code=unx_lookup_cred" class="sref">unx_lookup_cred /a>(struct  a href="+code=rpc_auth" class="sref">rpc_auth /a>p* a href="+code=auth" class="sref">auth /a>, struct  a href="+code=auth_cred" class="sref">auth_cred /a>p* a href="+code=acred" class="sref">acred /a>, intp a href="+code=flags" class="sref">flags /a>)<  56 /a>{i  57 /a>p
      return  a href="+code=rpcauth_lookup_credcache" class="sref">rpcauth_lookup_credcache /a>( a href="+code=auth" class="sref">auth /a>,  a href="+code=acred" class="sref">acred /a>,  a href="+code=flags" class="sref">flags /a>);<  58 /a>}<  59 /a><  60 /a>static struct  a href="+code=rpc_cred" class="sref">rpc_cred /a>p*<  61 /a> a href="+code=unx_create_cred" class="sref">unx_create_cred /a>(struct  a href="+code=rpc_auth" class="sref">rpc_auth /a>p* a href="+code=auth" class="sref">auth /a>, struct  a href="+code=auth_cred" class="sref">auth_cred /a>p* a href="+code=acred" class="sref">acred /a>, intp a href="+code=flags" class="sref">flags /a>)<  62 /a>{i  63 /a>p
      struct  a href="+code=unx_cred" class="sref">unx_cred /a>p* a href="+code=cred" class="sref">cred /a>;<  64 /a>p
      unsigned intp a href="+code=groups" class="sref">groups /a>p= 0;<  65 /a>p
      unsigned intp a href="+code=i" class="sref">i /a>;<  66 /a><  67 /a>p
       a href="+code=dprintk" class="sref">dprintk /a>( spap class="string">"RPC:
      allocating UNIX cred for uid %d gid %d\n" /spapt,i  68 /a>p
        p
             a href="+code=acred" class="sref">acred /a>-> a href="+code=uid" class="sref">uid /a>,  a href="+code=acred" class="sref">acred /a>-> a href="+code=gid" class="sref">gid /a>);<  69 /a><  70 /a>p
      if (!( a href="+code=cred" class="sref">cred /a>p=  a href="+code=kmalloc" class="sref">kmalloc /a>(sizeof(* a href="+code=cred" class="sref">cred /a>),  a href="+code=GFP_NOFS" class="sref">GFP_NOFS /a>)))<  71 /a>p
        p
    return  a href="+code=ERR_PTR" class="sref">ERR_PTR /a>(- a href="+code=ENOMEM" class="sref">ENOMEM /a>);<  72 /a><  73 /a>p
       a href="+code=rpcauth_init_cred" class="sref">rpcauth_init_cred /a>(& a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_base" class="sref">uc_base /a>,  a href="+code=acred" class="sref">acred /a>,  a href="+code=auth" class="sref">auth /a>, & a href="+code=unix_credops" class="sref">unix_credops /a>);<  74 /a>p
       a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_base" class="sref">uc_base /a>. a href="+code=cr_flags" class="sref">cr_flags /a>p= 1UL <<  a href="+code=RPCAUTH_CRED_UPTODATE" class="sref">RPCAUTH_CRED_UPTODATE /a>;<  75 /a><  76 /a>p
      if ( a href="+code=acred" class="sref">acred /a>-> a href="+code=group_info" class="sref">group_info /a>p!=  a href="+code=NULL" class="sref">NULL /a>)<  77 /a>p
        p
     a href="+code=groups" class="sref">groups /a>p=  a href="+code=acred" class="sref">acred /a>-> a href="+code=group_info" class="sref">group_info /a>-> a href="+code=ngroups" class="sref">ngroups /a>;<  78 /a>p
      if ( a href="+code=groups" class="sref">groups /a>p>  a href="+code=NFS_NGROUPS" class="sref">NFS_NGROUPS /a>)<  79 /a>p
        p
     a href="+code=groups" class="sref">groups /a>p=  a href="+code=NFS_NGROUPS" class="sref">NFS_NGROUPS /a>;<  80 /a><  81 /a>p
       a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_gid" class="sref">uc_gid /a>p=  a href="+code=acred" class="sref">acred /a>-> a href="+code=gid" class="sref">gid /a>;<  82 /a>p
      for ( a href="+code=i" class="sref">i /a>p= 0;p a href="+code=i" class="sref">i /a> <  a href="+code=groups" class="sref">groups /a>;p a href="+code=i" class="sref">i /a>++)p{i  83 /a>p
        p
     a href="+code=gid_t" class="sref">gid_t /a>p a href="+code=gid" class="sref">gid /a>;<  84 /a>p
        p
     a href="+code=gid" class="sref">gid /a>p=  a href="+code=from_kgid" class="sref">from_kgid /a>(& a href="+code=init_user_ns" class="sref">init_user_ns /a>,  a href="+code=GROUP_AT" class="sref">GROUP_AT /a>( a href="+code=acred" class="sref">acred /a>-> a href="+code=group_info" class="sref">group_info /a>,  a href="+code=i" class="sref">i /a>));<  85 /a>p
        p
     a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_gids" class="sref">uc_gids /a>[ a href="+code=i" class="sref">i /a>]p=  a href="+code=gid" class="sref">gid /a>;<  86 /a>p
      }<  87 /a>p
      if ( a href="+code=i" class="sref">i /a> <  a href="+code=NFS_NGROUPS" class="sref">NFS_NGROUPS /a>)<  88 /a>p
        p
     a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_gids" class="sref">uc_gids /a>[ a href="+code=i" class="sref">i /a>]p=  a href="+code=NOGROUP" class="sref">NOGROUP /a>;<  89 /a><  90 /a>p
      return & a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_base" class="sref">uc_base /a>;<  91 /a>}<  92 /a><  93 /a>static void<  94 /a> a href="+code=unx_free_cred" class="sref">unx_free_cred /a>(struct  a href="+code=unx_cred" class="sref">unx_cred /a>p* a href="+code=unx_cred" class="sref">unx_cred /a>)<  95 /a>{i  96 /a>p
       a href="+code=dprintk" class="sref">dprintk /a>( spap class="string">"RPC:
      unx_free_cred %p\n" /spapt,  a href="+code=unx_cred" class="sref">unx_cred /a>);<  97 /a>p
       a href="+code=kfree" class="sref">kfree /a>( a href="+code=unx_cred" class="sref">unx_cred /a>);<  98 /a>}<  99 /a>< 100 /a>static void< 101 /a> a href="+code=unx_free_cred_callback" class="sref">unx_free_cred_callback /a>(struct  a href="+code=rcu_head" class="sref">rcu_head /a>p* a href="+code=head" class="sref">head /a>)< 102 /a>{i 103 /a>p
      struct  a href="+code=unx_cred" class="sref">unx_cred /a>p* a href="+code=unx_cred" class="sref">unx_cred /a>p=  a href="+code=container_of" class="sref">container_of /a>( a href="+code=head" class="sref">head /a>, struct  a href="+code=unx_cred" class="sref">unx_cred /a>,  a href="+code=uc_base" class="sref">uc_base /a>. a href="+code=cr_rcu" class="sref">cr_rcu /a>);< 104 /a>p
       a href="+code=unx_free_cred" class="sref">unx_free_cred /a>( a href="+code=unx_cred" class="sref">unx_cred /a>);< 105 /a>}< 106 /a>< 107 /a>static void< 108 /a> a href="+code=unx_destroy_cred" class="sref">unx_destroy_cred /a>(struct  a href="+code=rpc_cred" class="sref">rpc_cred /a>p* a href="+code=cred" class="sref">cred /a>)< 109 /a>{i 110 /a>p
       a href="+code=call_rcu" class="sref">call_rcu /a>(& a href="+code=cred" class="sref">cred /a>-> a href="+code=cr_rcu" class="sref">cr_rcu /a>,  a href="+code=unx_free_cred_callback" class="sref">unx_free_cred_callback /a>);< 111 /a>}< 112 /a>< 113 /a> spap class="comment">/* /spapti 114 /a> spap class="comment"> * Match credentials against current process creds. /spapti 115 /a> spap class="comment"> * The root_override argument takes care of cases where the caller may /spapti 116 /a> spap class="comment"> * request root creds (e.g. for NFS swapping). /spapti 117 /a> spap class="comment"> */ /spapti 118 /a>static inti 119 /a> a href="+code=unx_match" class="sref">unx_match /a>(struct  a href="+code=auth_cred" class="sref">auth_cred /a>p* a href="+code=acred" class="sref">acred /a>, struct  a href="+code=rpc_cred" class="sref">rpc_cred /a>p* a href="+code=rcred" class="sref">rcred /a>, intp a href="+code=flags" class="sref">flags /a>)< 120 /a>{i 121 /a>p
      struct  a href="+code=unx_cred" class="sref">unx_cred /a>p* a href="+code=cred" class="sref">cred /a>p=  a href="+code=container_of" class="sref">container_of /a>( a href="+code=rcred" class="sref">rcred /a>, struct  a href="+code=unx_cred" class="sref">unx_cred /a>,  a href="+code=uc_base" class="sref">uc_base /a>);< 122 /a>p
      unsigned intp a href="+code=groups" class="sref">groups /a>p= 0;< 123 /a>p
      unsigned intp a href="+code=i" class="sref">i /a>;< 124 /a>< 125 /a>< 126 /a>p
      if ( a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_uid" class="sref">uc_uid /a>p!=  a href="+code=acred" class="sref">acred /a>-> a href="+code=uid" class="sref">uid /a> ||  a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_gid" class="sref">uc_gid /a>p!=  a href="+code=acred" class="sref">acred /a>-> a href="+code=gid" class="sref">gid /a>)< 127 /a>p
        p
    return 0;< 128 /a>< 129 /a>p
      if ( a href="+code=acred" class="sref">acred /a>-> a href="+code=group_info" class="sref">group_info /a>p!=  a href="+code=NULL" class="sref">NULL /a>)< 130 /a>p
        p
     a href="+code=groups" class="sref">groups /a>p=  a href="+code=acred" class="sref">acred /a>-> a href="+code=group_info" class="sref">group_info /a>-> a href="+code=ngroups" class="sref">ngroups /a>;< 131 /a>p
      if ( a href="+code=groups" class="sref">groups /a>p>  a href="+code=NFS_NGROUPS" class="sref">NFS_NGROUPS /a>)< 132 /a>p
        p
     a href="+code=groups" class="sref">groups /a>p=  a href="+code=NFS_NGROUPS" class="sref">NFS_NGROUPS /a>;< 133 /a>p
      for ( a href="+code=i" class="sref">i /a>p= 0;p a href="+code=i" class="sref">i /a> <  a href="+code=groups" class="sref">groups /a> ;p a href="+code=i" class="sref">i /a>++)p{i 134 /a>p
        p
     a href="+code=gid_t" class="sref">gid_t /a>p a href="+code=gid" class="sref">gid /a>;< 135 /a>p
        p
     a href="+code=gid" class="sref">gid /a>p=  a href="+code=from_kgid" class="sref">from_kgid /a>(& a href="+code=init_user_ns" class="sref">init_user_ns /a>,  a href="+code=GROUP_AT" class="sref">GROUP_AT /a>( a href="+code=acred" class="sref">acred /a>-> a href="+code=group_info" class="sref">group_info /a>,  a href="+code=i" class="sref">i /a>));< 136 /a>p
        p
    if ( a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_gids" class="sref">uc_gids /a>[ a href="+code=i" class="sref">i /a>]p!=  a href="+code=gid" class="sref">gid /a>)< 137 /a>p
        p
      p
    return 0;< 138 /a>p
      }< 139 /a>p
      if ( a href="+code=groups" class="sref">groups /a>p<  a href="+code=NFS_NGROUPS" class="sref">NFS_NGROUPS /a> &&< 140 /a>p
        p
 a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_gids" class="sref">uc_gids /a>[ a href="+code=groups" class="sref">groups /a>]p!=  a href="+code=NOGROUP" class="sref">NOGROUP /a>)< 141 /a>p
        p
    return 0;< 142 /a>p
      return 1;< 143 /a>}< 144 /a>< 145 /a> spap class="comment">/* /spapti 146 /a> spap class="comment"> * Marshal credentials. /spapti 147 /a> spap class="comment"> * Maybe we should keep a cached credential for performance reasons. /spapti 148 /a> spap class="comment"> */ /spapti 149 /a>static  a href="+code=__be32" class="sref">__be32 /a>p*i 150 /a> a href="+code=unx_marshal" class="sref">unx_marshal /a>(struct  a href="+code=rpc_task" class="sref">rpc_task /a>p* a href="+code=task" class="sref">task /a>,  a href="+code=__be32" class="sref">__be32 /a>p* a href="+code=p" class="sref">p /a>)< 151 /a>{i 152 /a>p
      struct  a href="+code=rpc_clnt" class="sref">rpc_clnt /a>p* a href="+code=clnt" class="sref">clnt /a>p=  a href="+code=task" class="sref">task /a>-> a href="+code=tk_client" class="sref">tk_client /a>;< 153 /a>p
      struct  a href="+code=unx_cred" class="sref">unx_cred /a>p* a href="+code=cred" class="sref">cred /a>p=  a href="+code=container_of" class="sref">container_of /a>( a href="+code=task" class="sref">task /a>-> a href="+code=tk_rqstp" class="sref">tk_rqstp /a>-> a href="+code=rq_cred" class="sref">rq_cred /a>, struct  a href="+code=unx_cred" class="sref">unx_cred /a>,  a href="+code=uc_base" class="sref">uc_base /a>);< 154 /a>p
       a href="+code=__be32" class="sref">__be32 /a>pppppppppp* a href="+code=base" class="sref">base /a>, * a href="+code=hold" class="sref">hold /a>;< 155 /a>p
      intpp
        p
 a href="+code=i" class="sref">i /a>;< 156 /a>< 157 /a>p
      * a href="+code=p" class="sref">p /a>++p=  a href="+code=htonl" class="sref">htonl /a>( a href="+code=RPC_AUTH_UNIX" class="sref">RPC_AUTH_UNIX /a>);< 158 /a>p
       a href="+code=base" class="sref">base /a>p=  a href="+code=p" class="sref">p /a>++;< 159 /a>p
      * a href="+code=p" class="sref">p /a>++p=  a href="+code=htonl" class="sref">htonl /a>( a href="+code=jiffies" class="sref">jiffies /a>/ a href="+code=HZ" class="sref">HZ /a>);< 160 /a>< 161 /a>p
       spap class="comment">/* /spapti 162 /a> spap class="comment"> p
      * Copy the UTS nodenam. captured when the client was created. /spapti 163 /a> spap class="comment"> p
      */ /spapti 164 /a>p
       a href="+code=p" class="sref">p /a>p=  a href="+code=xdr_encode_array" class="sref">xdr_encode_array /a>( a href="+code=p" class="sref">p /a>,  a href="+code=clnt" class="sref">clnt /a>-> a href="+code=cl_nodenam." class="sref">cl_nodenam. /a>,  a href="+code=clnt" class="sref">clnt /a>-> a href="+code=cl_nodelen" class="sref">cl_nodelen /a>);< 165 /a>< 166 /a>p
      * a href="+code=p" class="sref">p /a>++p=  a href="+code=htonl" class="sref">htonl /a>(( a href="+code=u32" class="sref">u32 /a>)
 a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_uid" class="sref">uc_uid /a>);< 167 /a>p
      * a href="+code=p" class="sref">p /a>++p=  a href="+code=htonl" class="sref">htonl /a>(( a href="+code=u32" class="sref">u32 /a>)
 a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_gid" class="sref">uc_gid /a>);< 168 /a>p
       a href="+code=hold" class="sref">hold /a>p=  a href="+code=p" class="sref">p /a>++;< 169 /a>p
      for ( a href="+code=i" class="sref">i /a>p= 0;p a href="+code=i" class="sref">i /a> < 16 &&  a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_gids" class="sref">uc_gids /a>[ a href="+code=i" class="sref">i /a>]p!= ( a href="+code=gid_t" class="sref">gid_t /a>)
 a href="+code=NOGROUP" class="sref">NOGROUP /a>;p a href="+code=i" class="sref">i /a>++)< 170 /a>p
        p
    * a href="+code=p" class="sref">p /a>++p=  a href="+code=htonl" class="sref">htonl /a>(( a href="+code=u32" class="sref">u32 /a>)
 a href="+code=cred" class="sref">cred /a>-> a href="+code=uc_gids" class="sref">uc_gids /a>[ a href="+code=i" class="sref">i /a>]);< 171 /a>p
      * a href="+code=hold" class="sref">hold /a>p=  a href="+code=htonl" class="sref">htonl /a>( a href="+code=p" class="sref">p /a>p-  a href="+code=hold" class="sref">hold /a>p- 1);p
        p
 spap class="comment">/* gid array length */ /spapti 172 /a>p
      * a href="+code=base" class="sref">base /a>p=  a href="+code=htonl" class="sref">htonl /a>(( a href="+code=p" class="sref">p /a>p-  a href="+code=base" class="sref">base /a>p- 1) << 2);p
    spap class="comment">/* cred length */ /spapti 173 /a>< 174 /a>p
      * a href="+code=p" class="sref">p /a>++p=  a href="+code=htonl" class="sref">htonl /a>( a href="+code=RPC_AUTH_NULL" class="sref">RPC_AUTH_NULL /a>);< 175 /a>p
      * a href="+code=p" class="sref">p /a>++p=  a href="+code=htonl" class="sref">htonl /a>(0);< 176 /a>< 177 /a>p
      return  a href="+code=p" class="sref">p /a>;< 178 /a>}< 179 /a>< 180 /a> spap class="comment">/* /spapti 181 /a> spap class="comment"> * Refresh credentials. This is a no-op for AUTH_UNIX /spapti 182 /a> spap class="comment"> */ /spapti 183 /a>static inti 184 /a> a href="+code=unx_refresh" class="sref">unx_refresh /a>(struct  a href="+code=rpc_task" class="sref">rpc_task /a>p* a href="+code=task" class="sref">task /a>)< 185 /a>{i 186 /a>p
       a href="+code=set_bit" class="sref">set_bit /a>( a href="+code=RPCAUTH_CRED_UPTODATE" class="sref">RPCAUTH_CRED_UPTODATE /a>, & a href="+code=task" class="sref">task /a>-> a href="+code=tk_rqstp" class="sref">tk_rqstp /a>-> a href="+code=rq_cred" class="sref">rq_cred /a>-> a href="+code=cr_flags" class="sref">cr_flags /a>);< 187 /a>p
      return 0;< 188 /a>}< 189 /a>< 190 /a>static  a href="+code=__be32" class="sref">__be32 /a>p*i 191 /a> a href="+code=unx_validate" class="sref">unx_validate /a>(struct  a href="+code=rpc_task" class="sref">rpc_task /a>p* a href="+code=task" class="sref">task /a>,  a href="+code=__be32" class="sref">__be32 /a>p* a href="+code=p" class="sref">p /a>)< 192 /a>{i 193 /a>p
       a href="+code=rpc_authflavor_t" class="sref">rpc_authflavor_t /a>p
       a href="+code=flavor" class="sref">flavor /a>;< 194 /a>p
       a href="+code=u32" class="sref">u32 /a>p
        p
          a href="+code=size" class="sref">size /a>;< 195 /a>< 196 /a>p
       a href="+code=flavor" class="sref">flavor /a>p=  a href="+code=ntohl" class="sref">ntohl /a>(* a href="+code=p" class="sref">p /a>++);< 197 /a>p
      if ( a href="+code=flavor" class="sref">flavor /a>p!=  a href="+code=RPC_AUTH_NULL" class="sref">RPC_AUTH_NULL /a> &&< 198 /a>p
        p
 a href="+code=flavor" class="sref">flavor /a>p!=  a href="+code=RPC_AUTH_UNIX" class="sref">RPC_AUTH_UNIX /a> &&< 199 /a>p
        p
 a href="+code=flavor" class="sref">flavor /a>p!=  a href="+code=RPC_AUTH_SHORT" class="sref">RPC_AUTH_SHORT /a>)
{i 200 /a>p
        p
     a href="+code=printk" class="sref">printk /a>( spap class="string">"RPC:
bad verf flavor: %u\n" /spapt,  a href="+code=flavor" class="sref">flavor /a>);< 201 /a>p
        p
    return  a href="+code=NULL" class="sref">NULL /a>;< 202 /a>p
      }< 203 /a>< 204 /a>p
       a href="+code=size" class="sref">size /a>p=  a href="+code=ntohl" class="sref">ntohl /a>(* a href="+code=p" class="sref">p /a>++);< 205 /a>p
      if ( a href="+code=size" class="sref">size /a>p>  a href="+code=RPC_MAX_AUTH_SIZE" class="sref">RPC_MAX_AUTH_SIZE /a>)
{i 206 /a>p
        p
     a href="+code=printk" class="sref">printk /a>( spap class="string">"RPC:
giant verf size: %u\n" /spapt,  a href="+code=size" class="sref">size /a>);< 207 /a>p
        p
    return  a href="+code=NULL" class="sref">NULL /a>;< 208 /a>p
      }< 209 /a>p
       a href="+code=task" class="sref">task /a>-> a href="+code=tk_rqstp" class="sref">tk_rqstp /a>-> a href="+code=rq_cred" class="sref">rq_cred /a>-> a href="+code=cr_auth" class="sref">cr_auth /a>-> a href="+code=au_rslack" class="sref">au_rslack /a>p= ( a href="+code=size" class="sref">size /a>p>> 2) + 2;< 210 /a>p
       a href="+code=p" class="sref">p /a>p+= ( a href="+code=size" class="sref">size /a>p>> 2);< 211 /a>< 212 /a>p
      return  a href="+code=p" class="sref">p /a>;< 213 /a>}< 214 /a>< 215 /a>intp a href="+code=__init" class="sref">__init /a>p a href="+code=rpc_init_authunix" class="sref">rpc_init_authunix /a>(void)< 216 /a>{i 217 /a>p
      return  a href="+code=rpcauth_init_credcache" class="sref">rpcauth_init_credcache /a>(& a href="+code=unix_auth" class="sref">unix_auth /a>);< 218 /a>}< 219 /a>< 220 /a>voidp a href="+code=rpc_destroy_authunix" class="sref">rpc_destroy_authunix /a>(void)< 221 /a>{i 222 /a>p
       a href="+code=rpcauth_destroy_credcache" class="sref">rpcauth_destroy_credcache /a>(& a href="+code=unix_auth" class="sref">unix_auth /a>);< 223 /a>}< 224 /a>< 225 /a>const struct  a href="+code=rpc_authops" class="sref">rpc_authops /a>p a href="+code=authunix_ops" class="sref">authunix_ops /a>p= {i 226 /a>p
      . a href="+code=owner" class="sref">owner /a>p
        =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,i 227 /a>p
      . a href="+code=au_flavor" class="sref">au_flavor /a>p
    =  a href="+code=RPC_AUTH_UNIX" class="sref">RPC_AUTH_UNIX /a>,i 228 /a>p
      . a href="+code=au_nam." class="sref">au_nam. /a>p
      =  spap class="string">"UNIX" /spapt,i 229 /a>p
      . a href="+code=create" class="sref">create /a>p
       =  a href="+code=unx_create" class="sref">unx_create /a>,i 230 /a>p
      . a href="+code=destroy" class="sref">destroy /a>p
      =  a href="+code=unx_destroy" class="sref">unx_destroy /a>,i 231 /a>p
      . a href="+code=lookup_cred" class="sref">lookup_cred /a>p
  =  a href="+code=unx_lookup_cred" class="sref">unx_lookup_cred /a>,i 232 /a>p
      . a href="+code=crcreate" class="sref">crcreate /a>p
     =  a href="+code=unx_create_cred" class="sref">unx_create_cred /a>,i 233 /a>};< 234 /a>< 235 /a>static< 236 /a>struct  a href="+code=rpc_auth" class="sref">rpc_auth /a>pp
       a href="+code=unix_auth" class="sref">unix_auth /a>p= {i 237 /a>p
      . a href="+code=au_cslack" class="sref">au_cslack /a>p     =  a href="+code=UNX_WRITESLACK" class="sref">UNX_WRITESLACK /a>,i 238 /a>p
      . a href="+code=au_rslack" class="sref">au_rslack /a>p     = 2,                     spap class="comment">/* assume AUTH_NULL verf */ /spapti 239 /a>p
      . a href="+code=au_ops" class="sref">au_ops /a>pp
      = & a href="+code=authunix_ops" class="sref">authunix_ops /a>,i 240 /a>p
      . a href="+code=au_flavor" class="sref">au_flavor /a>p
    =  a href="+code=RPC_AUTH_UNIX" class="sref">RPC_AUTH_UNIX /a>,i 241 /a>p
      . a href="+code=au_count" class="sref">au_count /a>p
     =  a href="+code=ATOMIC_INIT" class="sref">ATOMIC_INIT /a>(0),i 242 /a>};< 243 /a>< 244 /a>static< 245 /a>const struct  a href="+code=rpc_credops" class="sref">rpc_credops /a>p a href="+code=unix_credops" class="sref">unix_credops /a>p= {i 246 /a>p
      . a href="+code=cr_nam." class="sref">cr_nam. /a>p
      =  spap class="string">"AUTH_UNIX" /spapt,i 247 /a>p
      . a href="+code=crdestroy" class="sref">crdestroy /a>p
    =  a href="+code=unx_destroy_cred" class="sref">unx_destroy_cred /a>,i 248 /a>p
      . a href="+code=crbind" class="sref">crbind /a>p
       =  a href="+code=rpcauth_generic_bind_cred" class="sref">rpcauth_generic_bind_cred /a>,i 249 /a>p
      . a href="+code=crmatch" class="sref">crmatch /a>p
      =  a href="+code=unx_match" class="sref">unx_match /a>,i 250 /a>p
      . a href="+code=crmarshal" class="sref">crmarshal /a>p
    =  a href="+code=unx_marshal" class="sref">unx_marshal /a>,i 251 /a>p
      . a href="+code=crrefresh" class="sref">crrefresh /a>p
    =  a href="+code=unx_refresh" class="sref">unx_refresh /a>,i 252 /a>p
      . a href="+code=crvalidate" class="sref">crvalidate /a>p
   =  a href="+code=unx_validate" class="sref">unx_validate /a>,i 253 /a>};< 254 /a>
lxr.linux.no kindly hosted by Redpill Linpro AS /a>, provider of Linux consulting and operations services since 1995.