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)  

main.c File Reference
#include "includes.h"
#include "../lib/includes.h"
#include "../lib/libzuluCrypt.h"
#include <signal.h>
#include <sys/resource.h>
#include <locale.h>
#include <libintl.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <grp.h>
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define hide(z)   strncpy( ( char * )z,"x",StringLength( q ) ) ;
 

Functions

static void _seteuid (uid_t uid)
 
static void _setuid (uid_t uid)
 
static int zuluCryptEXEGetDevice (const char *device)
 
static int zuluCryptEXECheckIfLuks (const char *device)
 
static int zuluCryptEXECheckIfTcrypt (struct_opts *clargs, uid_t uid)
 
static int zuluCryptEXECheckEmptySlots (const char *device)
 
static int zuluCryptEXECheckUUID (const char *device)
 
static int zuluCryptEXEHeaderMatchBackUpHeader (const char *device, const char *header_backup, uid_t uid)
 
static int zuluCryptEXE (struct_opts *clargs, const char *mapping_name, uid_t uid)
 
static int zuluExit (int st, stringList_t stl, stringList_t stx, char *const *env, const char *msg)
 
static void ExitOnMemoryExaustion (void)
 
static int _print_uuid_from_path (const char *device)
 
static void _privilegeEvelationError (const char *msg)
 
static void _forceTerminateOnSeriousError (int sig)
 
static int _clear_dead_mappers (uid_t uid)
 
static int _printOpenedVolumes (uid_t uid)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ hide

#define hide (   z)    strncpy( ( char * )z,"x",StringLength( q ) ) ;

Function Documentation

◆ _clear_dead_mappers()

static int _clear_dead_mappers ( uid_t  uid)
static

Definition at line 324 of file main.c.

References zuluCryptClearDeadMappers().

Referenced by main().

◆ _forceTerminateOnSeriousError()

static void _forceTerminateOnSeriousError ( int  sig)
static

Definition at line 317 of file main.c.

Referenced by main().

◆ _print_uuid_from_path()

static int _print_uuid_from_path ( const char *  device)
static

Definition at line 293 of file main.c.

References e, StringFree(), and zuluCryptUUIDFromPath().

Referenced by main().

◆ _printOpenedVolumes()

static int _printOpenedVolumes ( uid_t  uid)
static

◆ _privilegeEvelationError()

static void _privilegeEvelationError ( const char *  msg)
static

Definition at line 311 of file main.c.

Referenced by main().

◆ _seteuid()

static void _seteuid ( uid_t  uid)
static

Definition at line 33 of file main.c.

Referenced by main().

◆ _setuid()

static void _setuid ( uid_t  uid)
static

Definition at line 38 of file main.c.

Referenced by main().

◆ ExitOnMemoryExaustion()

static void ExitOnMemoryExaustion ( void  )
static

Definition at line 287 of file main.c.

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 353 of file main.c.

References _clear_dead_mappers(), _forceTerminateOnSeriousError(), _print_uuid_from_path(), _printOpenedVolumes(), _privilegeEvelationError(), _seteuid(), _setuid(), struct_opts_1::action, struct_opts_1::argv, tcplay_opts::dev, struct_opts_1::device, struct_opts_1::env, struct_opts_1::existing_key, ExitOnMemoryExaustion(), hide, struct_opts_1::key, struct_opts_1::new_key, struct_opts_1::partition_number, struct_opts_1::print_partition_type, ProcessExitOnMemoryExaustion(), struct_opts_1::rng, SocketExitOnMemoryExaustion(), String(), StringAppend(), StringAppendInt(), StringAtLeastOneMatch_1(), StringContent(), StringDelete(), StringExitOnMemoryExaustion(), StringFree(), StringLastIndexOfChar_1(), StringLength(), StringListAssignString(), StringListContentAtFirstPlace(), StringListExitOnMemoryExaustion(), StringListInit(), StringListStringArray(), StringListVoid, StringMultipleAppend(), StringPrefixEqual(), StringPrefixMatch(), StringRemoveString(), StringsAreEqual, StringSubChar(), StringVoid, struct_opts_1::tcrypt_hidden_volume_key, struct_opts_1::tcrypt_hidden_volume_multiple_keyfiles, struct_opts_1::tcrypt_multiple_keyfiles, struct_opts_1::type, struct_opts_1::uid, zuluCryptClearDeadMappers(), zuluCryptDeviceIsSupported(), zuluCryptDisableMetadataLocking(), zuluCryptEvaluateDeviceTags(), zuluCryptEXE(), zuluCryptEXEGetDevice(), zuluCryptEXEGetOpts(), zuluCryptEXEHelp(), zuluCryptExeSetOriginalUID(), zuluCryptGetDeviceFileProperties(), zuluCryptLoopDeviceAddress_1(), zuluCryptPrintPartitions(), zuluCryptRunTest(), zuluCryptSecurityConvertUID(), zuluCryptSecurityDropElevatedPrivileges(), zuluCryptSecurityLockMemory(), zuluCryptSecuritySanitizeTheEnvironment(), zuluCryptSecuritySetPrivilegeElevationErrorFunction(), zuluCryptSetUserUIDForPrivilegeManagement(), zuluCryptVersion(), and zuluExit().

◆ zuluCryptEXE()

◆ zuluCryptEXECheckEmptySlots()

static int zuluCryptEXECheckEmptySlots ( const char *  device)
static

◆ zuluCryptEXECheckIfLuks()

static int zuluCryptEXECheckIfLuks ( const char *  device)
static

◆ zuluCryptEXECheckIfTcrypt()

◆ zuluCryptEXECheckUUID()

static int zuluCryptEXECheckUUID ( const char *  device)
static

Definition at line 206 of file main.c.

Referenced by zuluCryptEXE().

◆ zuluCryptEXEGetDevice()

static int zuluCryptEXEGetDevice ( const char *  device)
static

◆ zuluCryptEXEHeaderMatchBackUpHeader()

static int zuluCryptEXEHeaderMatchBackUpHeader ( const char *  device,
const char *  header_backup,
uid_t  uid 
)
static

◆ zuluExit()

static int zuluExit ( int  st,
stringList_t  stl,
stringList_t  stx,
char *const *  env,
const char *  msg 
)
static

Definition at line 270 of file main.c.

References StringFree(), StringListClearDelete(), StringListDelete(), and zuluCryptSecurityUnlockMemory().

Referenced by main().