zuluCrypt  5.7.1
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.
  Fossies Dox: zuluCrypt-5.7.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

volume_info.c
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2011-2015
4  * name : Francis Banyikwa
5  * email: mhogomchungu@gmail.com
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #include "includes.h"
21 #include <stdio.h>
22 #include <libintl.h>
23 
24 int zuluMountPrintBitLockerProperties( const char * device,uid_t uid ) ;
25 
26 int zuluCryptEXEVolumeInfo( const char * mapper,const char * device,uid_t uid )
27 {
28  char * output ;
29  int xt = 2 ;
30 
31  string_t p ;
32 
34 
36  && zuluCryptDeviceManagedByDislocker( device,uid ) ){
37 
38  xt = zuluMountPrintBitLockerProperties( device,uid ) ;
39  }else{
40  /*
41  * ZULUCRYPTlongMapperPath is set in ../constants.h
42  * zuluCryptCreateMapperName() is defined at ../lib/create_mapper_name.c
43  */
44  p = zuluCryptCreateMapperName( device,mapper,uid,ZULUCRYPTlongMapperPath ) ;
45 
46  /*
47  *zuluCryptVolumeStatus() is defined in ../lib/status.c
48  */
49  output = zuluCryptVolumeStatus( StringContent( p ) ) ;
50 
51  if( output != NULL ){
52 
53  printf( "%s\n",output ) ;
54  StringFree( output ) ;
55  xt = 0 ;
56  }else{
57  printf( gettext( "ERROR: Could not get volume properties,volume is not open or was opened by a different user\n" ) ) ;
58  xt = 2 ;
59  }
60 
61  StringDelete( &p ) ;
62  }
63 
65 
66  return xt ;
67 }
zuluCryptVolumeStatus
char * zuluCryptVolumeStatus(const char *mapper)
Definition: status.c:849
zuluCryptCreateMapperName
string_t zuluCryptCreateMapperName(const char *device, const char *mapping_name, uid_t uid, int i)
Definition: create_mapper_name.c:42
StringContent
static const __inline__ char * StringContent(string_t st)
Definition: String.h:1011
StringType
Definition: String.c:49
zuluCryptEXEVolumeInfo
int zuluCryptEXEVolumeInfo(const char *mapper, const char *device, uid_t uid)
Definition: volume_info.c:26
zuluCryptSecurityDropElevatedPrivileges
int zuluCryptSecurityDropElevatedPrivileges(void)
Definition: security.c:109
zuluCryptSecurityGainElevatedPrivileges
int zuluCryptSecurityGainElevatedPrivileges(void)
Definition: security.c:64
zuluCryptBitLockerType
const char * zuluCryptBitLockerType()
Definition: bitlocker.c:36
StringDelete
void StringDelete(string_t *st)
Definition: String.c:162
zuluCryptDeviceHasAgivenFileSystem
int zuluCryptDeviceHasAgivenFileSystem(const char *device, const char *fs)
Definition: blkid_evaluate_tag.c:176
zuluCryptDeviceManagedByDislocker
int zuluCryptDeviceManagedByDislocker(const char *dev, uid_t uid)
Definition: bitlocker.c:141
zuluMountPrintBitLockerProperties
int zuluMountPrintBitLockerProperties(const char *device, uid_t uid)
Definition: volume_status.c:973
includes.h
ZULUCRYPTlongMapperPath
#define ZULUCRYPTlongMapperPath
Definition: constants.h:36
StringFree
static __inline__ void StringFree(const void *str)
Definition: String.h:823