Пример #1
0
static int mount_FUSEfs_0( m_struct * mst )
{
	int status ;
	const char * opts ;

	process_t p = Process( ZULUCRYPTmount ) ;
	string_t st = set_mount_options( mst ) ;

	opts = _mount_options( mst->m_flags,st ) ;

	if( StringsAreEqual( mst->fs,"ntfs" ) ){
		if( StringHasComponent( opts,"ignore_case" ) ){
			ProcessSetArgumentList( p,"-n","-t","lowntfs-3g","-o",opts,mst->device,mst->m_point,ENDLIST ) ;
		}else{
			ProcessSetArgumentList( p,"-n","-t","ntfs-3g","-o",opts,mst->device,mst->m_point,ENDLIST ) ;
		}
	}else{
		ProcessSetArgumentList( p,"-t",mst->fs,"-o",opts,mst->device,mst->m_point,ENDLIST ) ;
	}

	ProcessStart( p ) ;

	status = ProcessExitStatus( p ) ;

	ProcessDelete( &p ) ;
	StringDelete( &st ) ;

	return status ;
}
Пример #2
0
void openVolume( const char * device,const char * msg,const char * keysource )
{
	process_t p ;
	__print( msg ) ;
	p = Process( zuluCryptExe ) ;
	if( strcmp( keysource,"-p" ) == 0 ){
		ProcessSetArgumentList( p,"-o","-d",device,"-m",mount_point,keysource,key,ENDLIST ) ;
	}else{
		ProcessSetArgumentList( p,"-o","-d",device,"-m",mount_point,keysource,keyfile,ENDLIST ) ;
	}
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
}
Пример #3
0
void createVolume( const char * device,const char * msg,const char * keysource,const char * type )
{
	process_t p ;
	__print( msg ) ;
	p = Process( zuluCryptExe ) ;
	if( strcmp( keysource,"-p" ) == 0 ){
		ProcessSetArgumentList( p,"-c","-k","-d",device,"-t",type,keysource,key,ENDLIST ) ;
	}else{
		ProcessSetArgumentList( p,"-c","-k","-d",device,"-t",type,keysource,keyfile,ENDLIST ) ;
	}
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
}
Пример #4
0
void removeKeysFromLuksVolume( const char * device )
{
	process_t p ;
	__print( "remove a key from a luks volume using a key: " ) ;
	p = Process( zuluCryptExe ) ;
	ProcessSetArgumentList( p,"-r","-d",device,"-p",key,ENDLIST ) ;
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
	
	__print( "remove a key from a luks volume using a keyfile: " ) ;
	p = Process( zuluCryptExe ) ;
	ProcessSetArgumentList( p,"-r","-d",device,"-f",keyfile,ENDLIST ) ;
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
}
Пример #5
0
void openVolumeWithPlugIn( const char * device,const char * msg )
{
	process_t p ;
	__print( msg ) ;
	p = Process( zuluCryptExe ) ;
	ProcessSetArgumentList( p,"-o","-d",device,"-m",mount_point,"-G",pluginPath,ENDLIST ) ;
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
}
Пример #6
0
void checkKeySlotsInUse( const char * device )
{
	process_t p ;
	__print( "check key slots in use: " ) ;
	p = Process( zuluCryptExe ) ;
	ProcessSetArgumentList( p,"-b","-d",device,ENDLIST ) ;
	ProcessStart( p ) ;
	__ProcessGetResultANDPrint( p ) ;
}
Пример #7
0
void closeVolume( const char * device,const char * msg )
{	
	process_t p ;
	__print( msg ) ;
	p = Process( zuluCryptExe ) ;
	ProcessSetArgumentList( p,"-q","-d",device,ENDLIST ) ;
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
}
Пример #8
0
void restoreHeaderBackup( const char * device,const char * msg )
{
	process_t p ;
	__print( msg ) ;
	p = Process( zuluCryptExe ) ;
	ProcessSetArgumentList( p,"-R","-k","-d",device,"-f",headerBackUp,ENDLIST ) ;
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
}
Пример #9
0
void checkIfDeviceIsLuks( const char * device )
{
	int st ;
	process_t p = Process( zuluCryptExe ) ;
	ProcessSetArgumentList( p,"-i","-d",device,ENDLIST ) ;
	ProcessStart( p ) ;
	st = ProcessExitStatus( p ) ;
	ProcessDelete( &p ) ;
	
	if( st ){
		__print( "check if a luks volume is a luks volume: PASSED\n" ) ;
	}
}
Пример #10
0
void addKeysToLuks( const char * device )
{
	process_t p ;
	
	__print( "add a key to a luks volume using a key and a key: " ) ;
	
	p = Process( zuluCryptExe ) ;
	
	ProcessSetArgumentList( p,"-a","-d",device,"-y",key,"-l",key1,ENDLIST ) ;
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
	
	__print( "add key to luks volume using keyfile and keyfile: " ) ;
	
	p = Process( zuluCryptExe ) ;
	
	ProcessSetArgumentList( p,"-a","-d",device,"-u",keyfile,"-n",keyfile1,ENDLIST ) ;
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
	
	__print( "add key to luks volume using passphrase and keyfile: " ) ;
	
	p = Process( zuluCryptExe ) ;
	
	ProcessSetArgumentList( p,"-a","-d",device,"-y",key,"-n",keyfile,ENDLIST ) ;
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
	
	__print( "add key to luks volume using keyfile and passphrase: " ) ;
	
	p = Process( zuluCryptExe ) ;
	
	ProcessSetArgumentList( p,"-a","-d",device,"-u",keyfile1,"-l",key1,ENDLIST ) ;
	ProcessStart( p ) ;
	__ProcessGetResult( p ) ;
}
Пример #11
0
int zuluCryptCreateFileSystemInAVolume( const char * fs,const char * device_mapper )
{
	int status ;
	char * e = NULL ;
	
	process_t p = Process( ZULUCRYPTmkfs ) ;
	
	if( StringAtLeastOneMatch_1( fs,"ext2","ext3","ext4",NULL ) ){
		
		ProcessSetArgumentList( p,"-t",fs,"-m","1",device_mapper,ENDLIST ) ;
		
	}else if( StringsAreEqual( fs,"reiserfs" ) ){
		
		ProcessSetArgumentList( p,"-t",fs,"-f","-f","-q",device_mapper,ENDLIST ) ;
		
	}else if( StringsAreEqual( fs,"jfs" ) ){
		
		ProcessSetArgumentList( p,"-t",fs,"-q",device_mapper,ENDLIST ) ;
		
	}else if( StringsAreEqual( fs,"ntfs" ) ){
		
		ProcessSetArgumentList( p,"-t",fs,"-f",device_mapper,ENDLIST ) ;
		
	}else if( StringsAreEqual( fs,"xfs" ) ){
		
		ProcessSetArgumentList( p,"-t",fs,"-f",device_mapper,ENDLIST ) ;
		
	}else{
		ProcessSetArgumentList( p,"-t",fs,device_mapper,ENDLIST ) ;
		
		/*
		 * unhandled fs are processed here.They are given 60 seconds to accomplish their task
		 * and are assumed to be running in interactive more and are blocked waiting for user input
		 * when they fail to return in time and hence are killed since we cant get to them from GUI 
		 */
		
		ProcessSetOptionTimeout( p,60,SIGKILL ) ;
	}
	
	ProcessStart( p ) ;
	
	status = ProcessExitStatus( p ) ;
	
	if( status ){
		ProcessGetOutPut( p,&e,STDERROR ) ;
		if( e ){
			puts( e ) ;
			free( e ) ;
		}
	}
	
	ProcessDelete( &p ) ;
	return status ;
}