Krb5Utils.cpp
Go to the documentation of this file.
1 #include <DatabaseUtils/Krb5Utils.h>
2 #include <cstdlib>
3 
4 namespace dbutils {
5 
7  std::string cmd = "klist -s";
8  int iresult = system(cmd.c_str());
9  return (iresult == 0);
10  }
11 
12  bool Krb5::getTicket(std::string keytab, std::string krb5Id,
13  std::string krb5IdSfx) {
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  }
27 
28 } // end of namespace dbutils
system("rm -rf microbeam.root")
static bool getTicket(std::string keytab, std::string krb5Id, std::string krb5IdSfx)
Definition: Krb5Utils.cpp:12
string cmd
Definition: run_hadd.py:52
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
static bool checkTicket(std::string krb5Id)
Definition: Krb5Utils.cpp:6