MCPcopy Create free account
hub / github.com/apache/impala / CheckReplayCacheDirPermissions

Function CheckReplayCacheDirPermissions

be/src/rpc/authentication.cc:1288–1308  ·  view source on GitHub ↗

Ensure that /var/tmp (the location of the Kerberos replay cache) has drwxrwxrwt permissions. If it doesn't, Kerberos will be unhappy in a way that's very difficult to debug. We do this using direct stat() calls because boost doesn't support the detail we need.

Source from the content-addressed store, hash-verified

1286// to debug. We do this using direct stat() calls because boost doesn't support the
1287// detail we need.
1288Status CheckReplayCacheDirPermissions() {
1289 DCHECK(IsKerberosEnabled());
1290 struct stat st;
1291
1292 if (stat("/var/tmp", &st) < 0) {
1293 return Status(Substitute("Problem accessing /var/tmp: $0", GetStrErrMsg()));
1294 }
1295
1296 if (!(st.st_mode & S_IFDIR)) {
1297 return Status("Error: /var/tmp is not a directory");
1298 }
1299
1300 if ((st.st_mode & 01777) != 01777) {
1301 return Status(Substitute("Error: The permissions on /var/tmp must precisely match "
1302 "\"drwxrwxrwt\". This directory is used by the Kerberos replay cache. "
1303 "Current permissions: \"$0\". To rectify this issue, run "
1304 "\"chmod 01777 /var/tmp\" as root.", FormatPermissions(st.st_mode)));
1305 }
1306
1307 return Status::OK();
1308}
1309
1310Status SecureAuthProvider::InitKerberos(const string& principal) {
1311 principal_ = principal;

Callers 1

InitKerberosEnvMethod · 0.85

Calls 7

IsKerberosEnabledFunction · 0.85
SubstituteFunction · 0.85
GetStrErrMsgFunction · 0.85
FormatPermissionsFunction · 0.85
OKFunction · 0.85
statClass · 0.70
StatusClass · 0.50

Tested by

no test coverage detected