"Fossies" - the Fresh Open Source Software Archive

Member "zuluCrypt-5.7.1/zuluCrypt-cli/bin/libzuluCrypt-exe.h" (15 Jan 2020, 6315 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 "libzuluCrypt-exe.h" 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   *  Copyright (c) 2011-2015
    3   *  name : Francis Banyikwa
    4   *  email: mhogomchungu@gmail.com
    5   *  This program is free software: you can redistribute it and/or modify
    6   *  it under the terms of the GNU General Public License as published by
    7   *  the Free Software Foundation, either version 2 of the License, or
    8   *  (at your option) any later version.
    9   *
   10   *  This program is distributed in the hope that it will be useful,
   11   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   12   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13   *  GNU General Public License for more details.
   14   *
   15   *  You should have received a copy of the GNU General Public License
   16   *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
   17   */
   18 
   19 
   20 #ifndef ZULUCRYPTEXE
   21 #define ZULUCRYPTEXE
   22 
   23 #ifdef __cplusplus
   24 extern "C" {
   25 #endif
   26 
   27 #include <sys/types.h>
   28 
   29 #define TRUECRYPT_MAX_KEYFILES 16
   30 
   31 /*
   32  * this structure holds command line arguments. *
   33  * It is instantiated in main.c *
   34  */
   35 typedef struct struct_opts_1{
   36     const char * plugin_path ;
   37     const char * device ;
   38     const char * mount_point ;
   39     const char * m_opts ;
   40     const char * fs_opts ;
   41     const char * key_source ;
   42     const char * key ;
   43     const char * fs ;
   44     const char * type ;
   45     const char * rng ;
   46     const char * existing_key_source ;
   47     const char * existing_key ;
   48     const char * new_key ;
   49     const char * new_key_source ;
   50     const char * argv ;
   51     const char * tcrypt_hidden_volume_size ;
   52     const char * tcrypt_hidden_volume_key ;
   53     const char * tcrypt_hidden_volume_multiple_keyfiles[ TRUECRYPT_MAX_KEYFILES + 1 ] ;
   54     const char * tcrypt_multiple_keyfiles[ TRUECRYPT_MAX_KEYFILES + 1 ] ;
   55     const char * back_up_file_path ;
   56     const char * offset ;
   57     const char * uid ;
   58     const char * luks_external_header ;
   59     char * const * env ;
   60     char action ;
   61     int partition_number ;
   62     int ask_confirmation ;
   63     int open_mount ;
   64     int mount_point_option ;
   65     int print_partition_type ;
   66     int share ;
   67     int use_cryptsetup_for_bitlocker ;
   68 }struct_opts;
   69 
   70 /*
   71  * this function is defined in security.c
   72  */
   73 void zuluCryptExeSetOriginalUID( uid_t s ) ;
   74 
   75 /*
   76  * this function is defined in security.c
   77  */
   78 int zuluCryptExeOriginalUserIsNotRoot() ;
   79 
   80 /*
   81  * get command line arguments and in struct_opts structure to be used in various calls *
   82  */
   83 void zuluCryptEXEGetOpts( int argc,char * argv[],struct_opts * ) ;
   84 
   85 /*
   86  * this function is responsibe for creating and restoring luks header.
   87  *
   88  * the function is defined in save_and_restore_luks_header.c
   89  */
   90 int zuluCryptEXESaveAndRestoreVolumeHeader( const struct_opts * opts,uid_t uid,int option  ) ;
   91 
   92 /*
   93  * this function is responsibe for printing information about an opened volume.
   94  * It is defined in volume_info.c
   95  */
   96 int zuluCryptEXEVolumeInfo( const char * mapper,const char * device,uid_t ) ;
   97 
   98 /*
   99  * this function is responsibe for closing an opened volume.
  100  * It is defined in close_volume.c
  101  */
  102 int zuluCryptEXECloseVolume( const char * device,const char * mapping_name,uid_t ) ;
  103 
  104 /*
  105  * this function is responsibe for opening volumes.
  106  * It is defined in open_volume.c *
  107  */
  108 int zuluCryptEXEOpenVolume( const struct_opts *,const char * mapping_name,uid_t uid ) ;
  109 
  110 /*
  111  * this function is responsibe for creating volumes.
  112  * It is defined in create_volume.c
  113  */
  114 int zuluCryptEXECreateVolume( const struct_opts *,const char * mapping_name,uid_t uid ) ;
  115 
  116 /*
  117  * this function is responsibe for adding keys to luks volumes.
  118  * It is defined in add_key.c
  119  */
  120 int zuluCryptEXEAddKey( const struct_opts *,uid_t ) ;
  121 
  122 /*
  123  * this function is responsibe for removing keys from luks files.
  124  * It is defined in remove_key.c
  125  */
  126 int zuluCryptEXERemoveKey( const struct_opts *,uid_t ) ;
  127 
  128 /*
  129  * this function is responsibe for checking if a path exist or not.
  130  * It is defined in ../lib/is_path_valid.c
  131  */
  132 int zuluCryptIsPathValid( const char * path ) ;
  133 
  134 /*
  135  * this function checks if a user who started the tool has writing access to a file or device they want this tool to
  136  * write to.
  137  * It is defined in path_access.c
  138  */
  139 int zuluCryptCanOpenPathForWriting( const char * path,uid_t uid ) ;
  140 
  141 /*
  142  * this function checks if a user who started the tool has reading access to a file or device they want this tool to
  143  * read from.
  144  * It is defined in path_access.c
  145  */
  146 int zuluCryptCanOpenPathForReading( const char * path,uid_t uid ) ;
  147 
  148 /*
  149  * check if the volume has atleast one corrupted key slot
  150  */
  151 void zuluCryptCheckInvalidKey( const char * device ) ;
  152 
  153 /*
  154  * this function checks if a device is a system partition or not.
  155  *
  156  * the function is defined in partitions.c *
  157  */
  158 int zuluCryptCheckIfPartitionIsSystemPartition( const char * device ) ;
  159 
  160 /*
  161  * defined in crypt_file.c
  162  */
  163 int zuluCryptExeFileEncrypt( const struct_opts *,uid_t uid ) ;
  164 
  165 /*
  166  * defined in crypt_file.c
  167  */
  168 int zuluCryptExeFileDecrypt( const struct_opts *,uid_t uid ) ;
  169 
  170 /*
  171  * defined in check_opened_mapper.c
  172  *
  173  * the function checks to see if the argument mapper has an entry in crypt_get_dir().
  174  *
  175  * the function is used to prevent performing operations like creating a volume on devices with mapper open.
  176  */
  177 int zuluCryptCheckOpenedMapper( const char * mapper ) ;
  178 
  179 /*
  180  * check if a  device with a path "path" as an entry in /etc/mtab.
  181  *
  182  * defined in process_mountinfo.c
  183  */
  184 int zuluCryptCheckIfMounted( const char * path ) ;
  185 
  186 /*
  187  * function defined at write_device_with_junk.c
  188  */
  189 int zuluCryptEXEWriteDeviceWithJunk( const struct_opts * opts,const char * mapping_name,uid_t uid ) ;
  190 
  191 /*
  192  * function defined at write_device_with_junk.c
  193  */
  194 int zuluCryptEXEOpenPlainAsMe(const struct_opts * opts,const char * mapping_name,uid_t uid ) ;
  195 
  196 /*
  197  * defined in lib/status.c
  198  * remember to free() the return value when done with it
  199  * */
  200 char * zuluCryptVolumeDeviceName( const char * ) ;
  201 
  202 /*
  203  * defined at help.c
  204  * */
  205 void zuluCryptEXEHelp( void ) ;
  206 
  207 /*
  208  * defined at partitions.c
  209  */
  210 int zuluCryptCheckSystemTools( void ) ;
  211 
  212 /*
  213  * defined in partitions.c
  214  * remember to free() the return value when done with it *
  215  */
  216 char * zuluCryptDeviceFromUUID( const char * uuid ) ;
  217 
  218 /*
  219  * defined in partitions.c
  220  */
  221 int zuluCryptPrintPartitions( int option,int info,uid_t uid ) ;
  222 
  223 /*
  224  * defined at process_mountinfo.c
  225  * remember to free() a returned pointer when done with it.
  226  */
  227 char * zuluCryptGetMountPointFromPath( const char * path ) ;
  228 
  229 
  230 #ifdef __cplusplus
  231 }
  232 #endif
  233 
  234 #endif