Exemple #1
0
 public static Org.Apache.Hadoop.Oncrpc.Security.Credentials ReadFlavorAndCredentials
     (XDR xdr)
 {
     RpcAuthInfo.AuthFlavor flavor = RpcAuthInfo.AuthFlavor.FromValue(xdr.ReadInt());
     Org.Apache.Hadoop.Oncrpc.Security.Credentials credentials;
     if (flavor == RpcAuthInfo.AuthFlavor.AuthNone)
     {
         credentials = new CredentialsNone();
     }
     else
     {
         if (flavor == RpcAuthInfo.AuthFlavor.AuthSys)
         {
             credentials = new CredentialsSys();
         }
         else
         {
             if (flavor == RpcAuthInfo.AuthFlavor.RpcsecGss)
             {
                 credentials = new CredentialsGSS();
             }
             else
             {
                 throw new NotSupportedException("Unsupported Credentials Flavor " + flavor);
             }
         }
     }
     credentials.Read(xdr);
     return(credentials);
 }
Exemple #2
0
        public virtual void TestReadWrite()
        {
            CredentialsSys credential = new CredentialsSys();

            credential.SetUID(0);
            credential.SetGID(1);
            XDR xdr = new XDR();

            credential.Write(xdr);
            CredentialsSys newCredential = new CredentialsSys();

            newCredential.Read(xdr.AsReadOnlyWrap());
            Assert.Equal(0, newCredential.GetUID());
            Assert.Equal(1, newCredential.GetGID());
        }
Exemple #3
0
 public SysSecurityHandler(CredentialsSys credentialsSys, IdMappingServiceProvider
                           iug)
 {
     this.mCredentialsSys = credentialsSys;
     this.iug             = iug;
 }