static bool CreateGoogleUserFile()

in src/oslogin_utils.cc [1324:1340]


static bool CreateGoogleUserFile(string users_filename) {
  std::ofstream users_file;

  users_file.open(users_filename.c_str());

  if (!users_file.is_open()) {
    // If we can't open the file (meaning we can't create it) we should report failure.
    return false;
  }

  // We are only creating the file so we could just close it here.
  users_file.close();

  chown(users_filename.c_str(), 0, 0);
  chmod(users_filename.c_str(), S_IRUSR | S_IWUSR | S_IRGRP);
  return true;
}