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)  

rsGetTempPasswordForOther.cpp
Go to the documentation of this file.
1 
4 /* See getTempPasswordForOther.h for a description of this API call.*/
5 
8 #include "miscServerFunct.hpp"
11 
12 int
14  getTempPasswordForOtherInp_t *getTempPasswordForOtherInp,
15  getTempPasswordForOtherOut_t **getTempPasswordForOtherOut ) {
17  int status;
18 
19  status = getAndConnRcatHost( rsComm, MASTER_RCAT, ( const char* )NULL, &rodsServerHost );
21  "rsGetTempPasswordForOther get stat=%d", status );
22  if ( status < 0 ) {
23  return status;
24  }
25 
27  std::string svc_role;
28  irods::error ret = get_catalog_service_role(svc_role);
29  if(!ret.ok()) {
30  irods::log(PASS(ret));
31  return ret.code();
32  }
33 
34  if( irods::CFG_SERVICE_ROLE_PROVIDER == svc_role ) {
36  rsComm,
37  getTempPasswordForOtherInp,
38  getTempPasswordForOtherOut );
39  } else if( irods::CFG_SERVICE_ROLE_CONSUMER == svc_role ) {
41  } else {
42  rodsLog(
43  LOG_ERROR,
44  "role not supported [%s]",
45  svc_role.c_str() );
47  }
48 
49  }
50  else {
52  getTempPasswordForOtherInp,
53  getTempPasswordForOtherOut );
54  }
55  if ( status < 0 ) {
57  "rsGetTempPasswordForOther: rcGetTempPasswordForOther failed, status = %d",
58  status );
59  }
60  return status;
61 }
62 
63 int
65  getTempPasswordForOtherInp_t *getTempPasswordForOtherInp,
66  getTempPasswordForOtherOut_t **getTempPasswordForOtherOut ) {
67  int status;
68  getTempPasswordForOtherOut_t *myGetTempPasswordForOtherOut;
69 
70  myGetTempPasswordForOtherOut = ( getTempPasswordForOtherOut_t* )malloc( sizeof( getTempPasswordForOtherOut_t ) );
71 
72  status = chlMakeTempPw( rsComm,
73  myGetTempPasswordForOtherOut->stringToHashWith,
74  getTempPasswordForOtherInp->otherUser );
75  if ( status < 0 ) {
77  "_rsGetTempPasswordForOther: getTempPasswordForOther, status = %d",
78  status );
79  }
80 
81  *getTempPasswordForOtherOut = myGetTempPasswordForOtherOut;
82 
83  return status;
84 }
_rsGetTempPasswordForOther
int _rsGetTempPasswordForOther(rsComm_t *rsComm, getTempPasswordForOtherInp_t *getTempPasswordForOtherInp, getTempPasswordForOtherOut_t **getTempPasswordForOtherOut)
Definition: rsGetTempPasswordForOther.cpp:64
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
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
getTempPasswordForOtherInp_t
Definition: getTempPasswordForOther.h:7
getTempPasswordForOther.h
rcGetTempPasswordForOther
int rcGetTempPasswordForOther(rcComm_t *conn, getTempPasswordForOtherInp_t *getTempPasswordForOtherInp, getTempPasswordForOtherOut_t **getTempPasswordForOtherOut)
Definition: rcGetTempPasswordForOther.cpp:9
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
rsGetTempPasswordForOther.hpp
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
irods::error::code
long long code() const
Definition: irods_error.cpp:194
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
getTempPasswordForOtherInp_t::otherUser
char * otherUser
Definition: getTempPasswordForOther.h:8
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
getTempPasswordForOtherOut_t
Definition: getTempPasswordForOther.h:13
irods::log
void log(const error &)
Definition: irods_log.cpp:13
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
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
rsGetTempPasswordForOther
int rsGetTempPasswordForOther(rsComm_t *rsComm, getTempPasswordForOtherInp_t *getTempPasswordForOtherInp, getTempPasswordForOtherOut_t **getTempPasswordForOtherOut)
Definition: rsGetTempPasswordForOther.cpp:13
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
getTempPasswordForOtherOut_t::stringToHashWith
char stringToHashWith[50]
Definition: getTempPasswordForOther.h:14