"Fossies" - the Fresh Open Source Software Archive

Member "zuluCrypt-5.7.1/zuluCrypt-cli/bin/includes.h" (27 Dec 2019, 7808 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 "includes.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   *
    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 
   21 #ifndef ZULUCRYPT_BIN
   22 #define ZULUCRYPT_BIN
   23 
   24 #define STRING_MEMORY_HACK 1
   25 
   26 #include "../utility/string/String.h"
   27 #include "../utility/string/StringList.h"
   28 #include "../constants.h"
   29 #include "../lib/libzuluCrypt.h"
   30 #include "../utility/socket/socket.h"
   31 #include "../utility/process/process.h"
   32 #include "libzuluCrypt-exe.h"
   33 #include "security.h"
   34 #include "locale_path.h"
   35 #include "../lib/includes.h"
   36 
   37 typedef struct{
   38 
   39     int iteration_count ;
   40     string_t type ;
   41 
   42 }tvcrypt ;
   43 
   44 /*
   45  * these two defines are used in save_and_restore_volume_header.c
   46  */
   47 #define VOLUME_HEADER_RESTORE 1
   48 #define VOLUME_HEADER_SAVE 0
   49 
   50 /*
   51  * These functions are here and not in libzuluCrypt-exe.h because they use string_t and the type is not supposed to be
   52  * seen in public API
   53  */
   54 
   55 /*
   56  * global_variable_user_uid global variable is defined in security.c
   57  */
   58 extern uid_t global_variable_user_uid ;
   59 
   60 /*
   61  * zuluCryptTrueCryptVeraCryptVolumeInfo() is defined in open_volume.c
   62  */
   63 void zuluCryptTrueCryptVeraCryptVolumeInfo( const char * type,tvcrypt * e ) ;
   64 
   65 /*
   66  * this function is defined in security.c
   67  */
   68 int zuluCryptSecurityConvertUID( uid_t uid,const char * u_id ) ;
   69 
   70 /*
   71  * this function is defined in volumes.c
   72  */
   73 int zuluCryptVolumeIsInSystemVolumeList( const char * device ) ;
   74 
   75 /*
   76  * this function is defined in path_access.c
   77  */
   78 void zuluCryptPrepareSocketPath( uid_t uid ) ;
   79 
   80 /*
   81  * this function is defined in open_volume.c
   82  */
   83 stringList_t zuluCryptCreateKeyFiles( const char * const * list,int s ) ;
   84 
   85 /*
   86  * this function is defined in save_and_restore_volume_header.c
   87  */
   88 stringList_t veraCryptVolumePIMValue( info_t * s,const char * type ) ;
   89 
   90 /*
   91  * this function is defined in open_volume.c
   92  */
   93 void zuluCryptDeleteKeyFiles( stringList_t stl ) ;
   94 
   95 /*
   96  * this function is defined in module_system.c
   97  * It gets a passphrase from a .so file as a plugin.
   98  */
   99 string_t GetKeyFromModule( const char * path,uid_t ) ;
  100 
  101 /*
  102  * this function is defined in get_key_from_socket.c
  103  */
  104 void zuluCryptGetKeyFromSocket( const char * path,string_t *,uid_t uid ) ;
  105 
  106 /*
  107  * this function returns "$HOME/" and is defined in ../pluginManager/zuluCryptPluginManager.c
  108  */
  109 string_t zuluCryptGetUserHomePath( uid_t ) ;
  110 
  111 /*
  112  * this function is defined in volumes.c
  113  */
  114 int zuluCryptPartitionIsSystemPartition( const char * dev,uid_t uid ) ;
  115 
  116 /*
  117  * this function is defined in is_luks.c
  118  */
  119 int zuluCryptVolumeIsNotLuks( const char * dev ) ;
  120 
  121 /*
  122  * this function is defined in volumes.c
  123  */
  124 int zuluCryptPrintDeviceProperties( int type ) ;
  125 
  126 /*
  127  * this function is defined in volumes.c
  128  */
  129 const char * zuluCryptVolumeType( blkid_probe blkid,const char * device ) ;
  130 
  131 /*
  132  * this function is defined in security.c
  133  */
  134 int zuluCryptSecurityCheckPartitionPermissions( uid_t uid ) ;
  135 
  136 /*
  137  * this function is defined in volumes.c
  138  */
  139 char * zuluCryptDeviceFromLabel( const char * label ) ;
  140 
  141 /*
  142  * this function is defined in security.c
  143  */
  144 int zuluCryptSecurityPathIsValid( const char * path,uid_t uid ) ;
  145 
  146 /*
  147  * this function is defined in get_opts.c
  148  */
  149 void zuluCryptEXEGetOptsSetDefault( struct_opts * stopts ) ;
  150 
  151 /*
  152  * this function is defined in mount_flags.c
  153  */
  154 int zuluCryptMountFlagsAreNotCorrect( const char * mode,uid_t uid,unsigned long * flags ) ;
  155 
  156 /*
  157  * this function is defined in security.c
  158  */
  159 int zuluCryptSecurityGainElevatedPrivileges( void ) ;
  160 
  161 /*
  162  * this function is defined in security.c
  163  */
  164 int zuluCryptSecurityDropElevatedPrivileges( void ) ;
  165 
  166 /*
  167  * this function is defined in security.c
  168  */
  169 string_t zuluCryptSecurityGetFileSystemFromDevice( const char * path ) ;
  170 
  171 /*
  172  * this function is defined in real_path.c
  173  */
  174 int zuluCryptPathStartsWith( const char * path,const char * start ) ;
  175 
  176 /*
  177  * this function is defined in real_path.c
  178  */
  179 int zuluCryptPathDoesNotStartsWith( const char * path,const char * start ) ;
  180 
  181 /*
  182  * this function is defined in mount_fs_options.c
  183  */
  184 int zulucryptFileSystemIsNotSupported( const char * fs ) ;
  185 
  186 /*
  187  * this function is defined in ../lib/real_path.c
  188  */
  189 char * zuluCryptRealPath( const char * path ) ;
  190 
  191 /*
  192  * this function is defined in clear_dead_mapper.c
  193  */
  194 void zuluCryptClearDeadMappers( uid_t uid,int ) ;
  195 
  196 /*
  197  * this function is defined in clear_dead_mapper.c
  198  */
  199 void zuluCryptDeleteDeadMountPoints( uid_t,stringList_t ) ;
  200 
  201 /*
  202  * this function is defined in save_and_restore_luks_header.c
  203  */
  204 int zuluCryptHeaderMatchBackUpHeader( const char * device,const char * header_backup,uid_t uid ) ;
  205 
  206 /*
  207  * this function is defined in bind.c
  208  */
  209 int zuluCryptBindUnmountVolume( stringList_t mountinfo,const char * device,uid_t uid ) ;
  210 
  211 /*
  212  * this function is defined in bind.c
  213  */
  214 int zuluCryptBindMountVolume( const char * device,string_t,unsigned long flags ) ;
  215 
  216 /*
  217  * this function is defined in bind.c
  218  */
  219 int zuluCryptBindSharedMountPointPathTaken( string_t path ) ;
  220 
  221 /*
  222  * this function is defined in ../pluginManager/zuluCryptPluginManager.c
  223  */
  224 string_t zuluCryptPluginManagerGetKeyFromModule( const char * device,
  225                          const char * name,
  226                          const char * uuid,
  227                          uid_t uid,
  228                          const struct_opts * opts,
  229                          const char * run_path,
  230                          int * r ) ;
  231 
  232 /*
  233  * this function is defined in volumes.c
  234  */
  235 stringList_t zuluCryptGetPartitionFromCrypttab( void ) ;
  236 
  237 /*
  238  * this function is defined in volumes.c
  239  */
  240 stringList_t zuluCryptGetPartitionFromConfigFile( const char * path ) ;
  241 
  242 /*
  243  * this function is defined in volumes.c
  244  */
  245 stringList_t zuluCryptPartitionList( void ) ;
  246 
  247 /*
  248  * this function is defined in create_mount_point.c
  249  */
  250 string_t zuluCryptCreateMountPoint( const char * device,const char * m_point,const char * m_opts,uid_t uid ) ;
  251 
  252 /*
  253  * this function is defined in create_mount_point.c
  254  */
  255 void zuluCryptCreateMountPointPrefix( uid_t uid ) ;
  256 
  257 /*
  258  * zuluCryptCreateMountPath() is defined in create_mount_point.c
  259  */
  260 void zuluCryptCreateMountPath( const char * path ) ;
  261 
  262 /*
  263  * this function is defined in create_mount_point.c
  264  */
  265 int zuluCryptMountPointPrefixMatch( const char * path,uid_t uid,string_t * m_point ) ;
  266 
  267 /*
  268  * this function is defined in path_access.c
  269  */
  270 int zuluCryptGetPassFromFile( int * socket_path,const char * path,uid_t uid,string_t * st ) ;
  271 
  272 /*
  273  * this function is defined in path_access.c
  274  */
  275 char * zuluCryptUUIDFromPath( const char * device ) ;
  276 
  277 /*
  278  * this function is defined in path_access.c
  279  */
  280 char * zuluCryptEvaluateDeviceTags( const char * tag,const char * path ) ;
  281 
  282 /*
  283  * zuluCryptRunTest() is defined in test.c
  284  */
  285 int zuluCryptRunTest( void ) ;
  286 
  287 /*
  288  * zuluCryptDeviceIsSupported() is defined in volumes.c
  289  */
  290 int zuluCryptDeviceIsSupported( const char * device,uid_t uid ) ;
  291 
  292 /*
  293  * zuluCryptPartitions() is defined in volumes.c
  294  */
  295 stringList_t zuluCryptPartitions( int option,uid_t uid ) ;
  296 
  297 /*
  298  * zuluCryptGetVolumeSize() is defined in volumes.c
  299  */
  300 u_int64_t zuluCryptGetVolumeSize( const char * device ) ;
  301 
  302 /*
  303  * zuluCryptGetAListOfAllPartitions() is defined in volumes.c
  304  */
  305 stringList_t zuluCryptGetAListOfAllVolumes( void ) ;
  306 
  307 /*
  308  * zuluCryptReuseMountPoint() is defined in create_mount_point.c
  309  */
  310 int zuluCryptReuseMountPoint( void ) ;
  311 
  312 #endif