| 65 | string FormatPermissions(mode_t mode); |
| 66 | |
| 67 | TEST(Auth, PrincipalSubstitution) { |
| 68 | string hostname; |
| 69 | ASSERT_OK(GetHostname(&hostname)); |
| 70 | SecureAuthProvider sa(false); // false means it's external |
| 71 | |
| 72 | FLAGS_principal = "service_name/_HOST@some.realm"; |
| 73 | string principal; |
| 74 | ASSERT_OK(GetExternalKerberosPrincipal(&principal)); |
| 75 | |
| 76 | ASSERT_OK(sa.InitKerberos(principal)); |
| 77 | ASSERT_OK(sa.Start()); |
| 78 | ASSERT_EQ(string::npos, sa.principal().find("_HOST")); |
| 79 | ASSERT_NE(string::npos, sa.principal().find(hostname)); |
| 80 | ASSERT_EQ("service_name", sa.service_name()); |
| 81 | ASSERT_EQ(hostname, sa.hostname()); |
| 82 | ASSERT_EQ("some.realm", sa.realm()); |
| 83 | FLAGS_principal.clear(); |
| 84 | } |
| 85 | |
| 86 | void AuthOk(const string& name, SecureAuthProvider* sa) { |
| 87 | EXPECT_EQ(SASL_OK, |
nothing calls this directly
no test coverage detected