mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-25 22:27:34 +00:00
added post-hooks
This commit is contained in:
parent
09d63eac25
commit
6078356b64
16
src/tomb
16
src/tomb
@ -586,6 +586,7 @@ mount_tomb() {
|
||||
|
||||
notice "encrypted storage $tombfile succesfully mounted on $tombmount"
|
||||
exec_bind_hooks ${tombmount}
|
||||
exec_post_hooks ${tombmount}
|
||||
exec_as_user tomb-status ${mapper} ${tombfile} ${tombmount} &!
|
||||
return 0
|
||||
}
|
||||
@ -610,6 +611,21 @@ exec_bind_hooks() {
|
||||
eval $hook
|
||||
}
|
||||
|
||||
exec_post_hooks() {
|
||||
mnt=$1 # first argument is where the tomb is mounted
|
||||
if ! [ -x ${mnt}/post-hooks ]; then return; fi
|
||||
# if 'post-hooks' is found inside the tomb, check it: if it is an
|
||||
# executable, launch it as a user this might need a dialog for
|
||||
# security on what is being run, however we expect you know well
|
||||
# what is inside your tomb. this feature opens the possibility to
|
||||
# make encrypted executables.
|
||||
cat ${mnt}/post-hooks | head -n1 | grep '^#!/'
|
||||
if [ $? = 0 ]; then
|
||||
act "post hooks found, executing as user $SUDO_USER"
|
||||
exec_as_user ${mnt}/post-hooks
|
||||
fi
|
||||
}
|
||||
|
||||
umount_tomb() {
|
||||
|
||||
if ! [ $1 ]; then
|
||||
|
@ -198,7 +198,6 @@ gboolean cb_close(GtkWidget *w, GdkEvent *e) {
|
||||
close(pipefd[1]); // reader will see EOF
|
||||
|
||||
waitpid(cpid, &res, 0);
|
||||
fprintf(stderr,"forked child returns %i",res);
|
||||
if(res==0) {
|
||||
gtk_main_quit();
|
||||
notify_uninit();
|
||||
|
Loading…
Reference in New Issue
Block a user