"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zuluCrypt-cli/bin/clear_dead_mappers.c" between
zuluCrypt-5.7.0.tar.xz and zuluCrypt-5.7.1.tar.xz

About: zuluCrypt is a simple but feature rich solution for hard drives encryption. It can manage PLAIN dm-crypt, LUKS, TrueCrypt and VeraCrypt encrypted volumes.

clear_dead_mappers.c  (zuluCrypt-5.7.0.tar.xz):clear_dead_mappers.c  (zuluCrypt-5.7.1.tar.xz)
skipping to change at line 108 skipping to change at line 108
} }
StringDelete( &xt ) ; StringDelete( &xt ) ;
} }
StringDelete( &st ) ; StringDelete( &st ) ;
} }
} }
} }
static void _unmount_dead_mount_points( uid_t uid )
{
if( uid ){}
#if 0
stringList_t stl = zuluCryptPartitions( ZULUCRYPTallPartitions,uid ) ;
stringList_t stx = zuluCryptGetAListOfMountedVolumes() ;
StringListIterator it ;
StringListIterator end ;
string_t st ;
char * mout_point = NULL ;
char * m_point = NULL ;
const char * device ;
StringListGetIterators( stl,&it,&end ) ;
while( it != end ){
st = *it ;
it++ ;
StringListRemoveIfPresent_1( stx,st ) ;
}
StringListGetIterators( stx,&it,&end ) ;
while( it != end ){
st = *it ;
it++ ;
if( StringStartsWith( st,"/dev/" ) ){
device = StringContent( st ) ;
mout_point = zuluCryptGetMountPointFromPath( device ) ;
printf( "unmounting : %s\n",device ) ;
if( zuluCryptUnmountVolume( device,&m_point ) == 0 ){
if( m_point ){
rmdir( m_point ) ;
printf( "unmounted : %s:%s\n",device,m_po
int ) ;
}
}else{
perror( "failed" ) ;
}
}
}
StringFree( mout_point ) ;
StringFree( m_point ) ;
#endif
}
void zuluCryptDeleteDeadMountPoints( uid_t uid,stringList_t stl ) void zuluCryptDeleteDeadMountPoints( uid_t uid,stringList_t stl )
{ {
string_t st = zuluCryptGetUserName( uid ) ; string_t st = zuluCryptGetUserName( uid ) ;
_zuluCryptDeleteDeadMountPoints( stl,StringPrepend( st,"/run/media/privat e/" ) ) ; _zuluCryptDeleteDeadMountPoints( stl,StringPrepend( st,"/run/media/privat e/" ) ) ;
_zuluCryptDeleteDeadMountPoints( stl,"/run/media/public" ) ; _zuluCryptDeleteDeadMountPoints( stl,"/run/media/public" ) ;
_unmount_dead_mount_points( uid ) ;
StringDelete( &st ) ; StringDelete( &st ) ;
} }
void zuluCryptClearDeadMappers( uid_t uid,int s ) void zuluCryptClearDeadMappers( uid_t uid,int s )
{ {
struct crypt_device * cd ; struct crypt_device * cd ;
const char * dir_path = crypt_get_dir() ; const char * dir_path = crypt_get_dir() ;
DIR * dir = opendir( dir_path ) ; DIR * dir = opendir( dir_path ) ;
struct dirent * entry ; struct dirent * entry ;
const char * m ; const char * m ;
skipping to change at line 167 skipping to change at line 233
while( ( entry = readdir( dir ) ) != NULL ){ while( ( entry = readdir( dir ) ) != NULL ){
if( StringPrefixMatch( entry->d_name,m,len ) ){ if( StringPrefixMatch( entry->d_name,m,len ) ){
e = StringAppendAt( z,len1,entry->d_name ) ; e = StringAppendAt( z,len1,entry->d_name ) ;
/* /*
* zuluCryptTrueCryptOrVeraCryptVolume() is defined in .. /lib/status.c * zuluCryptTrueCryptOrVeraCryptVolume() is defined in .. /lib/status.c
*/ */
if( zuluCryptTrueCryptOrVeraCryptVolume( e ) ){ if( zuluCryptVolumeManagedByTcplay( e ) ){
/* /*
* zuluCryptVolumeDeviceName() is defined in ../l ib/status.c * zuluCryptVolumeDeviceName() is defined in ../l ib/status.c
*/ */
r = zuluCryptVolumeDeviceName( e ) ; r = zuluCryptVolumeDeviceName( e ) ;
if( *( r + 0 ) != '/' ){ if( *( r + 0 ) != '/' ){
/* /*
* tcplay seems to report device name as something like "8:33" * tcplay seems to report device name as something like "8:33"
 End of changes. 3 change blocks. 
1 lines changed or deleted 68 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)