irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rsGetTempPassword.cpp
Go to the documentation of this file.
1 
4 /* See getTempPassword.h for a description of this API call.*/
5 
6 #include "getTempPassword.h"
8 #include "miscServerFunct.hpp"
10 #include "rsGetTempPassword.hpp"
11 
12 int
14  getTempPasswordOut_t **getTempPasswordOut ) {
16  int status;
17 
18  status = getAndConnRcatHost( rsComm, MASTER_RCAT, ( const char* )NULL, &rodsServerHost );
19 
20  if ( status < 0 ) {
21  return status;
22  }
23 
25  std::string svc_role;
26  irods::error ret = get_catalog_service_role(svc_role);
27  if(!ret.ok()) {
28  irods::log(PASS(ret));
29  return ret.code();
30  }
31 
32  if( irods::CFG_SERVICE_ROLE_PROVIDER == svc_role ) {
33  status = _rsGetTempPassword( rsComm, getTempPasswordOut );
34  } else if( irods::CFG_SERVICE_ROLE_CONSUMER == svc_role ) {
36  } else {
37  rodsLog(
38  LOG_ERROR,
39  "role not supported [%s]",
40  svc_role.c_str() );
42  }
43  }
44  else {
46  getTempPasswordOut );
47  }
48 
49  if ( status < 0 ) {
51  "rsGetTempPassword: rcGetTempPassword failed, status = %d",
52  status );
53  }
54  return status;
55 }
56 
57 int
59  getTempPasswordOut_t **getTempPasswordOut ) {
60  int status;
61  getTempPasswordOut_t *myGetTempPasswordOut;
62 
63  myGetTempPasswordOut = ( getTempPasswordOut_t* )malloc( sizeof( getTempPasswordOut_t ) );
64 
65  status = chlMakeTempPw( rsComm,
66  myGetTempPasswordOut->stringToHashWith, "" );
67  if ( status < 0 ) {
69  "_rsGetTempPassword: getTempPassword, status = %d",
70  status );
71  }
72 
73  *getTempPasswordOut = myGetTempPasswordOut;
74 
75  return status;
76 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
NULL
#define NULL
Definition: rodsDef.h:70
rsComm_t
Definition: rcConnect.h:145
irods::CFG_SERVICE_ROLE_CONSUMER
const std::string CFG_SERVICE_ROLE_CONSUMER("consumer")
irods_configuration_keywords.hpp
rodsServerHost::localFlag
int localFlag
Definition: rodsConnect.h:68
chlMakeTempPw
int chlMakeTempPw(rsComm_t *rsComm, char *pwValueToHash, const char *otherUser)
Definition: icatHighLevelRoutines.cpp:1935
SYS_SERVICE_ROLE_NOT_SUPPORTED
@ SYS_SERVICE_ROLE_NOT_SUPPORTED
Definition: rodsErrorTable.h:217
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
rsGetTempPassword.hpp
rcGetTempPassword
int rcGetTempPassword(rcComm_t *conn, getTempPasswordOut_t **getTempPasswordOut)
Definition: rcGetTempPassword.cpp:9
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
getTempPassword.h
irods::error::code
long long code() const
Definition: irods_error.cpp:194
getTempPasswordOut_t
Definition: getTempPassword.h:7
irods::CFG_SERVICE_ROLE_PROVIDER
const std::string CFG_SERVICE_ROLE_PROVIDER("provider")
SYS_NO_RCAT_SERVER_ERR
@ SYS_NO_RCAT_SERVER_ERR
Definition: rodsErrorTable.h:110
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
irods::log
void log(const error &)
Definition: irods_log.cpp:13
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
getTempPasswordOut_t::stringToHashWith
char stringToHashWith[50]
Definition: getTempPassword.h:8
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
getAndConnRcatHost
int getAndConnRcatHost(rsComm_t *rsComm, int rcatType, const char *rcatZoneHint, rodsServerHost_t **rodsServerHost)
Definition: rodsConnect.cpp:26
MASTER_RCAT
#define MASTER_RCAT
Definition: rodsDef.h:85
get_catalog_service_role
irods::error get_catalog_service_role(std::string &_role)
Definition: miscServerFunct.cpp:3153
rodsServerHost
Definition: rodsConnect.h:62
icatHighLevelRoutines.hpp
_rsGetTempPassword
int _rsGetTempPassword(rsComm_t *rsComm, getTempPasswordOut_t **getTempPasswordOut)
Definition: rsGetTempPassword.cpp:58
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
rsGetTempPassword
int rsGetTempPassword(rsComm_t *rsComm, getTempPasswordOut_t **getTempPasswordOut)
Definition: rsGetTempPassword.cpp:13