Static Public Member Functions | List of all members
dbutils::Krb5 Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/DatabaseUtils/cxx/include/Krb5Utils.h"

Static Public Member Functions

static bool checkTicket (std::string krb5Id)
 
static bool getTicket (std::string keytab, std::string krb5Id, std::string krb5IdSfx)
 

Detailed Description

Utilities for accessing DB via kerberos

Author
Jonathan Paley
Version
Revision
1.2.28.1
Date
2019/09/27 00:07:03

Definition at line 16 of file Krb5Utils.h.

Member Function Documentation

bool dbutils::Krb5::checkTicket ( std::string  krb5Id)
static

Definition at line 6 of file Krb5Utils.cpp.

References run_hadd::cmd, string, and system().

6  {
7  std::string cmd = "klist -s";
8  int iresult = system(cmd.c_str());
9  return (iresult == 0);
10  }
system("rm -rf microbeam.root")
string cmd
Definition: run_hadd.py:52
enum BeamMode string
bool dbutils::Krb5::getTicket ( std::string  keytab,
std::string  krb5Id,
std::string  krb5IdSfx 
)
static

Definition at line 12 of file Krb5Utils.cpp.

References run_hadd::cmd, string, and system().

13  {
14 
15  // get kerberos ticket
16  if (keytab == "" && krb5Id != "" && krb5IdSfx != "") {
17  std::string cmd = "kinit -f " + krb5Id + "@" + krb5IdSfx;
18  int iresult = system(cmd.c_str());
19  return (iresult == 0);
20  }
21  else {
22  std::string cmd = "kinit -F -A -k -t " + keytab + " " + krb5Id + krb5IdSfx;
23  int iresult = system(cmd.c_str());
24  return (iresult == 0);
25  }
26  }
system("rm -rf microbeam.root")
string cmd
Definition: run_hadd.py:52
enum BeamMode string

The documentation for this class was generated from the following files: