"Fossies" - the Fresh Open Source Software Archive

Member "zuluCrypt-5.7.1/zuluCrypt-cli/bin/volume_info.c" (15 Jan 2020, 1942 Bytes) of package /linux/misc/zuluCrypt-5.7.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "volume_info.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.7.0_vs_5.7.1.

    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 
   33     zuluCryptSecurityGainElevatedPrivileges() ;
   34 
   35     if( zuluCryptDeviceHasAgivenFileSystem( device,zuluCryptBitLockerType() )
   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 
   64     zuluCryptSecurityDropElevatedPrivileges() ;
   65 
   66     return xt ;
   67 }