Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<libcryptsetup.h>
- #include<stdio.h>
- #include<string.h>
- int main( int argc,char * argv[] )
- {
- struct crypt_device * cd;
- const char * id ;
- const char * mapper = argv[1] ;
- if( crypt_init_by_name( &cd,mapper ) < 0 ){
- perror( "crypt_init_by_name() failed" ) ;
- crypt_free( cd ) ;
- return 1 ;
- }
- id = crypt_get_uuid( cd ) ;
- if( id == NULL ){
- perror( "crypt_get_uuid() failed" ) ;
- crypt_free( cd ) ;
- return 1 ;
- }else{
- printf( "UUID=%s\n",id ) ;
- }
- crypt_free( cd ) ;
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement