Skip to content

Commit

Permalink
upload some images
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Aug 6, 2013
1 parent d17a1f1 commit a730fa9
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 48 deletions.
Binary file added images/zuluCrypt.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zuluCrypt1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zuluCrypt2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zuluCrypt3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zuluCrypt4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zuluMount.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zuluMount1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zuluMount2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zuluMount3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zuluMount4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions zuluCrypt-cli/bin/open_volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ static int _open_tcrypt( const char * device,const char * mapper_name,const char
static char * _device_path( const char * device )
{
char * path ;
string_t p ;

if( StringPrefixEqual( device,"/dev/loop" ) ){
zuluCryptSecurityGainElevatedPrivileges() ;
Expand All @@ -40,14 +39,12 @@ static char * _device_path( const char * device )
path = zuluCryptLoopDeviceAddress_1( device ) ;
zuluCryptSecurityDropElevatedPrivileges() ;
if( path == NULL ){
p = String( device ) ;
return StringDeleteHandle( &p ) ;
return StringCopy_2( device ) ;
}else{
return path ;
}
}else{
p = String( device ) ;
return StringDeleteHandle( &p ) ;
return StringCopy_2( device ) ;
}
}

Expand Down
29 changes: 13 additions & 16 deletions zuluCrypt-cli/lib/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,39 +186,36 @@ static void zuluCryptFileSystemProperties( string_t p,const char * mapper,const
char * zuluCryptGetVolumeTypeFromMapperPath( const char * mapper )
{
struct crypt_device * cd;
const char * type ;
string_t volType ;
char * type ;
char * r ;
const char * nil = "Nil" ;

type = crypt_get_dir() ;

if( !StringPrefixEqual( mapper,type ) ){
volType = String( "Nil" ) ;
return StringDeleteHandle( &volType ) ;
if( !StringPrefixEqual( mapper,crypt_get_dir() ) ){
return StringCopy_2( nil ) ;
}

if( crypt_init_by_name( &cd,mapper ) < 0 ){
volType = String( "Nil" ) ;
return StringDeleteHandle( &volType ) ;
return StringCopy_2( nil ) ;
}

type = crypt_get_type( cd ) ;

if( type == NULL ){
volType = String( "Nil" ) ;
r = StringCopy_2( nil ) ;
}else{
if( StringHasComponent( type,"LUKS" ) ){
volType = String( "crypto_LUKS" ) ;
r = StringCopy_2( "crypto_LUKS" ) ;
}else if( StringHasComponent( type,"PLAIN" ) ){
volType = String( "crypto_PLAIN" ) ;
r = StringCopy_2( "crypto_PLAIN" ) ;
}else if( StringHasComponent( type,"TCRYPT" ) ){
volType = String( "crypto_TCRYPT" ) ;
r = StringCopy_2( "crypto_TCRYPT" ) ;
}else{
volType = String( "Nil" ) ;
r = StringCopy_2( nil ) ;
}
}

crypt_free( cd ) ;
return StringDeleteHandle( &volType ) ;
return r ;
}

string_t zuluCryptConvertIfPathIsLVM( const char * path )
Expand Down
60 changes: 43 additions & 17 deletions zuluCrypt-cli/utility/string/String.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,34 +572,60 @@ const char ** StringPointer( string_t st )
}
}

char * StringCopyChar( string_t st )
char * StringCopy_1( string_t st )
{
if( st == StringVoid ){
return NULL ;
}else{
return StringLengthCopy( st,st->size ) ;
return StringCopy_3( st,st->size ) ;
}
}

char * StringLengthCopy( string_t st,size_t l )
char * StringCopy_2( const char * str )
{
char * c ;

if( st == StringVoid ){
return NULL ;
size_t len ;
if( str == NULL ){
c = ( char * )malloc( sizeof( char ) ) ;
if( c == NULL ){
return ( char * ) _StringError() ;
}else{
c[ 0 ] = '\0' ;
return c ;
}
}else{
len = strlen( str ) ;
c = ( char * )malloc( sizeof( char ) * ( len + 1 ) ) ;
if( c == NULL ){
return ( char * ) _StringError() ;
}else{
memcpy( c,str,len + 1 ) ;
return c ;
}
}

c = ( char * )malloc( sizeof( char ) * ( l + 1 ) ) ;

if( c == NULL ){
return ( char * ) _StringError() ;
}

char * StringCopy_3( string_t st,size_t l )
{
char * c ;
if( st == StringVoid ){
c = ( char * )malloc( sizeof( char ) ) ;
if( c == NULL ){
return ( char * ) _StringError() ;
}else{
c[ 0 ] = '\0' ;
return c ;
}
}else{
c = ( char * )malloc( sizeof( char ) * ( l + 1 ) ) ;
if( c == NULL ){
return ( char * ) _StringError() ;
}else{
memcpy( c,st->string,l ) ;
*( c + l ) = '\0' ;
return c ;
}
}

strncpy( c,st->string,l ) ;

*( c + l ) = '\0' ;

return c ;
}

int StringEndsWith( string_t st,const char * s )
Expand Down
24 changes: 14 additions & 10 deletions zuluCrypt-cli/utility/string/String.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,27 @@ void StringPrintLine( string_t st ) ;
* Remember to free it when you are done using it.
* NULL is returned when the copy can not be made.
*/
char * StringCopyChar( string_t st ) ;
char * StringCopy_1( string_t st ) ;

/*
* Make a copy of string_t st
* return NULL on error.
*/
string_t StringCopy( string_t st ) ;

/*
* returns a copy of a string.
* remember to free() it when done with it
*/
char * StringCopy_2( const char * ) ;

/*
* Returns an editable copy of a string made up of upto x characters
* Remember to free string when you are done with it.
* returns NULL on error. *
*/
char * StringCopy_3( string_t st,size_t x ) ;

/*
* Write "size" amount of content of a string handled by "st" to a buffer pointed by "buffer" *
*/
Expand Down Expand Up @@ -460,15 +473,6 @@ void StringReset( string_t st ) ;
*/
const char * StringRemoveLeft( string_t st,size_t x ) ;


/*
* Returns an editable copy of a string made up of upto x characters
* Remember to free string when you are done with it.
* returns NULL on error. *
*/
char * StringLengthCopy( string_t st,size_t x ) ;


/*
* Return a sub string starting at position x and made up of y characters
*
Expand Down

0 comments on commit a730fa9

Please sign in to comment.