2
by mhalcrow@us.ibm.com
Initial import of eCryptfs filesystem userspace utilities (mount helper, daemon component, |
1 |
#include <stdio.h> |
2 |
#include <ecryptfs.h> |
|
3 |
||
4 |
int main() |
|
5 |
{
|
|
6 |
int rc; |
|
7 |
||
8 |
if (fork() == 0) { |
|
9 |
printf("Setting placeholder\n"); |
|
10 |
if ((rc = ecryptfs_set_zombie_session_placeholder())) { |
|
11 |
printf("Error setting zombie placeholder; rc = [%d]\n", rc); |
|
12 |
goto out; |
|
13 |
}
|
|
14 |
exit(1); |
|
15 |
}
|
|
16 |
sleep(5); |
|
17 |
printf("Listing placeholders\n"); |
|
18 |
if ((rc = ecryptfs_list_zombie_session_placeholders())) { |
|
19 |
printf("Error listing zombie placeholders; rc = [%d]\n", rc); |
|
20 |
goto out; |
|
21 |
}
|
|
22 |
sleep(1); |
|
23 |
printf("Killing and clearing placeholder\n"); |
|
24 |
if ((rc = ecryptfs_kill_and_clear_zombie_session_placeholder())) { |
|
25 |
printf("Error killing and clearing zombie placeholder; " |
|
26 |
"rc = [%d]\n", rc); |
|
27 |
goto out; |
|
28 |
}
|
|
29 |
sleep(1); |
|
30 |
printf("Listing placeholder\n"); |
|
31 |
if ((rc = ecryptfs_list_zombie_session_placeholders())) { |
|
32 |
printf("Error listing zombie placeholders; rc = [%d]\n", rc); |
|
33 |
goto out; |
|
34 |
}
|
|
35 |
out: |
|
36 |
return rc; |
|
37 |
}
|