void CAuthHelperTest::TestLocalLogin_AsLocalUser()
{
	QSKIP (" Not implemented: invalid implemented method createSimpleProcessAsUser() ", SkipAll);

	if ( !isWinOs() )
		QSKIP( "skipped on unix" , SkipSingle );

	UserInfo localUser = getLocalUser();
	QVERIFY ( isLocalUserName( localUser.name ) );

	CAuthHelper localAuth( localUser.name );
	QVERIFY( localAuth.AuthUser( localUser.password ) );

	Q_PID pid = createSimpleProcessAsUser ( localAuth );

	QVERIFY ( pid != 0 );

	UserInfo user = getLocalUser();
	QVERIFY ( isLocalUserName( user.name ) );

	CAuthHelper auth;
#	ifdef _WIN_
		QVERIFY ( auth.AuthUser( pid->dwProcessId ) );
#	endif

	QCOMPARE( auth.getUserName()		, user.name );
	QCOMPARE( auth.getUserDomain()	, getLocalDomain() );
}
Esempio n. 2
0
char *
Condor_Auth_Passwd::fetchLogin()
{
	// return malloc-ed string "user@domain" that represents who we are.

	MyString login;
	
		// decide the login name we will try to authenticate with.  
	if ( is_root() ) {
		login.formatstr("%s@%s",POOL_PASSWORD_USERNAME,getLocalDomain());
	} else {
		// for now, always use the POOL_PASSWORD_USERNAME.  at some
		// point this code should call my_username() my_domainname().
		login.formatstr("%s@%s",POOL_PASSWORD_USERNAME,getLocalDomain());
	}

	return strdup( login.Value() );
}
Esempio n. 3
0
/*******************  FUNCTION  *********************/
CMRSpaceSubDomains CMRBasicSpaceSplitter::getAllSubDomains ( void ) const
{
	//vars
	CMRSpaceSubDomains res;

	//loop on all
	for (int i = 0 ; i < this->nbSubDomains ; i++)
	{
		res.push_back(getLocalDomain(i));
	}
	
	//return it
	return res;
}
QString CAuthHelperTest::getCurrentDomain()
{
	QString domain;
#ifdef _WIN_
	if ( !CAuth::getCurrentDomain( domain ) )
		WRITE_TRACE(DBG_FATAL, "ERROR!!!: CAuth::getCurrentDomain() return false" );
	else
#endif
	if ( domain.isEmpty() )
		domain = getLocalDomain();
	else
		domain = domain.toLower(); //normalize

	return domain;
}
void CAuthHelperTest::TestRemoteLogin_AsLocalUser()
{
	if ( !isWinOs() )
		QSKIP( "skipped on unix" , SkipSingle );

	UserInfo user = getLocalUser();

	CAuthHelper auth( user.name );

	QVERIFY( isLocalUserName( user.name ) );

	QVERIFY ( auth.AuthUser( user.password ) );

	QCOMPARE( auth.getUserName()		, user.name );
	QCOMPARE( auth.getUserDomain()	, getLocalDomain() );
}
Esempio n. 6
0
/*******************  FUNCTION  *********************/
void CMRAbstractSpaceSplitter::printDebug ( int printOnRank  ) const
{
	//nothing to do
	if (printOnRank != CMR_MPI_ALL && printOnRank != cmrGetMPIRank())
		return;
	
	//get splitting
	CMRVect2D splitting = getSplittingSize();
	
	debug("Domain splitting of [ %4d , %4d : %4d x %4d ] into ( %d x %d ) :",rect.x,rect.y,rect.width,rect.height,splitting.x,splitting.y);
	//loop on all
	for (int i = 0 ; i < this->nbSubDomains ; i++)
	{
		CMRRect tmp = getLocalDomain(i);
		debug("   - Subdomain %-2d : [ %4d , %4d : %4d x %4d ]",i, tmp.x,tmp.y,tmp.width, tmp.height);
	}
}
bool CAuthHelperTest::isHostInWindowsDomain()
{
	return isWinOs() && getCurrentDomain() != getLocalDomain();
}