|
|
b3fe293 |
diff --git a/src/condor_c-gahp/schedd_client.cpp b/src/condor_c-gahp/schedd_client.cpp
|
|
|
b3fe293 |
index 32f0059..b8fda84 100644
|
|
|
b3fe293 |
--- a/src/condor_c-gahp/schedd_client.cpp
|
|
|
b3fe293 |
+++ b/src/condor_c-gahp/schedd_client.cpp
|
|
|
b3fe293 |
@@ -562,7 +562,7 @@ doContactSchedd()
|
|
|
b3fe293 |
// Try connecting to the queue
|
|
|
b3fe293 |
Qmgr_connection * qmgr_connection;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- if ((qmgr_connection = ConnectQ(dc_schedd.addr(), QMGMT_TIMEOUT, false, NULL, NULL, dc_schedd.version() )) == NULL) {
|
|
|
b3fe293 |
+ if ((qmgr_connection = ConnectQ(dc_schedd, QMGMT_TIMEOUT, false, NULL, NULL, dc_schedd.version() )) == NULL) {
|
|
|
b3fe293 |
error = TRUE;
|
|
|
b3fe293 |
sprintf( error_msg, "Error connecting to schedd %s", ScheddAddr );
|
|
|
b3fe293 |
dprintf( D_ALWAYS, "%s\n", error_msg.c_str() );
|
|
|
b3fe293 |
diff --git a/src/condor_contrib/triggerd/src/Triggerd.cpp b/src/condor_contrib/triggerd/src/Triggerd.cpp
|
|
|
b3fe293 |
index 40e1197..59f2e55 100644
|
|
|
b3fe293 |
--- a/src/condor_contrib/triggerd/src/Triggerd.cpp
|
|
|
b3fe293 |
+++ b/src/condor_contrib/triggerd/src/Triggerd.cpp
|
|
|
b3fe293 |
@@ -819,7 +819,7 @@ Triggerd::PerformQueries()
|
|
|
b3fe293 |
// Perform the query and check the result
|
|
|
b3fe293 |
if (NULL != query_collector)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
- status = query->fetchAds(result, query_collector->addr(), &errstack);
|
|
|
b3fe293 |
+ status = query->fetchAds(result, *query_collector, &errstack);
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
else
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
diff --git a/src/condor_credd/credd.cpp b/src/condor_credd/credd.cpp
|
|
|
b3fe293 |
index 7f0973f..c3b7b1f 100644
|
|
|
b3fe293 |
--- a/src/condor_credd/credd.cpp
|
|
|
b3fe293 |
+++ b/src/condor_credd/credd.cpp
|
|
|
b3fe293 |
@@ -80,7 +80,7 @@ store_cred_handler(Service * /*service*/, int /*i*/, Stream *stream) {
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if (!socket->triedAuthentication()) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(socket, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(socket, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
dprintf (D_ALWAYS, "Unable to authenticate, qutting\n");
|
|
|
b3fe293 |
goto EXIT;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
@@ -236,7 +236,7 @@ get_cred_handler(Service * /*service*/, int /*i*/, Stream *stream) {
|
|
|
b3fe293 |
// Authenticate
|
|
|
b3fe293 |
if (!socket->triedAuthentication()) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(socket, READ, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(socket, READ, &errstack, NULL) ) {
|
|
|
b3fe293 |
dprintf (D_ALWAYS, "Unable to authenticate, qutting\n");
|
|
|
b3fe293 |
goto EXIT;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
@@ -351,7 +351,7 @@ query_cred_handler(Service * /*service*/, int /*i*/, Stream *stream) {
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if (!socket->triedAuthentication()) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(socket, READ, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(socket, READ, &errstack, NULL) ) {
|
|
|
b3fe293 |
dprintf (D_ALWAYS, "Unable to authenticate, qutting\n");
|
|
|
b3fe293 |
goto EXIT;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
@@ -426,7 +426,7 @@ rm_cred_handler(Service * /*service*/, int /*i*/, Stream *stream) {
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if (!socket->triedAuthentication()) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(socket, READ, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(socket, READ, &errstack, NULL) ) {
|
|
|
b3fe293 |
dprintf (D_ALWAYS, "Unable to authenticate, qutting\n");
|
|
|
b3fe293 |
goto EXIT;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
diff --git a/src/condor_daemon_client/daemon.cpp b/src/condor_daemon_client/daemon.cpp
|
|
|
b3fe293 |
index e2afded..5ccb2aa 100644
|
|
|
b3fe293 |
--- a/src/condor_daemon_client/daemon.cpp
|
|
|
b3fe293 |
+++ b/src/condor_daemon_client/daemon.cpp
|
|
|
b3fe293 |
@@ -162,7 +162,7 @@ Daemon::Daemon( const ClassAd* tAd, daemon_t tType, const char* tPool )
|
|
|
b3fe293 |
|
|
|
b3fe293 |
getInfoFromAd( tAd );
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- dprintf( D_HOSTNAME, "New Daemon obj (%s) name: \"%s\", pool: "
|
|
|
b3fe293 |
+ dprintf( D_HOSTNAME, "From ClassAd, new Daemon obj (%s) name: \"%s\", pool: "
|
|
|
b3fe293 |
"\"%s\", addr: \"%s\"\n", daemonString(_type),
|
|
|
b3fe293 |
_name ? _name : "NULL", _pool ? _pool : "NULL",
|
|
|
b3fe293 |
_addr ? _addr : "NULL" );
|
|
|
b3fe293 |
@@ -533,7 +533,7 @@ Daemon::connectSock(Sock *sock, int sec, CondorError* errstack, bool non_blockin
|
|
|
b3fe293 |
|
|
|
b3fe293 |
|
|
|
b3fe293 |
StartCommandResult
|
|
|
b3fe293 |
-Daemon::startCommand( int cmd, Sock* sock, int timeout, CondorError *errstack, StartCommandCallbackType *callback_fn, void *misc_data, bool nonblocking, char const *cmd_description, char *, SecMan *sec_man, bool raw_protocol, char const *sec_session_id )
|
|
|
b3fe293 |
+Daemon::startCommand( int cmd, Sock* sock, int timeout, CondorError *errstack, StartCommandCallbackType *callback_fn, void *misc_data, bool nonblocking, char const *cmd_description, char *, SecMan *sec_man, bool raw_protocol, char const *sec_session_id, const char * hostname )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
// This function may be either blocking or non-blocking, depending
|
|
|
b3fe293 |
// on the flag that is passed in. All versions of Daemon::startCommand()
|
|
|
b3fe293 |
@@ -555,7 +555,7 @@ Daemon::startCommand( int cmd, Sock* sock, int timeout, CondorError *errstack, S
|
|
|
b3fe293 |
sock->timeout( timeout );
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- start_command_result = sec_man->startCommand(cmd, sock, raw_protocol, errstack, 0, callback_fn, misc_data, nonblocking, cmd_description, sec_session_id);
|
|
|
b3fe293 |
+ start_command_result = sec_man->startCommand(cmd, sock, raw_protocol, errstack, 0, callback_fn, misc_data, nonblocking, cmd_description, sec_session_id, hostname);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if(callback_fn) {
|
|
|
b3fe293 |
// SecMan::startCommand() called the callback function, so we just return here
|
|
|
b3fe293 |
@@ -619,7 +619,8 @@ Daemon::startCommand( int cmd, Stream::stream_type st,Sock **sock,int timeout, C
|
|
|
b3fe293 |
_version,
|
|
|
b3fe293 |
&_sec_man,
|
|
|
b3fe293 |
raw_protocol,
|
|
|
b3fe293 |
- sec_session_id);
|
|
|
b3fe293 |
+ sec_session_id,
|
|
|
b3fe293 |
+ _full_hostname);
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
Sock*
|
|
|
b3fe293 |
@@ -662,7 +663,7 @@ Daemon::startCommand_nonblocking( int cmd, Sock* sock, int timeout, CondorError
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
// This is the nonblocking version of startCommand().
|
|
|
b3fe293 |
const bool nonblocking = true;
|
|
|
b3fe293 |
- return startCommand(cmd,sock,timeout,errstack,callback_fn,misc_data,nonblocking,cmd_description,_version,&_sec_man,raw_protocol,sec_session_id);
|
|
|
b3fe293 |
+ return startCommand(cmd,sock,timeout,errstack,callback_fn,misc_data,nonblocking,cmd_description,_version,&_sec_man,raw_protocol,sec_session_id, _full_hostname);
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
bool
|
|
|
b3fe293 |
@@ -670,7 +671,7 @@ Daemon::startCommand( int cmd, Sock* sock, int timeout, CondorError *errstack, c
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
// This is a blocking version of startCommand().
|
|
|
b3fe293 |
const bool nonblocking = false;
|
|
|
b3fe293 |
- StartCommandResult rc = startCommand(cmd,sock,timeout,errstack,NULL,NULL,nonblocking,cmd_description,_version,&_sec_man,raw_protocol,sec_session_id);
|
|
|
b3fe293 |
+ StartCommandResult rc = startCommand(cmd,sock,timeout,errstack,NULL,NULL,nonblocking,cmd_description,_version,&_sec_man,raw_protocol,sec_session_id, _full_hostname);
|
|
|
b3fe293 |
switch(rc) {
|
|
|
b3fe293 |
case StartCommandSucceeded:
|
|
|
b3fe293 |
return true;
|
|
|
b3fe293 |
@@ -2097,7 +2098,7 @@ Daemon::forceAuthentication( ReliSock* rsock, CondorError* errstack )
|
|
|
b3fe293 |
return true;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- return SecMan::authenticate_sock(rsock, CLIENT_PERM, errstack );
|
|
|
b3fe293 |
+ return SecMan::authenticate_sock(rsock, CLIENT_PERM, errstack, _full_hostname);
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
|
|
|
b3fe293 |
diff --git a/src/condor_daemon_client/daemon.h b/src/condor_daemon_client/daemon.h
|
|
|
b3fe293 |
index 57fcd8a..9aa3b9f 100644
|
|
|
b3fe293 |
--- a/src/condor_daemon_client/daemon.h
|
|
|
b3fe293 |
+++ b/src/condor_daemon_client/daemon.h
|
|
|
b3fe293 |
@@ -761,7 +761,7 @@ protected:
|
|
|
b3fe293 |
It may be either blocking or nonblocking, depending on the
|
|
|
b3fe293 |
nonblocking flag. This version uses an existing socket.
|
|
|
b3fe293 |
*/
|
|
|
b3fe293 |
- static StartCommandResult startCommand( int cmd, Sock* sock, int timeout, CondorError *errstack, StartCommandCallbackType *callback_fn, void *misc_data, bool nonblocking, char const *cmd_description, char *version, SecMan *sec_man, bool raw_protocol, char const *sec_session_id );
|
|
|
b3fe293 |
+ static StartCommandResult startCommand( int cmd, Sock* sock, int timeout, CondorError *errstack, StartCommandCallbackType *callback_fn, void *misc_data, bool nonblocking, char const *cmd_description, char *version, SecMan *sec_man, bool raw_protocol, char const *sec_session_id, char const *hostname );
|
|
|
b3fe293 |
|
|
|
b3fe293 |
/**
|
|
|
b3fe293 |
Internal function used by public versions of startCommand().
|
|
|
b3fe293 |
@@ -769,7 +769,7 @@ protected:
|
|
|
b3fe293 |
nonblocking flag. This version creates a socket of the
|
|
|
b3fe293 |
specified type and connects it.
|
|
|
b3fe293 |
*/
|
|
|
b3fe293 |
- StartCommandResult startCommand( int cmd, Stream::stream_type st,Sock **sock,int timeout, CondorError *errstack, StartCommandCallbackType *callback_fn, void *misc_data, bool nonblocking, char const *cmd_description=NULL, bool raw_protocol=false, char const *sec_session_id=NULL );
|
|
|
b3fe293 |
+ StartCommandResult startCommand( int cmd, Stream::stream_type st,Sock **sock,int timeout, CondorError *errstack, StartCommandCallbackType *callback_fn, void *misc_data, bool nonblocking, char const *cmd_description, bool raw_protocol, char const *sec_session_id );
|
|
|
b3fe293 |
|
|
|
b3fe293 |
/**
|
|
|
b3fe293 |
Class used internally to handle non-blocking connects for
|
|
|
b3fe293 |
diff --git a/src/condor_daemon_client/daemon_list.cpp b/src/condor_daemon_client/daemon_list.cpp
|
|
|
b3fe293 |
index 244d58a..597d981 100644
|
|
|
b3fe293 |
--- a/src/condor_daemon_client/daemon_list.cpp
|
|
|
b3fe293 |
+++ b/src/condor_daemon_client/daemon_list.cpp
|
|
|
b3fe293 |
@@ -330,7 +330,7 @@ CollectorList::query(CondorQuery & cQuery, ClassAdList & adList, CondorError *er
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
result =
|
|
|
b3fe293 |
- cQuery.fetchAds (adList, daemon->addr(), errstack);
|
|
|
b3fe293 |
+ cQuery.fetchAds (adList, *daemon, errstack);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if( num_collectors > 1 ) {
|
|
|
b3fe293 |
daemon->blacklistMonitorQueryFinished( result == Q_OK );
|
|
|
b3fe293 |
diff --git a/src/condor_daemon_client/dc_schedd.cpp b/src/condor_daemon_client/dc_schedd.cpp
|
|
|
b3fe293 |
index af1049e..769e12c 100644
|
|
|
b3fe293 |
--- a/src/condor_daemon_client/dc_schedd.cpp
|
|
|
b3fe293 |
+++ b/src/condor_daemon_client/dc_schedd.cpp
|
|
|
b3fe293 |
@@ -41,6 +41,9 @@ DCSchedd::DCSchedd( const char* the_name, const char* the_pool )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
+DCSchedd::DCSchedd( const ClassAd* ad, const char* pool )
|
|
|
b3fe293 |
+ : Daemon( ad, DT_SCHEDD ,pool ) // Surprise! DT_SCHEDD is the second argument.
|
|
|
b3fe293 |
+{}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
DCSchedd::~DCSchedd( void )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
diff --git a/src/condor_daemon_client/dc_schedd.h b/src/condor_daemon_client/dc_schedd.h
|
|
|
b3fe293 |
index 201c9b4..6389e09 100644
|
|
|
b3fe293 |
--- a/src/condor_daemon_client/dc_schedd.h
|
|
|
b3fe293 |
+++ b/src/condor_daemon_client/dc_schedd.h
|
|
|
b3fe293 |
@@ -62,6 +62,13 @@ public:
|
|
|
b3fe293 |
*/
|
|
|
b3fe293 |
DCSchedd( const char* const name = NULL, const char* pool = NULL );
|
|
|
b3fe293 |
|
|
|
b3fe293 |
+ /** Constructor. Same as a Daemon object.
|
|
|
b3fe293 |
+ @param ad The classad of the schedd object; saves a query
|
|
|
b3fe293 |
+ to the collector.
|
|
|
b3fe293 |
+ @param pool The name of the pool, NULL if you want local
|
|
|
b3fe293 |
+ */
|
|
|
b3fe293 |
+ DCSchedd( const ClassAd* ad, const char* pool = NULL );
|
|
|
b3fe293 |
+
|
|
|
b3fe293 |
/// Destructor
|
|
|
b3fe293 |
~DCSchedd();
|
|
|
b3fe293 |
|
|
|
b3fe293 |
diff --git a/src/condor_daemon_client/dc_startd.cpp b/src/condor_daemon_client/dc_startd.cpp
|
|
|
b3fe293 |
index ec3ab14..9a4b44c 100644
|
|
|
b3fe293 |
--- a/src/condor_daemon_client/dc_startd.cpp
|
|
|
b3fe293 |
+++ b/src/condor_daemon_client/dc_startd.cpp
|
|
|
b3fe293 |
@@ -914,7 +914,6 @@ DCStartd::getAds( ClassAdList &adsList )
|
|
|
b3fe293 |
// fetch the query
|
|
|
b3fe293 |
QueryResult q;
|
|
|
b3fe293 |
CondorQuery* query;
|
|
|
b3fe293 |
- char* ad_addr;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// instantiate query object
|
|
|
b3fe293 |
if (!(query = new CondorQuery (STARTD_AD))) {
|
|
|
b3fe293 |
@@ -923,8 +922,7 @@ DCStartd::getAds( ClassAdList &adsList )
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if( this->locate() ){
|
|
|
b3fe293 |
- ad_addr = this->addr();
|
|
|
b3fe293 |
- q = query->fetchAds(adsList, ad_addr, &errstack);
|
|
|
b3fe293 |
+ q = query->fetchAds(adsList, *this, &errstack);
|
|
|
b3fe293 |
if (q != Q_OK) {
|
|
|
b3fe293 |
if (q == Q_COMMUNICATION_ERROR) {
|
|
|
b3fe293 |
dprintf( D_ALWAYS, "%s\n", errstack.getFullText(true) );
|
|
|
b3fe293 |
diff --git a/src/condor_daemon_core.V6/daemon_command.cpp b/src/condor_daemon_core.V6/daemon_command.cpp
|
|
|
b3fe293 |
index e6da114..3a96315 100644
|
|
|
b3fe293 |
--- a/src/condor_daemon_core.V6/daemon_command.cpp
|
|
|
b3fe293 |
+++ b/src/condor_daemon_core.V6/daemon_command.cpp
|
|
|
b3fe293 |
@@ -991,7 +991,7 @@ DaemonCommandProtocol::CommandProtocolResult DaemonCommandProtocol::Authenticate
|
|
|
b3fe293 |
int auth_timeout = daemonCore->getSecMan()->getSecTimeout( m_comTable[cmd_index].perm );
|
|
|
b3fe293 |
|
|
|
b3fe293 |
char *method_used = NULL;
|
|
|
b3fe293 |
- bool auth_success = m_sock->authenticate(m_key, auth_methods, &errstack, auth_timeout, &method_used);
|
|
|
b3fe293 |
+ bool auth_success = m_sock->authenticate(m_key, auth_methods, &errstack, auth_timeout, &method_used, NULL);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if ( method_used ) {
|
|
|
b3fe293 |
m_policy->Assign(ATTR_SEC_AUTHENTICATION_METHODS, method_used);
|
|
|
b3fe293 |
@@ -1279,7 +1279,7 @@ DaemonCommandProtocol::CommandProtocolResult DaemonCommandProtocol::ExecCommand(
|
|
|
b3fe293 |
m_comTable[cmd_index].force_authentication &&
|
|
|
b3fe293 |
!m_sock->triedAuthentication() )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
- SecMan::authenticate_sock(m_sock, WRITE, &errstack);
|
|
|
b3fe293 |
+ SecMan::authenticate_sock(m_sock, WRITE, &errstack, NULL);
|
|
|
b3fe293 |
// we don't check the return value, because the code below
|
|
|
b3fe293 |
// handles what to do with unauthenticated connections
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
diff --git a/src/condor_eventd.V2/admin_event.cpp b/src/condor_eventd.V2/admin_event.cpp
|
|
|
b3fe293 |
index 3fa1c46..83abc49 100644
|
|
|
b3fe293 |
--- a/src/condor_eventd.V2/admin_event.cpp
|
|
|
b3fe293 |
+++ b/src/condor_eventd.V2/admin_event.cpp
|
|
|
b3fe293 |
@@ -1089,7 +1089,7 @@ AdminEvent::FetchAds_ByConstraint( const char *constraint )
|
|
|
b3fe293 |
|
|
|
b3fe293 |
query->addORConstraint( constraint );
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- q = query->fetchAds( m_collector_query_ads, pool->addr(), &errstack);
|
|
|
b3fe293 |
+ q = query->fetchAds( m_collector_query_ads, pool, &errstack);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if( q != Q_OK ){
|
|
|
b3fe293 |
dprintf(D_ALWAYS, "Trouble fetching Ads with<<%s>><<%d>>\n",
|
|
|
b3fe293 |
diff --git a/src/condor_gridmanager/gridmanager.cpp b/src/condor_gridmanager/gridmanager.cpp
|
|
|
b3fe293 |
index 1f97ef7..03db810 100644
|
|
|
b3fe293 |
--- a/src/condor_gridmanager/gridmanager.cpp
|
|
|
b3fe293 |
+++ b/src/condor_gridmanager/gridmanager.cpp
|
|
|
b3fe293 |
@@ -644,7 +644,7 @@ doContactSchedd()
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- schedd = ConnectQ( ScheddAddr, QMGMT_TIMEOUT, false, NULL, myUserName, CondorVersion() );
|
|
|
b3fe293 |
+ schedd = ConnectQ( *ScheddObj, QMGMT_TIMEOUT, false, NULL, myUserName, CondorVersion() );
|
|
|
b3fe293 |
if ( !schedd ) {
|
|
|
b3fe293 |
error_str = "Failed to connect to schedd!";
|
|
|
b3fe293 |
goto contact_schedd_failure;
|
|
|
b3fe293 |
diff --git a/src/condor_includes/authentication.h b/src/condor_includes/authentication.h
|
|
|
b3fe293 |
index d2b976a..6167e84 100644
|
|
|
b3fe293 |
--- a/src/condor_includes/authentication.h
|
|
|
b3fe293 |
+++ b/src/condor_includes/authentication.h
|
|
|
b3fe293 |
@@ -40,7 +40,7 @@ class Authentication {
|
|
|
b3fe293 |
|
|
|
b3fe293 |
~Authentication();
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- int authenticate( char *hostAddr, const char* auth_methods, CondorError* errstack, int timeout);
|
|
|
b3fe293 |
+ int authenticate( const char *hostAddr, const char* auth_methods, CondorError* errstack, int timeout);
|
|
|
b3fe293 |
//------------------------------------------
|
|
|
b3fe293 |
// PURPOSE: authenticate with the other side
|
|
|
b3fe293 |
// REQUIRE: hostAddr -- host to authenticate
|
|
|
b3fe293 |
@@ -50,7 +50,7 @@ class Authentication {
|
|
|
b3fe293 |
// RETURNS: -1 -- failure
|
|
|
b3fe293 |
//------------------------------------------
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- int authenticate( char *hostAddr, KeyInfo *& key, const char* auth_methods, CondorError* errstack, int timeout);
|
|
|
b3fe293 |
+ int authenticate( const char *hostAddr, KeyInfo *& key, const char* auth_methods, CondorError* errstack, int timeout);
|
|
|
b3fe293 |
//------------------------------------------
|
|
|
b3fe293 |
// PURPOSE: To send the secret key over. this method
|
|
|
b3fe293 |
// is written to keep compatibility issues
|
|
|
b3fe293 |
@@ -161,7 +161,7 @@ class Authentication {
|
|
|
b3fe293 |
|
|
|
b3fe293 |
#endif /* !SKIP_AUTHENTICATION */
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- int authenticate_inner( char *hostAddr, const char* auth_methods, CondorError* errstack, int timeout);
|
|
|
b3fe293 |
+ int authenticate_inner( const char *hostAddr, const char* auth_methods, CondorError* errstack, int timeout);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
//------------------------------------------
|
|
|
b3fe293 |
// Data (private)
|
|
|
b3fe293 |
diff --git a/src/condor_includes/condor_auth_x509.h b/src/condor_includes/condor_auth_x509.h
|
|
|
b3fe293 |
index bdbc545..dac8aa5 100644
|
|
|
b3fe293 |
--- a/src/condor_includes/condor_auth_x509.h
|
|
|
b3fe293 |
+++ b/src/condor_includes/condor_auth_x509.h
|
|
|
b3fe293 |
@@ -103,7 +103,7 @@ class Condor_Auth_X509 : public Condor_Auth_Base {
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int authenticate_self_gss(CondorError* errstack);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- int authenticate_client_gss(CondorError* errstack);
|
|
|
b3fe293 |
+ int authenticate_client_gss(const char *remoteHost, CondorError* errstack);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int authenticate_server_gss(CondorError* errstack);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
diff --git a/src/condor_includes/condor_qmgr.h b/src/condor_includes/condor_qmgr.h
|
|
|
b3fe293 |
index 5e5012e..642b602 100644
|
|
|
b3fe293 |
--- a/src/condor_includes/condor_qmgr.h
|
|
|
b3fe293 |
+++ b/src/condor_includes/condor_qmgr.h
|
|
|
b3fe293 |
@@ -25,7 +25,7 @@
|
|
|
b3fe293 |
#include "proc.h"
|
|
|
b3fe293 |
#include "../condor_utils/CondorError.h"
|
|
|
b3fe293 |
#include "condor_classad.h"
|
|
|
b3fe293 |
-
|
|
|
b3fe293 |
+#include "daemon.h"
|
|
|
b3fe293 |
|
|
|
b3fe293 |
typedef struct {
|
|
|
b3fe293 |
bool dummy;
|
|
|
b3fe293 |
@@ -54,8 +54,7 @@ int InitializeConnection(const char *, const char *);
|
|
|
b3fe293 |
int InitializeReadOnlyConnection(const char * );
|
|
|
b3fe293 |
|
|
|
b3fe293 |
/** Initiate connection to schedd job queue and begin transaction.
|
|
|
b3fe293 |
- @param qmgr_location can be the name or sinful string of a schedd or
|
|
|
b3fe293 |
- NULL to connect to the local schedd
|
|
|
b3fe293 |
+ @param daemon a daemon object of type DT_SCHEDD
|
|
|
b3fe293 |
@param timeout specifies the maximum time (in seconds) to wait for TCP
|
|
|
b3fe293 |
connection establishment
|
|
|
b3fe293 |
@param read_only can be set to true to skip the potentially slow
|
|
|
b3fe293 |
@@ -64,7 +63,7 @@ int InitializeReadOnlyConnection(const char * );
|
|
|
b3fe293 |
@param schedd_version_str Version of schedd if known (o.w. NULL).
|
|
|
b3fe293 |
@return opaque Qmgr_connection structure
|
|
|
b3fe293 |
*/
|
|
|
b3fe293 |
-Qmgr_connection *ConnectQ(const char *qmgr_location, int timeout=0,
|
|
|
b3fe293 |
+Qmgr_connection *ConnectQ(Daemon &daemon, int timeout=0,
|
|
|
b3fe293 |
bool read_only=false, CondorError* errstack=NULL,
|
|
|
b3fe293 |
const char *effective_owner=NULL,
|
|
|
b3fe293 |
char const *schedd_version_str=NULL);
|
|
|
b3fe293 |
diff --git a/src/condor_includes/condor_secman.h b/src/condor_includes/condor_secman.h
|
|
|
b3fe293 |
index b59519e..9891497 100644
|
|
|
b3fe293 |
--- a/src/condor_includes/condor_secman.h
|
|
|
b3fe293 |
+++ b/src/condor_includes/condor_secman.h
|
|
|
b3fe293 |
@@ -106,12 +106,12 @@ public:
|
|
|
b3fe293 |
// spawn off a non-blocking attempt to create a security
|
|
|
b3fe293 |
// session so that in the future, a UDP command could succeed
|
|
|
b3fe293 |
// without StartCommandWouldBlock.
|
|
|
b3fe293 |
- StartCommandResult startCommand( int cmd, Sock* sock, bool raw_protocol, CondorError* errstack, int subcmd, StartCommandCallbackType *callback_fn, void *misc_data, bool nonblocking,char const *cmd_description,char const *sec_session_id);
|
|
|
b3fe293 |
+ StartCommandResult startCommand( int cmd, Sock* sock, bool raw_protocol, CondorError* errstack, int subcmd, StartCommandCallbackType *callback_fn, void *misc_data, bool nonblocking,char const *cmd_description,char const *sec_session_id, const char *hostname);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// Authenticate a socket using whatever authentication methods
|
|
|
b3fe293 |
// have been configured for the specified perm level.
|
|
|
b3fe293 |
- static int authenticate_sock(Sock *s,DCpermission perm, CondorError* errstack);
|
|
|
b3fe293 |
- static int authenticate_sock(Sock *s,KeyInfo *&ki, DCpermission perm, CondorError* errstack);
|
|
|
b3fe293 |
+ static int authenticate_sock(Sock *s,DCpermission perm, CondorError* errstack, const char * hostname);
|
|
|
b3fe293 |
+ static int authenticate_sock(Sock *s,KeyInfo *&ki, DCpermission perm, CondorError* errstack, const char * hostname);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
|
|
|
b3fe293 |
//------------------------------------------
|
|
|
b3fe293 |
diff --git a/src/condor_includes/reli_sock.h b/src/condor_includes/reli_sock.h
|
|
|
b3fe293 |
index b48ce8d..f5cdca8 100644
|
|
|
b3fe293 |
--- a/src/condor_includes/reli_sock.h
|
|
|
b3fe293 |
+++ b/src/condor_includes/reli_sock.h
|
|
|
b3fe293 |
@@ -218,9 +218,9 @@ public:
|
|
|
b3fe293 |
virtual int peek(char &);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
///
|
|
|
b3fe293 |
- int authenticate( const char* methods, CondorError* errstack, int auth_timeout );
|
|
|
b3fe293 |
+ int authenticate( const char* methods, CondorError* errstack, int auth_timeout, const char * hostname );
|
|
|
b3fe293 |
///
|
|
|
b3fe293 |
- int authenticate( KeyInfo *& key, const char* methods, CondorError* errstack, int auth_timeout, char **method_used=NULL );
|
|
|
b3fe293 |
+ int authenticate( KeyInfo *& key, const char* methods, CondorError* errstack, int auth_timeout, char **method_used, const char * hostname );
|
|
|
b3fe293 |
///
|
|
|
b3fe293 |
int isClient() { return is_client; };
|
|
|
b3fe293 |
|
|
|
b3fe293 |
@@ -254,7 +254,8 @@ protected:
|
|
|
b3fe293 |
int prepare_for_nobuffering( stream_coding = stream_unknown);
|
|
|
b3fe293 |
int perform_authenticate( bool with_key, KeyInfo *& key,
|
|
|
b3fe293 |
const char* methods, CondorError* errstack,
|
|
|
b3fe293 |
- int auth_timeout, char **method_used );
|
|
|
b3fe293 |
+ int auth_timeout, char **method_used,
|
|
|
b3fe293 |
+ const char* hostname );
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// This is used internally to recover sanity on the stream after
|
|
|
b3fe293 |
// failing to open a file in put_file().
|
|
|
b3fe293 |
diff --git a/src/condor_includes/sock.h b/src/condor_includes/sock.h
|
|
|
b3fe293 |
index ca1b1c8..53f8b23 100644
|
|
|
b3fe293 |
--- a/src/condor_includes/sock.h
|
|
|
b3fe293 |
+++ b/src/condor_includes/sock.h
|
|
|
b3fe293 |
@@ -347,10 +347,10 @@ public:
|
|
|
b3fe293 |
bool isAuthenticated() const;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
///
|
|
|
b3fe293 |
- virtual int authenticate(const char * auth_methods, CondorError* errstack, int timeout);
|
|
|
b3fe293 |
+ virtual int authenticate(const char * auth_methods, CondorError* errstack, int timeout, const char *hostname);
|
|
|
b3fe293 |
///
|
|
|
b3fe293 |
// method_used should be freed by the caller when finished with it
|
|
|
b3fe293 |
- virtual int authenticate(KeyInfo *&ki, const char * auth_methods, CondorError* errstack, int timeout, char **method_used=NULL);
|
|
|
b3fe293 |
+ virtual int authenticate(KeyInfo *&ki, const char * auth_methods, CondorError* errstack, int timeout, char **method_used, const char *hostname);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
/// if we are connecting, merges together Stream::get_deadline
|
|
|
b3fe293 |
/// and connect_timeout_time()
|
|
|
b3fe293 |
diff --git a/src/condor_io/authentication.cpp b/src/condor_io/authentication.cpp
|
|
|
b3fe293 |
index 4a11db0..0374857 100644
|
|
|
b3fe293 |
--- a/src/condor_io/authentication.cpp
|
|
|
b3fe293 |
+++ b/src/condor_io/authentication.cpp
|
|
|
b3fe293 |
@@ -85,7 +85,7 @@ Authentication::~Authentication()
|
|
|
b3fe293 |
#endif
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
-int Authentication::authenticate( char *hostAddr, KeyInfo *& key,
|
|
|
b3fe293 |
+int Authentication::authenticate( const char *hostAddr, KeyInfo *& key,
|
|
|
b3fe293 |
const char* auth_methods, CondorError* errstack, int timeout)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
int retval = authenticate(hostAddr, auth_methods, errstack, timeout);
|
|
|
b3fe293 |
@@ -106,7 +106,7 @@ int Authentication::authenticate( char *hostAddr, KeyInfo *& key,
|
|
|
b3fe293 |
return retval;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
-int Authentication::authenticate( char *hostAddr, const char* auth_methods,
|
|
|
b3fe293 |
+int Authentication::authenticate( const char *hostAddr, const char* auth_methods,
|
|
|
b3fe293 |
CondorError* errstack, int timeout)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
int retval;
|
|
|
b3fe293 |
@@ -124,7 +124,7 @@ int Authentication::authenticate( char *hostAddr, const char* auth_methods,
|
|
|
b3fe293 |
return retval;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
-int Authentication::authenticate_inner( char *hostAddr, const char* auth_methods,
|
|
|
b3fe293 |
+int Authentication::authenticate_inner( const char *hostAddr, const char* auth_methods,
|
|
|
b3fe293 |
CondorError* errstack, int timeout)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
#if defined(SKIP_AUTHENTICATION)
|
|
|
b3fe293 |
diff --git a/src/condor_io/condor_auth_x509.cpp b/src/condor_io/condor_auth_x509.cpp
|
|
|
b3fe293 |
index ee80b9d..7c81cea 100644
|
|
|
b3fe293 |
--- a/src/condor_io/condor_auth_x509.cpp
|
|
|
b3fe293 |
+++ b/src/condor_io/condor_auth_x509.cpp
|
|
|
b3fe293 |
@@ -92,7 +92,7 @@ Condor_Auth_X509 :: ~Condor_Auth_X509()
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
-int Condor_Auth_X509 :: authenticate(const char * /* remoteHost */, CondorError* errstack)
|
|
|
b3fe293 |
+int Condor_Auth_X509 :: authenticate(const char * remoteHost, CondorError* errstack)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
int status = 1;
|
|
|
b3fe293 |
int reply = 0;
|
|
|
b3fe293 |
@@ -171,7 +171,7 @@ int Condor_Auth_X509 :: authenticate(const char * /* remoteHost */, CondorError*
|
|
|
b3fe293 |
|
|
|
b3fe293 |
switch ( mySock_->isClient() ) {
|
|
|
b3fe293 |
case 1:
|
|
|
b3fe293 |
- status = authenticate_client_gss(errstack);
|
|
|
b3fe293 |
+ status = authenticate_client_gss(remoteHost, errstack);
|
|
|
b3fe293 |
break;
|
|
|
b3fe293 |
default:
|
|
|
b3fe293 |
status = authenticate_server_gss(errstack);
|
|
|
b3fe293 |
@@ -655,7 +655,7 @@ int Condor_Auth_X509::authenticate_self_gss(CondorError* errstack)
|
|
|
b3fe293 |
return TRUE;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
-int Condor_Auth_X509::authenticate_client_gss(CondorError* errstack)
|
|
|
b3fe293 |
+int Condor_Auth_X509::authenticate_client_gss(const char * remoteHost, CondorError* errstack)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
OM_uint32 major_status = 0;
|
|
|
b3fe293 |
OM_uint32 minor_status = 0;
|
|
|
b3fe293 |
@@ -775,31 +775,48 @@ int Condor_Auth_X509::authenticate_client_gss(CondorError* errstack)
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- std::string fqh = get_full_hostname(mySock_->peer_addr());
|
|
|
b3fe293 |
- StringList * daemonNames = getDaemonList("GSI_DAEMON_NAME",fqh.c_str());
|
|
|
b3fe293 |
-
|
|
|
b3fe293 |
- // Now, let's see if the name is in the list, I am not using
|
|
|
b3fe293 |
- // anycase here, so if the host name and what we are looking for
|
|
|
b3fe293 |
- // are in different cases, then we will run into problems.
|
|
|
b3fe293 |
- if( daemonNames ) {
|
|
|
b3fe293 |
- status = daemonNames->contains_withwildcard(server) == TRUE? 1 : 0;
|
|
|
b3fe293 |
-
|
|
|
b3fe293 |
- if( !status ) {
|
|
|
b3fe293 |
- errstack->pushf("GSI", GSI_ERR_UNAUTHORIZED_SERVER,
|
|
|
b3fe293 |
- "Failed to authenticate because the subject '%s' is not currently trusted by you. "
|
|
|
b3fe293 |
- "If it should be, add it to GSI_DAEMON_NAME or undefine GSI_DAEMON_NAME.", server);
|
|
|
b3fe293 |
- dprintf(D_SECURITY,
|
|
|
b3fe293 |
- "GSI_DAEMON_NAME is defined and the server %s is not specified in the GSI_DAEMON_NAME parameter\n",
|
|
|
b3fe293 |
- server);
|
|
|
b3fe293 |
- }
|
|
|
b3fe293 |
+ std::vector<MyString> fqhs;
|
|
|
b3fe293 |
+ if (remoteHost)
|
|
|
b3fe293 |
+ {
|
|
|
b3fe293 |
+ std::vector<MyString> fqhs_copy = get_hostname_with_alias(mySock_->peer_addr());
|
|
|
b3fe293 |
+ fqhs.push_back(remoteHost);
|
|
|
b3fe293 |
+ fqhs.insert(fqhs.begin()+1, fqhs_copy.begin(), fqhs_copy.end());
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
- else {
|
|
|
b3fe293 |
- status = CheckServerName(fqh.c_str(),mySock_->peer_ip_str(),mySock_,errstack);
|
|
|
b3fe293 |
+ else
|
|
|
b3fe293 |
+ {
|
|
|
b3fe293 |
+ fqhs = get_hostname_with_alias(mySock_->peer_addr());
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
+ dprintf(D_FULLDEBUG, "Number of aliases: %zu\n", fqhs.size());
|
|
|
b3fe293 |
+ for(std::vector<MyString>::const_iterator it = fqhs.begin(); it != fqhs.end(); ++it) {
|
|
|
b3fe293 |
+ dprintf(D_FULLDEBUG, "Checking validity of alias %s\n", it->Value());
|
|
|
b3fe293 |
+ std::string fqh = it->Value();
|
|
|
b3fe293 |
+ StringList * daemonNames = getDaemonList("GSI_DAEMON_NAME",fqh.c_str());
|
|
|
b3fe293 |
+
|
|
|
b3fe293 |
+ // Now, let's see if the name is in the list, I am not using
|
|
|
b3fe293 |
+ // anycase here, so if the host name and what we are looking for
|
|
|
b3fe293 |
+ // are in different cases, then we will run into problems.
|
|
|
b3fe293 |
+ if( daemonNames ) {
|
|
|
b3fe293 |
+ status = daemonNames->contains_withwildcard(server) == TRUE? 1 : 0;
|
|
|
b3fe293 |
+
|
|
|
b3fe293 |
+ if( !status ) {
|
|
|
b3fe293 |
+ errstack->pushf("GSI", GSI_ERR_UNAUTHORIZED_SERVER,
|
|
|
b3fe293 |
+ "Failed to authenticate because the subject '%s' is not currently trusted by you. "
|
|
|
b3fe293 |
+ "If it should be, add it to GSI_DAEMON_NAME or undefine GSI_DAEMON_NAME.", server);
|
|
|
b3fe293 |
+ dprintf(D_SECURITY,
|
|
|
b3fe293 |
+ "GSI_DAEMON_NAME is defined and the server %s is not specified in the GSI_DAEMON_NAME parameter\n",
|
|
|
b3fe293 |
+ server);
|
|
|
b3fe293 |
+ }
|
|
|
b3fe293 |
+ }
|
|
|
b3fe293 |
+ else {
|
|
|
b3fe293 |
+ status = CheckServerName(fqh.c_str(),mySock_->peer_ip_str(),mySock_,errstack);
|
|
|
b3fe293 |
+ }
|
|
|
b3fe293 |
+ delete daemonNames;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- if (status) {
|
|
|
b3fe293 |
- dprintf(D_SECURITY, "valid GSS connection established to %s\n", server);
|
|
|
b3fe293 |
- }
|
|
|
b3fe293 |
+ if (status) {
|
|
|
b3fe293 |
+ dprintf(D_SECURITY, "valid GSS connection established to %s\n", server);
|
|
|
b3fe293 |
+ break;
|
|
|
b3fe293 |
+ }
|
|
|
b3fe293 |
+ }
|
|
|
b3fe293 |
|
|
|
b3fe293 |
mySock_->encode();
|
|
|
b3fe293 |
if (!mySock_->code(status) || !mySock_->end_of_message()) {
|
|
|
b3fe293 |
@@ -810,7 +827,6 @@ int Condor_Auth_X509::authenticate_client_gss(CondorError* errstack)
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
delete [] server;
|
|
|
b3fe293 |
- delete daemonNames;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
clear:
|
|
|
b3fe293 |
return (status == 0) ? FALSE : TRUE;
|
|
|
b3fe293 |
diff --git a/src/condor_io/condor_secman.cpp b/src/condor_io/condor_secman.cpp
|
|
|
b3fe293 |
index 21607fe..ea768bf 100644
|
|
|
b3fe293 |
--- a/src/condor_io/condor_secman.cpp
|
|
|
b3fe293 |
+++ b/src/condor_io/condor_secman.cpp
|
|
|
b3fe293 |
@@ -855,7 +855,7 @@ class SecManStartCommand: Service, public ClassyCountedPtr {
|
|
|
b3fe293 |
SecManStartCommand (
|
|
|
b3fe293 |
int cmd,Sock *sock,bool raw_protocol,
|
|
|
b3fe293 |
CondorError *errstack,int subcmd,StartCommandCallbackType *callback_fn,
|
|
|
b3fe293 |
- void *misc_data,bool nonblocking,char const *cmd_description,char const *sec_session_id_hint,SecMan *sec_man):
|
|
|
b3fe293 |
+ void *misc_data,bool nonblocking,char const *cmd_description,char const *sec_session_id_hint,SecMan *sec_man, const std::string &hostname):
|
|
|
b3fe293 |
|
|
|
b3fe293 |
m_cmd(cmd),
|
|
|
b3fe293 |
m_subcmd(subcmd),
|
|
|
b3fe293 |
@@ -867,7 +867,8 @@ class SecManStartCommand: Service, public ClassyCountedPtr {
|
|
|
b3fe293 |
m_nonblocking(nonblocking),
|
|
|
b3fe293 |
m_pending_socket_registered(false),
|
|
|
b3fe293 |
m_sec_man(*sec_man),
|
|
|
b3fe293 |
- m_use_tmp_sec_session(false)
|
|
|
b3fe293 |
+ m_use_tmp_sec_session(false),
|
|
|
b3fe293 |
+ m_hostname(hostname)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
m_sec_session_id_hint = sec_session_id_hint ? sec_session_id_hint : "";
|
|
|
b3fe293 |
if( m_sec_session_id_hint == USE_TMP_SEC_SESSION ) {
|
|
|
b3fe293 |
@@ -972,6 +973,7 @@ class SecManStartCommand: Service, public ClassyCountedPtr {
|
|
|
b3fe293 |
KeyCacheEntry *m_enc_key;
|
|
|
b3fe293 |
KeyInfo* m_private_key;
|
|
|
b3fe293 |
MyString m_sec_session_id_hint;
|
|
|
b3fe293 |
+ std::string m_hostname;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
enum StartCommandState {
|
|
|
b3fe293 |
SendAuthInfo,
|
|
|
b3fe293 |
@@ -1023,7 +1025,7 @@ class SecManStartCommand: Service, public ClassyCountedPtr {
|
|
|
b3fe293 |
};
|
|
|
b3fe293 |
|
|
|
b3fe293 |
StartCommandResult
|
|
|
b3fe293 |
-SecMan::startCommand( int cmd, Sock* sock, bool raw_protocol, CondorError* errstack, int subcmd, StartCommandCallbackType *callback_fn, void *misc_data, bool nonblocking,char const *cmd_description,char const *sec_session_id_hint)
|
|
|
b3fe293 |
+SecMan::startCommand( int cmd, Sock* sock, bool raw_protocol, CondorError* errstack, int subcmd, StartCommandCallbackType *callback_fn, void *misc_data, bool nonblocking,char const *cmd_description,char const *sec_session_id_hint, const char *hostname)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
// This function is simply a convenient wrapper around the
|
|
|
b3fe293 |
// SecManStartCommand class, which does the actual work.
|
|
|
b3fe293 |
@@ -1032,7 +1034,8 @@ SecMan::startCommand( int cmd, Sock* sock, bool raw_protocol, CondorError* errst
|
|
|
b3fe293 |
// The blocking case could avoid use of the heap, but for simplicity,
|
|
|
b3fe293 |
// we just do the same in both cases.
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- classy_counted_ptr<SecManStartCommand> sc = new SecManStartCommand(cmd,sock,raw_protocol,errstack,subcmd,callback_fn,misc_data,nonblocking,cmd_description,sec_session_id_hint,this);
|
|
|
b3fe293 |
+ std::string hostname_str = hostname ? hostname : "";
|
|
|
b3fe293 |
+ classy_counted_ptr<SecManStartCommand> sc = new SecManStartCommand(cmd,sock,raw_protocol,errstack,subcmd,callback_fn,misc_data,nonblocking,cmd_description,sec_session_id_hint,this, hostname_str);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
ASSERT(sc.get());
|
|
|
b3fe293 |
|
|
|
b3fe293 |
@@ -1829,7 +1832,7 @@ SecManStartCommand::authenticate_inner()
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int auth_timeout = m_sec_man.getSecTimeout( CLIENT_PERM );
|
|
|
b3fe293 |
- bool auth_success = m_sock->authenticate(m_private_key, auth_methods, m_errstack,auth_timeout);
|
|
|
b3fe293 |
+ bool auth_success = m_sock->authenticate(m_private_key, auth_methods, m_errstack,auth_timeout, NULL, m_hostname.c_str());
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if (auth_methods) {
|
|
|
b3fe293 |
free(auth_methods);
|
|
|
b3fe293 |
@@ -2159,7 +2162,8 @@ SecManStartCommand::DoTCPAuth_inner()
|
|
|
b3fe293 |
m_nonblocking,
|
|
|
b3fe293 |
m_cmd_description.Value(),
|
|
|
b3fe293 |
m_sec_session_id_hint.Value(),
|
|
|
b3fe293 |
- &m_sec_man);
|
|
|
b3fe293 |
+ &m_sec_man,
|
|
|
b3fe293 |
+ m_hostname);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
StartCommandResult auth_result = m_tcp_auth_command->startCommand();
|
|
|
b3fe293 |
|
|
|
b3fe293 |
@@ -2796,23 +2800,23 @@ char* SecMan::my_parent_unique_id() {
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int
|
|
|
b3fe293 |
-SecMan::authenticate_sock(Sock *s,DCpermission perm, CondorError* errstack)
|
|
|
b3fe293 |
+SecMan::authenticate_sock(Sock *s,DCpermission perm, CondorError* errstack, const char * hostname)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
MyString methods;
|
|
|
b3fe293 |
getAuthenticationMethods( perm, &methods );
|
|
|
b3fe293 |
ASSERT(s);
|
|
|
b3fe293 |
int auth_timeout = getSecTimeout(perm);
|
|
|
b3fe293 |
- return s->authenticate(methods.Value(),errstack,auth_timeout);
|
|
|
b3fe293 |
+ return s->authenticate(methods.Value(),errstack,auth_timeout, hostname);
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int
|
|
|
b3fe293 |
-SecMan::authenticate_sock(Sock *s,KeyInfo *&ki, DCpermission perm, CondorError* errstack)
|
|
|
b3fe293 |
+SecMan::authenticate_sock(Sock *s,KeyInfo *&ki, DCpermission perm, CondorError* errstack, const char * hostname)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
MyString methods;
|
|
|
b3fe293 |
getAuthenticationMethods( perm, &methods );
|
|
|
b3fe293 |
ASSERT(s);
|
|
|
b3fe293 |
int auth_timeout = getSecTimeout(perm);
|
|
|
b3fe293 |
- return s->authenticate(ki,methods.Value(),errstack,auth_timeout);
|
|
|
b3fe293 |
+ return s->authenticate(ki,methods.Value(),errstack,auth_timeout, NULL, hostname);
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int
|
|
|
b3fe293 |
diff --git a/src/condor_io/reli_sock.cpp b/src/condor_io/reli_sock.cpp
|
|
|
b3fe293 |
index d80bab4..00a6d10 100644
|
|
|
b3fe293 |
--- a/src/condor_io/reli_sock.cpp
|
|
|
b3fe293 |
+++ b/src/condor_io/reli_sock.cpp
|
|
|
b3fe293 |
@@ -967,11 +967,11 @@ ReliSock::prepare_for_nobuffering(stream_coding direction)
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int ReliSock::perform_authenticate(bool with_key, KeyInfo *& key,
|
|
|
b3fe293 |
const char* methods, CondorError* errstack,
|
|
|
b3fe293 |
- int auth_timeout, char **method_used)
|
|
|
b3fe293 |
+ int auth_timeout, char **method_used,
|
|
|
b3fe293 |
+ const char * hostname )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
int in_encode_mode;
|
|
|
b3fe293 |
int result;
|
|
|
b3fe293 |
-
|
|
|
b3fe293 |
if( method_used ) {
|
|
|
b3fe293 |
*method_used = NULL;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
@@ -984,9 +984,9 @@ int ReliSock::perform_authenticate(bool with_key, KeyInfo *& key,
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// actually perform the authentication
|
|
|
b3fe293 |
if ( with_key ) {
|
|
|
b3fe293 |
- result = authob.authenticate( hostAddr, key, methods, errstack, auth_timeout );
|
|
|
b3fe293 |
+ result = authob.authenticate( hostname, key, methods, errstack, auth_timeout );
|
|
|
b3fe293 |
} else {
|
|
|
b3fe293 |
- result = authob.authenticate( hostAddr, methods, errstack, auth_timeout );
|
|
|
b3fe293 |
+ result = authob.authenticate( hostname, methods, errstack, auth_timeout );
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
// restore stream mode (either encode or decode)
|
|
|
b3fe293 |
if ( in_encode_mode && is_decode() ) {
|
|
|
b3fe293 |
@@ -1010,16 +1010,16 @@ int ReliSock::perform_authenticate(bool with_key, KeyInfo *& key,
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
-int ReliSock::authenticate(KeyInfo *& key, const char* methods, CondorError* errstack, int auth_timeout, char **method_used)
|
|
|
b3fe293 |
+int ReliSock::authenticate(KeyInfo *& key, const char* methods, CondorError* errstack, int auth_timeout, char **method_used, const char *hostname)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
- return perform_authenticate(true,key,methods,errstack,auth_timeout,method_used);
|
|
|
b3fe293 |
+ return perform_authenticate(true,key,methods,errstack,auth_timeout,method_used, hostname);
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int
|
|
|
b3fe293 |
-ReliSock::authenticate(const char* methods, CondorError* errstack,int auth_timeout )
|
|
|
b3fe293 |
+ReliSock::authenticate(const char* methods, CondorError* errstack,int auth_timeout, const char * hostname)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
KeyInfo *key = NULL;
|
|
|
b3fe293 |
- return perform_authenticate(false,key,methods,errstack,auth_timeout,NULL);
|
|
|
b3fe293 |
+ return perform_authenticate(false,key,methods,errstack,auth_timeout,NULL, hostname);
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
bool
|
|
|
b3fe293 |
diff --git a/src/condor_io/sock.cpp b/src/condor_io/sock.cpp
|
|
|
b3fe293 |
index c4dcb0b..e743139 100644
|
|
|
b3fe293 |
--- a/src/condor_io/sock.cpp
|
|
|
b3fe293 |
+++ b/src/condor_io/sock.cpp
|
|
|
b3fe293 |
@@ -2235,12 +2235,12 @@ bool Sock :: is_hdr_encrypt(){
|
|
|
b3fe293 |
return FALSE;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
-int Sock :: authenticate(KeyInfo *&, const char * /* methods */, CondorError* /* errstack */, int /*timeout*/, char ** /*method_used*/)
|
|
|
b3fe293 |
+int Sock :: authenticate(KeyInfo *&, const char * /* methods */, CondorError* /* errstack */, int /*timeout*/, char ** /*method_used*/, const char * /*hostname*/)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
return -1;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
-int Sock :: authenticate(const char * /* methods */, CondorError* /* errstack */, int /*timeout*/)
|
|
|
b3fe293 |
+int Sock :: authenticate(const char * /* methods */, CondorError* /* errstack */, int /*timeout*/, const char * /*hostname*/)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
/*
|
|
|
b3fe293 |
errstack->push("AUTHENTICATE", AUTHENTICATE_ERR_NOT_BUILT,
|
|
|
b3fe293 |
diff --git a/src/condor_job_router/submit_job.cpp b/src/condor_job_router/submit_job.cpp
|
|
|
b3fe293 |
index ccad171..393bafc 100644
|
|
|
b3fe293 |
--- a/src/condor_job_router/submit_job.cpp
|
|
|
b3fe293 |
+++ b/src/condor_job_router/submit_job.cpp
|
|
|
b3fe293 |
@@ -175,7 +175,7 @@ ClaimJobResult claim_job(int cluster, int proc, MyString * error_details, const
|
|
|
b3fe293 |
static Qmgr_connection *open_q_as_owner(char const *effective_owner,DCSchedd &schedd,FailObj &failobj)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- Qmgr_connection * qmgr = ConnectQ(schedd.addr(), 0 /*timeout==default*/, false /*read-only*/, & errstack, effective_owner, schedd.version());
|
|
|
b3fe293 |
+ Qmgr_connection * qmgr = ConnectQ(schedd, 0 /*timeout==default*/, false /*read-only*/, & errstack, effective_owner, schedd.version());
|
|
|
b3fe293 |
if( ! qmgr ) {
|
|
|
b3fe293 |
failobj.fail("Unable to connect\n%s\n", errstack.getFullText(true));
|
|
|
b3fe293 |
return NULL;
|
|
|
b3fe293 |
diff --git a/src/condor_prio/prio.cpp b/src/condor_prio/prio.cpp
|
|
|
b3fe293 |
index deec9b1..c27aa94 100644
|
|
|
b3fe293 |
--- a/src/condor_prio/prio.cpp
|
|
|
b3fe293 |
+++ b/src/condor_prio/prio.cpp
|
|
|
b3fe293 |
@@ -157,8 +157,7 @@ main( int argc, char *argv[] )
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// Open job queue
|
|
|
b3fe293 |
- DaemonName = schedd.addr();
|
|
|
b3fe293 |
- q = ConnectQ(DaemonName.Value());
|
|
|
b3fe293 |
+ q = ConnectQ(schedd);
|
|
|
b3fe293 |
if( !q ) {
|
|
|
b3fe293 |
fprintf( stderr, "Failed to connect to queue manager %s\n",
|
|
|
b3fe293 |
DaemonName.Value() );
|
|
|
b3fe293 |
diff --git a/src/condor_q.V6/queue.cpp b/src/condor_q.V6/queue.cpp
|
|
|
b3fe293 |
index 58ff6ed..85ad9cf 100644
|
|
|
b3fe293 |
--- a/src/condor_q.V6/queue.cpp
|
|
|
b3fe293 |
+++ b/src/condor_q.V6/queue.cpp
|
|
|
b3fe293 |
@@ -119,13 +119,13 @@ static char * bufferJobShort (ClassAd *);
|
|
|
b3fe293 |
/* if useDB is false, then v1 =scheddAddress, v2=scheddName, v3=scheddMachine, v4=scheddVersion;
|
|
|
b3fe293 |
if useDB is true, then v1 =quill_name, v2=db_ipAddr, v3=db_name, v4=db_password
|
|
|
b3fe293 |
*/
|
|
|
b3fe293 |
-static bool show_queue (const char* v1, const char* v2, const char* v3, const char* v4, bool useDB);
|
|
|
b3fe293 |
-static bool show_queue_buffered (const char* v1, const char* v2, const char* v3, const char* v4, bool useDB);
|
|
|
b3fe293 |
+static bool show_queue (const char* v1, const char* v2, const char* v3, const char* v4, const ClassAd *ad, bool useDB);
|
|
|
b3fe293 |
+static bool show_queue_buffered (const char* v1, const char* v2, const char* v3, const char* v4, const ClassAd *ad, bool useDB);
|
|
|
b3fe293 |
static void init_output_mask();
|
|
|
b3fe293 |
|
|
|
b3fe293 |
|
|
|
b3fe293 |
/* a type used to point to one of the above two functions */
|
|
|
b3fe293 |
-typedef bool (*show_queue_fp)(const char* v1, const char* v2, const char* v3, const char* v4, bool useDB);
|
|
|
b3fe293 |
+typedef bool (*show_queue_fp)(const char* v1, const char* v2, const char* v3, const char* v4, const ClassAd *ad, bool useDB);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
static bool read_classad_file(const char *filename, ClassAdList &classads);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
@@ -506,7 +506,7 @@ int main (int argc, char **argv)
|
|
|
b3fe293 |
|
|
|
b3fe293 |
/* ask the database for the queue */
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- if ( (retval = sqfp( NULL, NULL, NULL, NULL, TRUE) ) ) {
|
|
|
b3fe293 |
+ if ( (retval = sqfp( NULL, NULL, NULL, NULL, NULL, TRUE) ) ) {
|
|
|
b3fe293 |
/* if the queue was retrieved, then I am done */
|
|
|
b3fe293 |
freeConnectionStrings();
|
|
|
b3fe293 |
exit(retval?EXIT_SUCCESS:EXIT_FAILURE);
|
|
|
b3fe293 |
@@ -557,7 +557,7 @@ int main (int argc, char **argv)
|
|
|
b3fe293 |
(quill.name()):tmp_char,
|
|
|
b3fe293 |
(quill.fullHostname())?
|
|
|
b3fe293 |
(quill.fullHostname()):tmp_char,
|
|
|
b3fe293 |
- NULL, FALSE) ) ) )
|
|
|
b3fe293 |
+ NULL, NULL, FALSE) ) ) )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
/* if the queue was retrieved, then I am done */
|
|
|
b3fe293 |
freeConnectionStrings();
|
|
|
b3fe293 |
@@ -600,7 +600,7 @@ int main (int argc, char **argv)
|
|
|
b3fe293 |
#endif /* HAVE_EXT_POSTGRESQL */
|
|
|
b3fe293 |
case DIRECT_SCHEDD:
|
|
|
b3fe293 |
retval = sqfp(scheddAddr, scheddName, scheddMachine,
|
|
|
b3fe293 |
- scheddVersion.Value(), FALSE);
|
|
|
b3fe293 |
+ scheddVersion.Value(), NULL, FALSE);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
/* Hopefully I got the queue from the schedd... */
|
|
|
b3fe293 |
freeConnectionStrings();
|
|
|
b3fe293 |
@@ -793,7 +793,7 @@ int main (int argc, char **argv)
|
|
|
b3fe293 |
case DIRECT_RDBMS:
|
|
|
b3fe293 |
if (useDB) {
|
|
|
b3fe293 |
if ( (retval = sqfp(quillName, dbIpAddr, dbName,
|
|
|
b3fe293 |
- queryPassword, TRUE) ) )
|
|
|
b3fe293 |
+ queryPassword, ad, TRUE) ) )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
/* processed correctly, so do the next ad */
|
|
|
b3fe293 |
continue;
|
|
|
b3fe293 |
@@ -840,7 +840,7 @@ int main (int argc, char **argv)
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if((result2 == Q_OK) && quillAddr &&
|
|
|
b3fe293 |
(retval = sqfp(quillAddr, quillName, quillMachine,
|
|
|
b3fe293 |
- NULL, FALSE) ) )
|
|
|
b3fe293 |
+ NULL, ad, FALSE) ) )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
/* processed correctly, so do the next ad */
|
|
|
b3fe293 |
continue;
|
|
|
b3fe293 |
@@ -896,7 +896,7 @@ int main (int argc, char **argv)
|
|
|
b3fe293 |
case DIRECT_SCHEDD:
|
|
|
b3fe293 |
/* database not configured or could not be reached,
|
|
|
b3fe293 |
query the schedd daemon directly */
|
|
|
b3fe293 |
- retval = sqfp(scheddAddr, scheddName, scheddMachine, scheddVersion.Value(), FALSE);
|
|
|
b3fe293 |
+ retval = sqfp(scheddAddr, scheddName, scheddMachine, scheddVersion.Value(), ad, FALSE);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
break;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
@@ -2536,7 +2536,7 @@ static void init_output_mask()
|
|
|
b3fe293 |
*/
|
|
|
b3fe293 |
|
|
|
b3fe293 |
static bool
|
|
|
b3fe293 |
-show_queue_buffered( const char* v1, const char* v2, const char* v3, const char* v4, bool useDB )
|
|
|
b3fe293 |
+show_queue_buffered( const char* v1, const char* v2, const char* v3, const char* v4, const ClassAd* ad, bool useDB )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
const char *scheddAddress = 0;
|
|
|
b3fe293 |
const char *scheddName = 0;
|
|
|
b3fe293 |
@@ -2709,7 +2709,13 @@ show_queue_buffered( const char* v1, const char* v2, const char* v3, const char*
|
|
|
b3fe293 |
#endif /* HAVE_EXT_POSTGRESQL */
|
|
|
b3fe293 |
} else {
|
|
|
b3fe293 |
// fetch queue from schedd and stash it in output_buffer.
|
|
|
b3fe293 |
- Daemon schedd(DT_SCHEDD, scheddName, pool ? pool->addr() : NULL );
|
|
|
b3fe293 |
+ Daemon *schedd_ptr = NULL;
|
|
|
b3fe293 |
+ if (ad)
|
|
|
b3fe293 |
+ schedd_ptr = new Daemon(ad, DT_SCHEDD, pool ? pool->addr() : NULL );
|
|
|
b3fe293 |
+ else
|
|
|
b3fe293 |
+ schedd_ptr = new Daemon(DT_SCHEDD, scheddName, pool ? pool->addr() : NULL );
|
|
|
b3fe293 |
+ ASSERT(schedd_ptr);
|
|
|
b3fe293 |
+ Daemon & schedd = *schedd_ptr;
|
|
|
b3fe293 |
const char *version = schedd.version();
|
|
|
b3fe293 |
bool useFastPath = false;
|
|
|
b3fe293 |
if (version) {
|
|
|
b3fe293 |
@@ -2719,9 +2725,12 @@ show_queue_buffered( const char* v1, const char* v2, const char* v3, const char*
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// stash the schedd daemon object for use by process_buffer_line
|
|
|
b3fe293 |
g_cur_schedd_for_process_buffer_line = new Daemon( schedd );
|
|
|
b3fe293 |
+ ASSERT( g_cur_schedd_for_process_buffer_line );
|
|
|
b3fe293 |
+
|
|
|
b3fe293 |
+ delete schedd_ptr;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int fetchResult;
|
|
|
b3fe293 |
- if( (fetchResult = Q.fetchQueueFromHostAndProcess( scheddAddress, attrs,
|
|
|
b3fe293 |
+ if( (fetchResult = Q.fetchQueueFromDaemonAndProcess( *g_cur_schedd_for_process_buffer_line, attrs,
|
|
|
b3fe293 |
process_buffer_line,
|
|
|
b3fe293 |
useFastPath,
|
|
|
b3fe293 |
&errstack)) != Q_OK) {
|
|
|
b3fe293 |
@@ -2967,7 +2976,7 @@ process_buffer_line( ClassAd *job )
|
|
|
b3fe293 |
refer to the prototype of this function on the top of this file
|
|
|
b3fe293 |
*/
|
|
|
b3fe293 |
static bool
|
|
|
b3fe293 |
-show_queue( const char* v1, const char* v2, const char* v3, const char* v4, bool useDB )
|
|
|
b3fe293 |
+show_queue( const char* v1, const char* v2, const char* v3, const char* v4, const ClassAd * ad, bool useDB )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
const char *scheddAddress;
|
|
|
b3fe293 |
const char *scheddName;
|
|
|
b3fe293 |
@@ -3046,7 +3055,13 @@ show_queue( const char* v1, const char* v2, const char* v3, const char* v4, bool
|
|
|
b3fe293 |
} else {
|
|
|
b3fe293 |
// fetch queue from schedd
|
|
|
b3fe293 |
int fetchResult;
|
|
|
b3fe293 |
- if( (fetchResult = Q.fetchQueueFromHost(jobs, attrs,scheddAddress, scheddVersion, &errstack) != Q_OK)) {
|
|
|
b3fe293 |
+ Daemon *schedd_daemon_ptr;
|
|
|
b3fe293 |
+ if (ad)
|
|
|
b3fe293 |
+ schedd_daemon_ptr = new Daemon(ad, DT_SCHEDD, pool ? pool->addr() : NULL );
|
|
|
b3fe293 |
+ else
|
|
|
b3fe293 |
+ schedd_daemon_ptr = new Daemon(DT_SCHEDD, scheddName, pool ? pool->addr() : NULL );
|
|
|
b3fe293 |
+ Daemon &schedd_daemon = *schedd_daemon_ptr;
|
|
|
b3fe293 |
+ if( (fetchResult = Q.fetchQueueFromDaemon(jobs, attrs, schedd_daemon, scheddVersion, &errstack) != Q_OK)) {
|
|
|
b3fe293 |
// The parse + fetch failed, print out why
|
|
|
b3fe293 |
switch(fetchResult) {
|
|
|
b3fe293 |
case Q_PARSE_ERROR:
|
|
|
b3fe293 |
@@ -3081,7 +3096,12 @@ show_queue( const char* v1, const char* v2, const char* v3, const char* v4, bool
|
|
|
b3fe293 |
scheddAddress, scheddMachine);
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- Daemon schedd_daemon(DT_SCHEDD,scheddName,pool ? pool->addr() : NULL);
|
|
|
b3fe293 |
+ Daemon *schedd_daemon_ptr;
|
|
|
b3fe293 |
+ if (ad)
|
|
|
b3fe293 |
+ schedd_daemon_ptr = new Daemon(ad, DT_SCHEDD, pool ? pool->addr() : NULL );
|
|
|
b3fe293 |
+ else
|
|
|
b3fe293 |
+ schedd_daemon_ptr = new Daemon(DT_SCHEDD, scheddName, pool ? pool->addr() : NULL );
|
|
|
b3fe293 |
+ Daemon &schedd_daemon = *schedd_daemon_ptr;
|
|
|
b3fe293 |
schedd_daemon.locate();
|
|
|
b3fe293 |
|
|
|
b3fe293 |
jobs.Open();
|
|
|
b3fe293 |
@@ -3089,6 +3109,7 @@ show_queue( const char* v1, const char* v2, const char* v3, const char* v4, bool
|
|
|
b3fe293 |
doRunAnalysis( job, &schedd_daemon );
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
jobs.Close();
|
|
|
b3fe293 |
+ delete schedd_daemon_ptr;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if(lastUpdate) {
|
|
|
b3fe293 |
free(lastUpdate);
|
|
|
b3fe293 |
diff --git a/src/condor_schedd.V6/qmgmt_receivers.cpp b/src/condor_schedd.V6/qmgmt_receivers.cpp
|
|
|
b3fe293 |
index 98e1960..db6314f 100644
|
|
|
b3fe293 |
--- a/src/condor_schedd.V6/qmgmt_receivers.cpp
|
|
|
b3fe293 |
+++ b/src/condor_schedd.V6/qmgmt_receivers.cpp
|
|
|
b3fe293 |
@@ -71,7 +71,7 @@ do_Q_request(ReliSock *syscall_sock,bool &may_fork)
|
|
|
b3fe293 |
dprintf(D_SECURITY,"Calling authenticate(%s) in qmgmt_receivers\n", methods.Value());
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(syscall_sock, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(syscall_sock, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
// Failed to authenticate
|
|
|
b3fe293 |
dprintf( D_ALWAYS, "SCHEDD: authentication failed: %s\n",
|
|
|
b3fe293 |
errstack.getFullText() );
|
|
|
b3fe293 |
diff --git a/src/condor_schedd.V6/qmgr_job_updater.cpp b/src/condor_schedd.V6/qmgr_job_updater.cpp
|
|
|
b3fe293 |
index f9c100a..25126dd 100644
|
|
|
b3fe293 |
--- a/src/condor_schedd.V6/qmgr_job_updater.cpp
|
|
|
b3fe293 |
+++ b/src/condor_schedd.V6/qmgr_job_updater.cpp
|
|
|
b3fe293 |
@@ -47,8 +47,10 @@ QmgrJobUpdater::QmgrJobUpdater( ClassAd* job, const char* schedd_address,
|
|
|
b3fe293 |
schedd_addr(schedd_address?strdup(schedd_address):0),
|
|
|
b3fe293 |
schedd_ver(schedd_version?strdup(schedd_version):0),
|
|
|
b3fe293 |
cluster(-1), proc(-1),
|
|
|
b3fe293 |
- q_update_tid(-1)
|
|
|
b3fe293 |
+ q_update_tid(-1),
|
|
|
b3fe293 |
+ m_daemon(DT_SCHEDD, schedd_address)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
+
|
|
|
b3fe293 |
if( ! is_valid_sinful(schedd_address) ) {
|
|
|
b3fe293 |
EXCEPT( "schedd_addr not specified with valid address (%s)",
|
|
|
b3fe293 |
schedd_address );
|
|
|
b3fe293 |
@@ -252,7 +254,7 @@ QmgrJobUpdater::updateAttr( const char *name, const char *expr, bool updateMaste
|
|
|
b3fe293 |
if (log) {
|
|
|
b3fe293 |
flags = SHOULDLOG;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
- if( ConnectQ(schedd_addr,SHADOW_QMGMT_TIMEOUT,false,NULL,m_owner.Value(),schedd_ver) ) {
|
|
|
b3fe293 |
+ if( ConnectQ(m_daemon,SHADOW_QMGMT_TIMEOUT,false,NULL,m_owner.Value(),schedd_ver) ) {
|
|
|
b3fe293 |
if( SetAttribute(cluster,p,name,expr,flags) < 0 ) {
|
|
|
b3fe293 |
err_msg = "SetAttribute() failed";
|
|
|
b3fe293 |
result = FALSE;
|
|
|
b3fe293 |
@@ -338,7 +340,7 @@ QmgrJobUpdater::updateJob( update_t type, SetAttributeFlags_t commit_flags )
|
|
|
b3fe293 |
job_queue_attrs->contains_anycase(name)) ) {
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if( ! is_connected ) {
|
|
|
b3fe293 |
- if( ! ConnectQ(schedd_addr, SHADOW_QMGMT_TIMEOUT, false, NULL, m_owner.Value(),schedd_ver) ) {
|
|
|
b3fe293 |
+ if( ! ConnectQ(m_daemon, SHADOW_QMGMT_TIMEOUT, false, NULL, m_owner.Value(),schedd_ver) ) {
|
|
|
b3fe293 |
return false;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
is_connected = true;
|
|
|
b3fe293 |
@@ -351,7 +353,7 @@ QmgrJobUpdater::updateJob( update_t type, SetAttributeFlags_t commit_flags )
|
|
|
b3fe293 |
m_pull_attrs->rewind();
|
|
|
b3fe293 |
while ( (name = m_pull_attrs->next()) ) {
|
|
|
b3fe293 |
if ( !is_connected ) {
|
|
|
b3fe293 |
- if ( !ConnectQ( schedd_addr, SHADOW_QMGMT_TIMEOUT, true, NULL, NULL, schedd_ver ) ) {
|
|
|
b3fe293 |
+ if ( !ConnectQ( m_daemon, SHADOW_QMGMT_TIMEOUT, true, NULL, NULL, schedd_ver ) ) {
|
|
|
b3fe293 |
return false;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
is_connected = true;
|
|
|
b3fe293 |
@@ -392,7 +394,7 @@ QmgrJobUpdater::retrieveJobUpdates( void )
|
|
|
b3fe293 |
ProcIdToStr(cluster, proc, id_str);
|
|
|
b3fe293 |
job_ids.insert(id_str);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- if ( !ConnectQ( schedd_addr, SHADOW_QMGMT_TIMEOUT, false ) ) {
|
|
|
b3fe293 |
+ if ( !ConnectQ( m_daemon, SHADOW_QMGMT_TIMEOUT, false ) ) {
|
|
|
b3fe293 |
return false;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
if ( GetDirtyAttributes( cluster, proc, &updates ) < 0 ) {
|
|
|
b3fe293 |
diff --git a/src/condor_schedd.V6/qmgr_job_updater.h b/src/condor_schedd.V6/qmgr_job_updater.h
|
|
|
b3fe293 |
index e487688..ad86fe2 100644
|
|
|
b3fe293 |
--- a/src/condor_schedd.V6/qmgr_job_updater.h
|
|
|
b3fe293 |
+++ b/src/condor_schedd.V6/qmgr_job_updater.h
|
|
|
b3fe293 |
@@ -47,7 +47,7 @@ class QmgrJobUpdater : public Service
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
public:
|
|
|
b3fe293 |
QmgrJobUpdater( ClassAd* job_a, const char*schedd_address, char const *schedd_version);
|
|
|
b3fe293 |
- QmgrJobUpdater( ) : common_job_queue_attrs(0), hold_job_queue_attrs(0), evict_job_queue_attrs(0), remove_job_queue_attrs(0), requeue_job_queue_attrs(0), terminate_job_queue_attrs(0), checkpoint_job_queue_attrs(0), x509_job_queue_attrs(0), m_pull_attrs(0), job_ad(0), schedd_addr(0), schedd_ver(0), cluster(-1), proc(-1), q_update_tid(-1) {}
|
|
|
b3fe293 |
+ QmgrJobUpdater( ) : common_job_queue_attrs(0), hold_job_queue_attrs(0), evict_job_queue_attrs(0), remove_job_queue_attrs(0), requeue_job_queue_attrs(0), terminate_job_queue_attrs(0), checkpoint_job_queue_attrs(0), x509_job_queue_attrs(0), m_pull_attrs(0), job_ad(0), schedd_addr(0), schedd_ver(0), cluster(-1), proc(-1), q_update_tid(-1), m_daemon(DT_SCHEDD, NULL) {}
|
|
|
b3fe293 |
virtual ~QmgrJobUpdater();
|
|
|
b3fe293 |
|
|
|
b3fe293 |
virtual void startUpdateTimer( void );
|
|
|
b3fe293 |
@@ -148,6 +148,8 @@ private:
|
|
|
b3fe293 |
int proc;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int q_update_tid;
|
|
|
b3fe293 |
+
|
|
|
b3fe293 |
+ Daemon m_daemon;
|
|
|
b3fe293 |
};
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// usefull if you don't want to update the job queue
|
|
|
b3fe293 |
diff --git a/src/condor_schedd.V6/qmgr_lib_support.cpp b/src/condor_schedd.V6/qmgr_lib_support.cpp
|
|
|
b3fe293 |
index 64bfffd..4afd1a6 100644
|
|
|
b3fe293 |
--- a/src/condor_schedd.V6/qmgr_lib_support.cpp
|
|
|
b3fe293 |
+++ b/src/condor_schedd.V6/qmgr_lib_support.cpp
|
|
|
b3fe293 |
@@ -34,8 +34,9 @@ ReliSock *qmgmt_sock = NULL;
|
|
|
b3fe293 |
static Qmgr_connection connection;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
Qmgr_connection *
|
|
|
b3fe293 |
-ConnectQ(const char *qmgr_location, int timeout, bool read_only, CondorError* errstack, const char *effective_owner, const char* schedd_version_str )
|
|
|
b3fe293 |
+ConnectQ(Daemon &d, int timeout, bool read_only, CondorError* errstack, const char *effective_owner, const char* schedd_version_str )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
+
|
|
|
b3fe293 |
int rval, ok;
|
|
|
b3fe293 |
int cmd = read_only ? QMGMT_READ_CMD : QMGMT_WRITE_CMD;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
@@ -54,15 +55,10 @@ ConnectQ(const char *qmgr_location, int timeout, bool read_only, CondorError* er
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// no connection active as of now; create a new one
|
|
|
b3fe293 |
- Daemon d( DT_SCHEDD, qmgr_location );
|
|
|
b3fe293 |
+ dprintf(D_HOSTNAME, "Hostname of new connection: %s\n", d.fullHostname());
|
|
|
b3fe293 |
if( ! d.locate() ) {
|
|
|
b3fe293 |
ok = FALSE;
|
|
|
b3fe293 |
- if( qmgr_location ) {
|
|
|
b3fe293 |
- dprintf( D_ALWAYS, "Can't find address of queue manager %s\n",
|
|
|
b3fe293 |
- qmgr_location );
|
|
|
b3fe293 |
- } else {
|
|
|
b3fe293 |
- dprintf( D_ALWAYS, "Can't find address of local queue manager\n" );
|
|
|
b3fe293 |
- }
|
|
|
b3fe293 |
+ dprintf( D_ALWAYS, "Can't find address of queue manager\n" );
|
|
|
b3fe293 |
} else {
|
|
|
b3fe293 |
// QMGMT_WRITE_CMD didn't exist before 7.5.0, so use QMGMT_READ_CMD
|
|
|
b3fe293 |
// when talking to older schedds
|
|
|
b3fe293 |
@@ -104,7 +100,7 @@ ConnectQ(const char *qmgr_location, int timeout, bool read_only, CondorError* er
|
|
|
b3fe293 |
// the connection, because this command is registered with
|
|
|
b3fe293 |
// force_authentication=true on the server side.
|
|
|
b3fe293 |
if( cmd == QMGMT_WRITE_CMD && !qmgmt_sock->triedAuthentication()) {
|
|
|
b3fe293 |
- if( !SecMan::authenticate_sock(qmgmt_sock, CLIENT_PERM, errstack_select ) )
|
|
|
b3fe293 |
+ if( !SecMan::authenticate_sock(qmgmt_sock, CLIENT_PERM, errstack_select, d.fullHostname()) )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
delete qmgmt_sock;
|
|
|
b3fe293 |
qmgmt_sock = NULL;
|
|
|
b3fe293 |
@@ -155,7 +151,7 @@ ConnectQ(const char *qmgr_location, int timeout, bool read_only, CondorError* er
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if ( !read_only ) {
|
|
|
b3fe293 |
- if (!SecMan::authenticate_sock(qmgmt_sock, CLIENT_PERM, errstack_select)) {
|
|
|
b3fe293 |
+ if (!SecMan::authenticate_sock(qmgmt_sock, CLIENT_PERM, errstack_select, d.fullHostname())) {
|
|
|
b3fe293 |
delete qmgmt_sock;
|
|
|
b3fe293 |
qmgmt_sock = NULL;
|
|
|
b3fe293 |
if (!errstack) {
|
|
|
b3fe293 |
diff --git a/src/condor_schedd.V6/schedd.cpp b/src/condor_schedd.V6/schedd.cpp
|
|
|
b3fe293 |
index b855407..6731e6c 100644
|
|
|
b3fe293 |
--- a/src/condor_schedd.V6/schedd.cpp
|
|
|
b3fe293 |
+++ b/src/condor_schedd.V6/schedd.cpp
|
|
|
b3fe293 |
@@ -3434,7 +3434,7 @@ Scheduler::spoolJobFiles(int mode, Stream* s)
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if( ! rsock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
// we failed to authenticate, we should bail out now
|
|
|
b3fe293 |
// since we don't know what user is trying to perform
|
|
|
b3fe293 |
// this action.
|
|
|
b3fe293 |
@@ -3690,7 +3690,7 @@ Scheduler::updateGSICred(int cmd, Stream* s)
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if( ! rsock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
// we failed to authenticate, we should bail out now
|
|
|
b3fe293 |
// since we don't know what user is trying to perform
|
|
|
b3fe293 |
// this action.
|
|
|
b3fe293 |
@@ -3901,7 +3901,7 @@ Scheduler::actOnJobs(int, Stream* s)
|
|
|
b3fe293 |
rsock->decode();
|
|
|
b3fe293 |
if( ! rsock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
// we failed to authenticate, we should bail out now
|
|
|
b3fe293 |
// since we don't know what user is trying to perform
|
|
|
b3fe293 |
// this action.
|
|
|
b3fe293 |
@@ -12104,7 +12104,7 @@ Scheduler::get_job_connect_info_handler_implementation(int, Stream* s) {
|
|
|
b3fe293 |
// force authentication
|
|
|
b3fe293 |
if( !sock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(sock, WRITE, &errstack) ||
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(sock, WRITE, &errstack, NULL) ||
|
|
|
b3fe293 |
! sock->getFullyQualifiedUser() )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
dprintf( D_ALWAYS,
|
|
|
b3fe293 |
@@ -13145,7 +13145,7 @@ Scheduler::claimLocalStartd()
|
|
|
b3fe293 |
CondorQuery query(STARTD_AD);
|
|
|
b3fe293 |
QueryResult q;
|
|
|
b3fe293 |
ClassAdList result;
|
|
|
b3fe293 |
- q = query.fetchAds(result, startd_addr, &errstack);
|
|
|
b3fe293 |
+ q = query.fetchAds(result, startd, &errstack);
|
|
|
b3fe293 |
if ( q != Q_OK ) {
|
|
|
b3fe293 |
dprintf(D_FULLDEBUG,
|
|
|
b3fe293 |
"ERROR: could not fetch ads from local startd : %s (%s)\n",
|
|
|
b3fe293 |
@@ -13654,7 +13654,7 @@ Scheduler::RecycleShadow(int /*cmd*/, Stream *stream)
|
|
|
b3fe293 |
sock->decode();
|
|
|
b3fe293 |
if( !sock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(sock, WRITE, &errstack) ||
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(sock, WRITE, &errstack, NULL) ||
|
|
|
b3fe293 |
! sock->getFullyQualifiedUser() )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
dprintf( D_ALWAYS,
|
|
|
b3fe293 |
@@ -13864,7 +13864,7 @@ Scheduler::clear_dirty_job_attrs_handler(int /*cmd*/, Stream *stream)
|
|
|
b3fe293 |
sock->decode();
|
|
|
b3fe293 |
if( !sock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(sock, WRITE, &errstack) ||
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(sock, WRITE, &errstack, NULL) ||
|
|
|
b3fe293 |
! sock->getFullyQualifiedUser() )
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
dprintf( D_ALWAYS,
|
|
|
b3fe293 |
diff --git a/src/condor_schedd.V6/schedd_td.cpp b/src/condor_schedd.V6/schedd_td.cpp
|
|
|
b3fe293 |
index 3e30f27..a9b0e4b 100644
|
|
|
b3fe293 |
--- a/src/condor_schedd.V6/schedd_td.cpp
|
|
|
b3fe293 |
+++ b/src/condor_schedd.V6/schedd_td.cpp
|
|
|
b3fe293 |
@@ -76,7 +76,7 @@ Scheduler::requestSandboxLocation(int mode, Stream* s)
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if( ! rsock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
// we failed to authenticate, we should bail out now
|
|
|
b3fe293 |
// since we don't know what user is trying to perform
|
|
|
b3fe293 |
// this action.
|
|
|
b3fe293 |
diff --git a/src/condor_schedd.V6/tdman.cpp b/src/condor_schedd.V6/tdman.cpp
|
|
|
b3fe293 |
index 53c6000..eb1e205 100644
|
|
|
b3fe293 |
--- a/src/condor_schedd.V6/tdman.cpp
|
|
|
b3fe293 |
+++ b/src/condor_schedd.V6/tdman.cpp
|
|
|
b3fe293 |
@@ -869,7 +869,7 @@ TDMan::transferd_registration(int cmd, Stream *sock)
|
|
|
b3fe293 |
///////////////////////////////////////////////////////////////
|
|
|
b3fe293 |
if( ! rsock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
// we failed to authenticate, we should bail out now
|
|
|
b3fe293 |
// since we don't know what user is trying to perform
|
|
|
b3fe293 |
// this action.
|
|
|
b3fe293 |
diff --git a/src/condor_status.V6/status.cpp b/src/condor_status.V6/status.cpp
|
|
|
b3fe293 |
index dea2c92..187e843 100644
|
|
|
b3fe293 |
--- a/src/condor_status.V6/status.cpp
|
|
|
b3fe293 |
+++ b/src/condor_status.V6/status.cpp
|
|
|
b3fe293 |
@@ -442,14 +442,19 @@ main (int argc, char *argv[])
|
|
|
b3fe293 |
// subsystem that corresponds to a daemon (above).
|
|
|
b3fe293 |
// Here 'addr' represents either the host:port of requested pool, or
|
|
|
b3fe293 |
// alternatively the host:port of daemon associated with requested subsystem (direct mode)
|
|
|
b3fe293 |
- q = query->fetchAds (result, addr, &errstack);
|
|
|
b3fe293 |
+
|
|
|
b3fe293 |
+ // If we are querying the same collector as before, reuse that object.
|
|
|
b3fe293 |
+ // This is important for hostname resolution.
|
|
|
b3fe293 |
+ if (!direct)
|
|
|
b3fe293 |
+ q = query->fetchAds (result, *pool, &errstack);
|
|
|
b3fe293 |
+ else
|
|
|
b3fe293 |
+ q = query->fetchAds (result, addr, &errstack);
|
|
|
b3fe293 |
} else {
|
|
|
b3fe293 |
// otherwise obtain list of collectors and submit query that way
|
|
|
b3fe293 |
CollectorList * collectors = CollectorList::create();
|
|
|
b3fe293 |
q = collectors->query (*query, result, &errstack);
|
|
|
b3fe293 |
delete collectors;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
-
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// if any error was encountered during the query, report it and exit
|
|
|
b3fe293 |
if (Q_OK != q) {
|
|
|
b3fe293 |
diff --git a/src/condor_submit.V6/submit.cpp b/src/condor_submit.V6/submit.cpp
|
|
|
b3fe293 |
index 76bbabf..f5e118b 100644
|
|
|
b3fe293 |
--- a/src/condor_submit.V6/submit.cpp
|
|
|
b3fe293 |
+++ b/src/condor_submit.V6/submit.cpp
|
|
|
b3fe293 |
@@ -6237,7 +6237,8 @@ connect_to_the_schedd()
|
|
|
b3fe293 |
setupAuthentication();
|
|
|
b3fe293 |
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ConnectQ(MySchedd->addr(), 0 /* default */, false /* default */, &errstack, NULL, MySchedd->version() ) == 0 ) {
|
|
|
b3fe293 |
+ ASSERT(MySchedd);
|
|
|
b3fe293 |
+ if( ConnectQ(*MySchedd, 0 /* default */, false /* default */, &errstack, NULL, MySchedd->version() ) == 0 ) {
|
|
|
b3fe293 |
if( ScheddName ) {
|
|
|
b3fe293 |
fprintf( stderr,
|
|
|
b3fe293 |
"\nERROR: Failed to connect to queue manager %s\n%s\n",
|
|
|
b3fe293 |
@@ -7202,7 +7203,8 @@ DoCleanup(int,int,const char*)
|
|
|
b3fe293 |
// DoCleanup(). This lead to infinite recursion which is bad.
|
|
|
b3fe293 |
ClusterCreated = 0;
|
|
|
b3fe293 |
if (!ActiveQueueConnection) {
|
|
|
b3fe293 |
- ActiveQueueConnection = (ConnectQ(MySchedd->addr()) != 0);
|
|
|
b3fe293 |
+ ASSERT( MySchedd );
|
|
|
b3fe293 |
+ ActiveQueueConnection = (ConnectQ(*MySchedd) != 0);
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
if (ActiveQueueConnection) {
|
|
|
b3fe293 |
// Call DestroyCluster() now in an attempt to get the schedd
|
|
|
b3fe293 |
diff --git a/src/condor_tools/preen.cpp b/src/condor_tools/preen.cpp
|
|
|
b3fe293 |
index 57fcd04..e2f9774 100644
|
|
|
b3fe293 |
--- a/src/condor_tools/preen.cpp
|
|
|
b3fe293 |
+++ b/src/condor_tools/preen.cpp
|
|
|
b3fe293 |
@@ -356,7 +356,8 @@ check_spool_dir()
|
|
|
b3fe293 |
well_known_list.append( ".pgpass" );
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// connect to the Q manager
|
|
|
b3fe293 |
- if (!(qmgr = ConnectQ (0))) {
|
|
|
b3fe293 |
+ Daemon d(DT_SCHEDD, 0);
|
|
|
b3fe293 |
+ if (!(qmgr = ConnectQ (d))) {
|
|
|
b3fe293 |
dprintf( D_ALWAYS, "Not cleaning spool directory: Can't contact schedd\n" );
|
|
|
b3fe293 |
return;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
diff --git a/src/condor_tools/qedit.cpp b/src/condor_tools/qedit.cpp
|
|
|
b3fe293 |
index e36d844..61d1b63 100644
|
|
|
b3fe293 |
--- a/src/condor_tools/qedit.cpp
|
|
|
b3fe293 |
+++ b/src/condor_tools/qedit.cpp
|
|
|
b3fe293 |
@@ -131,7 +131,7 @@ main(int argc, char *argv[])
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// Open job queue
|
|
|
b3fe293 |
- q = ConnectQ( schedd.addr(), 0, false, NULL, NULL, schedd.version() );
|
|
|
b3fe293 |
+ q = ConnectQ( schedd, 0, false, NULL, NULL, schedd.version() );
|
|
|
b3fe293 |
if( !q ) {
|
|
|
b3fe293 |
fprintf( stderr, "Failed to connect to queue manager %s\n",
|
|
|
b3fe293 |
schedd.addr() );
|
|
|
b3fe293 |
diff --git a/src/condor_tools/tool.cpp b/src/condor_tools/tool.cpp
|
|
|
b3fe293 |
index 5e63dc7..8b3ba37 100644
|
|
|
b3fe293 |
--- a/src/condor_tools/tool.cpp
|
|
|
b3fe293 |
+++ b/src/condor_tools/tool.cpp
|
|
|
b3fe293 |
@@ -1167,8 +1167,8 @@ resolveNames( DaemonList* daemon_list, StringList* name_list )
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- if (pool_addr) {
|
|
|
b3fe293 |
- q_result = query.fetchAds(ads, pool_addr, &errstack);
|
|
|
b3fe293 |
+ if (pool) {
|
|
|
b3fe293 |
+ q_result = query.fetchAds(ads, *pool, &errstack);
|
|
|
b3fe293 |
} else {
|
|
|
b3fe293 |
CollectorList * collectors = CollectorList::create();
|
|
|
b3fe293 |
q_result = collectors->query (query, ads);
|
|
|
b3fe293 |
diff --git a/src/condor_transferd/td_init.cpp b/src/condor_transferd/td_init.cpp
|
|
|
b3fe293 |
index 1fccebd..f2330e1 100644
|
|
|
b3fe293 |
--- a/src/condor_transferd/td_init.cpp
|
|
|
b3fe293 |
+++ b/src/condor_transferd/td_init.cpp
|
|
|
b3fe293 |
@@ -277,7 +277,7 @@ TransferD::setup_transfer_request_handler(int /*cmd*/, Stream *sock)
|
|
|
b3fe293 |
///////////////////////////////////////////////////////////////
|
|
|
b3fe293 |
if( ! rsock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
// we failed to authenticate, we should bail out now
|
|
|
b3fe293 |
// since we don't know what user is trying to perform
|
|
|
b3fe293 |
// this action.
|
|
|
b3fe293 |
diff --git a/src/condor_transferd/td_read_files.cpp b/src/condor_transferd/td_read_files.cpp
|
|
|
b3fe293 |
index a6c7f87..4febc43 100644
|
|
|
b3fe293 |
--- a/src/condor_transferd/td_read_files.cpp
|
|
|
b3fe293 |
+++ b/src/condor_transferd/td_read_files.cpp
|
|
|
b3fe293 |
@@ -67,7 +67,7 @@ TransferD::read_files_handler(int cmd, Stream *sock)
|
|
|
b3fe293 |
/////////////////////////////////////////////////////////////////////////
|
|
|
b3fe293 |
if( ! rsock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
// we failed to authenticate, we should bail out now
|
|
|
b3fe293 |
// since we don't know what user is trying to perform
|
|
|
b3fe293 |
// this action.
|
|
|
b3fe293 |
diff --git a/src/condor_transferd/td_write_files.cpp b/src/condor_transferd/td_write_files.cpp
|
|
|
b3fe293 |
index 412a552..572cc79 100644
|
|
|
b3fe293 |
--- a/src/condor_transferd/td_write_files.cpp
|
|
|
b3fe293 |
+++ b/src/condor_transferd/td_write_files.cpp
|
|
|
b3fe293 |
@@ -67,7 +67,7 @@ TransferD::write_files_handler(int cmd, Stream *sock)
|
|
|
b3fe293 |
/////////////////////////////////////////////////////////////////////////
|
|
|
b3fe293 |
if( ! rsock->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(rsock, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
// we failed to authenticate, we should bail out now
|
|
|
b3fe293 |
// since we don't know what user is trying to perform
|
|
|
b3fe293 |
// this action.
|
|
|
b3fe293 |
diff --git a/src/condor_utils/classad_command_util.cpp b/src/condor_utils/classad_command_util.cpp
|
|
|
b3fe293 |
index 56d7ddb..1ae11a8 100644
|
|
|
b3fe293 |
--- a/src/condor_utils/classad_command_util.cpp
|
|
|
b3fe293 |
+++ b/src/condor_utils/classad_command_util.cpp
|
|
|
b3fe293 |
@@ -92,7 +92,7 @@ getCmdFromReliSock( ReliSock* s, ClassAd* ad, bool force_auth )
|
|
|
b3fe293 |
s->decode();
|
|
|
b3fe293 |
if( force_auth && ! s->triedAuthentication() ) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- if( ! SecMan::authenticate_sock(s, WRITE, &errstack) ) {
|
|
|
b3fe293 |
+ if( ! SecMan::authenticate_sock(s, WRITE, &errstack, NULL) ) {
|
|
|
b3fe293 |
// we failed to authenticate, we should bail out now
|
|
|
b3fe293 |
// since we don't know what user is trying to perform
|
|
|
b3fe293 |
// this action.
|
|
|
b3fe293 |
diff --git a/src/condor_utils/condor_q.cpp b/src/condor_utils/condor_q.cpp
|
|
|
b3fe293 |
index 886b664..c540bbd 100644
|
|
|
b3fe293 |
--- a/src/condor_utils/condor_q.cpp
|
|
|
b3fe293 |
+++ b/src/condor_utils/condor_q.cpp
|
|
|
b3fe293 |
@@ -28,6 +28,7 @@
|
|
|
b3fe293 |
#include "CondorError.h"
|
|
|
b3fe293 |
#include "condor_classad.h"
|
|
|
b3fe293 |
#include "quill_enums.h"
|
|
|
b3fe293 |
+#include "daemon.h"
|
|
|
b3fe293 |
|
|
|
b3fe293 |
#ifdef HAVE_EXT_POSTGRESQL
|
|
|
b3fe293 |
#include "pgsqldatabase.h"
|
|
|
b3fe293 |
@@ -230,7 +231,8 @@ fetchQueue (ClassAdList &list, StringList &attrs, ClassAd *ad, CondorError* errs
|
|
|
b3fe293 |
if (ad == 0)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
// local case
|
|
|
b3fe293 |
- if( !(qmgr = ConnectQ( 0, connect_timeout, true, errstack)) ) {
|
|
|
b3fe293 |
+ Daemon d(DT_SCHEDD, 0, 0);
|
|
|
b3fe293 |
+ if( !(qmgr = ConnectQ( d, connect_timeout, true, errstack)) ) {
|
|
|
b3fe293 |
errstack->push("TEST", 0, "FOO");
|
|
|
b3fe293 |
return Q_SCHEDD_COMMUNICATION_ERROR;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
@@ -241,8 +243,9 @@ fetchQueue (ClassAdList &list, StringList &attrs, ClassAd *ad, CondorError* errs
|
|
|
b3fe293 |
// remote case to handle condor_globalq
|
|
|
b3fe293 |
if (!ad->LookupString (ATTR_SCHEDD_IP_ADDR, scheddString))
|
|
|
b3fe293 |
return Q_NO_SCHEDD_IP_ADDR;
|
|
|
b3fe293 |
+ Daemon d(ad, DT_SCHEDD, NULL);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
- if( !(qmgr = ConnectQ( scheddString, connect_timeout, true, errstack)) )
|
|
|
b3fe293 |
+ if( !(qmgr = ConnectQ( d, connect_timeout, true, errstack)) )
|
|
|
b3fe293 |
return Q_SCHEDD_COMMUNICATION_ERROR;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
@@ -255,7 +258,7 @@ fetchQueue (ClassAdList &list, StringList &attrs, ClassAd *ad, CondorError* errs
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int CondorQ::
|
|
|
b3fe293 |
-fetchQueueFromHost (ClassAdList &list, StringList &attrs, const char *host, char const *schedd_version, CondorError* errstack)
|
|
|
b3fe293 |
+fetchQueueFromDaemon (ClassAdList &list, StringList &attrs, Daemon &daemon, char const *schedd_version, CondorError* errstack)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
Qmgr_connection *qmgr;
|
|
|
b3fe293 |
ExprTree *tree;
|
|
|
b3fe293 |
@@ -276,7 +279,7 @@ fetchQueueFromHost (ClassAdList &list, StringList &attrs, const char *host, char
|
|
|
b3fe293 |
optimal. :^).
|
|
|
b3fe293 |
*/
|
|
|
b3fe293 |
init(); // needed to get default connect_timeout
|
|
|
b3fe293 |
- if( !(qmgr = ConnectQ( host, connect_timeout, true, errstack)) )
|
|
|
b3fe293 |
+ if( !(qmgr = ConnectQ( daemon, connect_timeout, true, errstack)) )
|
|
|
b3fe293 |
return Q_SCHEDD_COMMUNICATION_ERROR;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
bool useFastPath = false;
|
|
|
b3fe293 |
@@ -353,7 +356,7 @@ CondorQ::fetchQueueFromDB (ClassAdList &list,
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
int
|
|
|
b3fe293 |
-CondorQ::fetchQueueFromHostAndProcess ( const char *host,
|
|
|
b3fe293 |
+CondorQ::fetchQueueFromDaemonAndProcess ( Daemon &daemon,
|
|
|
b3fe293 |
StringList &attrs,
|
|
|
b3fe293 |
process_function process_func,
|
|
|
b3fe293 |
bool useFastPath,
|
|
|
b3fe293 |
@@ -378,7 +381,7 @@ CondorQ::fetchQueueFromHostAndProcess ( const char *host,
|
|
|
b3fe293 |
optimal. :^).
|
|
|
b3fe293 |
*/
|
|
|
b3fe293 |
init(); // needed to get default connect_timeout
|
|
|
b3fe293 |
- if( !(qmgr = ConnectQ( host, connect_timeout, true, errstack)) )
|
|
|
b3fe293 |
+ if( !(qmgr = ConnectQ( daemon, connect_timeout, true, errstack)) )
|
|
|
b3fe293 |
return Q_SCHEDD_COMMUNICATION_ERROR;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// get the ads and filter them
|
|
|
b3fe293 |
diff --git a/src/condor_utils/condor_q.h b/src/condor_utils/condor_q.h
|
|
|
b3fe293 |
index 7f6a620..ccd9196 100644
|
|
|
b3fe293 |
--- a/src/condor_utils/condor_q.h
|
|
|
b3fe293 |
+++ b/src/condor_utils/condor_q.h
|
|
|
b3fe293 |
@@ -23,6 +23,7 @@
|
|
|
b3fe293 |
#include "condor_common.h"
|
|
|
b3fe293 |
#include "generic_query.h"
|
|
|
b3fe293 |
#include "CondorError.h"
|
|
|
b3fe293 |
+#include "daemon.h"
|
|
|
b3fe293 |
|
|
|
b3fe293 |
#define MAXOWNERLEN 20
|
|
|
b3fe293 |
#define MAXSCHEDDLEN 255
|
|
|
b3fe293 |
@@ -90,8 +91,8 @@ class CondorQ
|
|
|
b3fe293 |
// which pass the criterion specified by the constraints; default is
|
|
|
b3fe293 |
// from the local schedd
|
|
|
b3fe293 |
int fetchQueue (ClassAdList &, StringList &attrs, ClassAd * = 0, CondorError* errstack = 0);
|
|
|
b3fe293 |
- int fetchQueueFromHost (ClassAdList &, StringList &attrs, const char * = 0, char const *schedd_version = 0,CondorError* errstack = 0);
|
|
|
b3fe293 |
- int fetchQueueFromHostAndProcess ( const char *, StringList &attrs, process_function process_func, bool useFastPath, CondorError* errstack = 0);
|
|
|
b3fe293 |
+ int fetchQueueFromDaemon (ClassAdList &, StringList &attrs, Daemon &, char const *schedd_version = 0,CondorError* errstack = 0);
|
|
|
b3fe293 |
+ int fetchQueueFromDaemonAndProcess ( Daemon &, StringList &attrs, process_function process_func, bool useFastPath, CondorError* errstack = 0);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// fetch the job ads from database
|
|
|
b3fe293 |
int fetchQueueFromDB (ClassAdList &, char *&lastUpdate, const char * = 0, CondorError* errstack = 0);
|
|
|
b3fe293 |
diff --git a/src/condor_utils/condor_query.cpp b/src/condor_utils/condor_query.cpp
|
|
|
b3fe293 |
index 95bc78a..acc6201 100644
|
|
|
b3fe293 |
--- a/src/condor_utils/condor_query.cpp
|
|
|
b3fe293 |
+++ b/src/condor_utils/condor_query.cpp
|
|
|
b3fe293 |
@@ -386,10 +386,6 @@ addORConstraint (const char *value)
|
|
|
b3fe293 |
QueryResult CondorQuery::
|
|
|
b3fe293 |
fetchAds (ClassAdList &adList, const char *poolName, CondorError* errstack)
|
|
|
b3fe293 |
{
|
|
|
b3fe293 |
- Sock* sock;
|
|
|
b3fe293 |
- int more;
|
|
|
b3fe293 |
- QueryResult result;
|
|
|
b3fe293 |
- ClassAd queryAd(extraAttrs), *ad;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if ( !poolName ) {
|
|
|
b3fe293 |
return Q_NO_COLLECTOR_HOST;
|
|
|
b3fe293 |
@@ -402,7 +398,16 @@ fetchAds (ClassAdList &adList, const char *poolName, CondorError* errstack)
|
|
|
b3fe293 |
return Q_NO_COLLECTOR_HOST;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
+ return fetchAds(adList, my_collector, errstack);
|
|
|
b3fe293 |
+}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
+QueryResult CondorQuery::
|
|
|
b3fe293 |
+fetchAds (ClassAdList &adList, Daemon &my_collector, CondorError* errstack)
|
|
|
b3fe293 |
+{
|
|
|
b3fe293 |
+ Sock* sock;
|
|
|
b3fe293 |
+ int more;
|
|
|
b3fe293 |
+ QueryResult result;
|
|
|
b3fe293 |
+ ClassAd queryAd(extraAttrs), *ad;
|
|
|
b3fe293 |
// make the query ad
|
|
|
b3fe293 |
result = getQueryAd (queryAd);
|
|
|
b3fe293 |
if (result != Q_OK) return result;
|
|
|
b3fe293 |
diff --git a/src/condor_utils/condor_query.h b/src/condor_utils/condor_query.h
|
|
|
b3fe293 |
index 7e58eef..9fedcad 100644
|
|
|
b3fe293 |
--- a/src/condor_utils/condor_query.h
|
|
|
b3fe293 |
+++ b/src/condor_utils/condor_query.h
|
|
|
b3fe293 |
@@ -156,6 +156,7 @@ class CondorQuery
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// fetch from collector
|
|
|
b3fe293 |
QueryResult fetchAds (ClassAdList &adList, const char * pool, CondorError* errstack = NULL);
|
|
|
b3fe293 |
+ QueryResult fetchAds (ClassAdList &adList, Daemon &daemon, CondorError* errstack = NULL);
|
|
|
b3fe293 |
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// filter list of ads; arg1 is 'in', arg2 is 'out'
|
|
|
b3fe293 |
diff --git a/src/condor_utils/ipv6_hostname.cpp b/src/condor_utils/ipv6_hostname.cpp
|
|
|
b3fe293 |
index cfefb4b..3666bd4 100644
|
|
|
b3fe293 |
--- a/src/condor_utils/ipv6_hostname.cpp
|
|
|
b3fe293 |
+++ b/src/condor_utils/ipv6_hostname.cpp
|
|
|
b3fe293 |
@@ -197,10 +197,13 @@ int get_fqdn_and_ip_from_hostname(const MyString& hostname,
|
|
|
b3fe293 |
MyString ret;
|
|
|
b3fe293 |
condor_sockaddr ret_addr;
|
|
|
b3fe293 |
bool found_ip = false;
|
|
|
b3fe293 |
+ bool use_given_name = false;
|
|
|
b3fe293 |
|
|
|
b3fe293 |
// if the hostname contains dot, hostname is assumed to be full hostname
|
|
|
b3fe293 |
if (hostname.FindChar('.') != -1) {
|
|
|
b3fe293 |
ret = hostname;
|
|
|
b3fe293 |
+ fqdn = hostname;
|
|
|
b3fe293 |
+ use_given_name = true;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
|
|
|
b3fe293 |
if (nodns_enabled()) {
|
|
|
b3fe293 |
@@ -219,7 +222,9 @@ int get_fqdn_and_ip_from_hostname(const MyString& hostname,
|
|
|
b3fe293 |
|
|
|
b3fe293 |
while (addrinfo* info = ai.next()) {
|
|
|
b3fe293 |
if (info->ai_canonname) {
|
|
|
b3fe293 |
- fqdn = info->ai_canonname;
|
|
|
b3fe293 |
+ dprintf(D_HOSTNAME, "Found canon addr: %s\n", info->ai_canonname);
|
|
|
b3fe293 |
+ if (!use_given_name)
|
|
|
b3fe293 |
+ fqdn = info->ai_canonname;
|
|
|
b3fe293 |
addr = condor_sockaddr(info->ai_addr);
|
|
|
b3fe293 |
return 1;
|
|
|
b3fe293 |
}
|
|
|
b3fe293 |
diff --git a/src/condor_who/who.cpp b/src/condor_who/who.cpp
|
|
|
b3fe293 |
index 08f19b6..870668a 100644
|
|
|
b3fe293 |
--- a/src/condor_who/who.cpp
|
|
|
b3fe293 |
+++ b/src/condor_who/who.cpp
|
|
|
b3fe293 |
@@ -681,7 +681,7 @@ main( int argc, char *argv[] )
|
|
|
b3fe293 |
ClassAdList result;
|
|
|
b3fe293 |
if (addr || App.diagnostic) {
|
|
|
b3fe293 |
CondorError errstack;
|
|
|
b3fe293 |
- QueryResult qr = query->fetchAds (result, addr, &errstack);
|
|
|
b3fe293 |
+ QueryResult qr = dae->locate() ? query->fetchAds (result, *dae, &errstack) : query->fetchAds (result, addr, &errstack);
|
|
|
b3fe293 |
if (Q_OK != qr) {
|
|
|
b3fe293 |
fprintf( stderr, "Error: %s\n", getStrQueryResult(qr) );
|
|
|
b3fe293 |
fprintf( stderr, "%s\n", errstack.getFullText(true) );
|