commit f293d89fb8729881a3f2d89bb07aaaae0aabdd10
parent cb53eb493de526f416666dfb58874567ec58463a
Author: Jaromil <jaromil@dyne.org>
Date:   Thu, 24 Feb 2011 12:26:48 +0100
small fixes and more documentation
Diffstat:
3 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/doc/tomb.1 b/doc/tomb.1
@@ -104,16 +104,42 @@ Run more quietly
 .IP "-D"
 Print more information while running, for debugging purposes
 
+.SH HOOKS
+
+Hooks are special files that can be placed inside the tomb and trigger
+actions when it is opened and closed; there are two kinds of such
+files: \fIbind-hooks\fR and \fIpost-hooks\fR can be placed in the
+base root of the tomb.
+
+.B
+.IP "bind-hooks"
+This hook file consists of a simple two column list of files or
+directories inside the tomb to be made directly accessible inside the
+current user's home directory. Tomb will use the "mount -o bind"
+command to bind locations inside the tomb to locations found in $HOME
+so in the first column are indicated paths relative to the tomb and in
+the second column are indicated paths relative to $HOME contents, for
+example:
+
+  mail          mail
+  .gnupg        .gnupg
+  .fmrc         .fetchmailrc
+  .mozilla      .mozilla
+
+.B
+.IP "post-hooks"
+This hook file gets executed as user by tomb right after opening it;
+it can consist of a shell script of a binary executable that performs
+batch operations every time a tomb is opened.
+
 .SH PRIVILEGE ESCALATION
 
 The tomb commandline tool needs to acquire super user rights to
-execute most of its operations.
-
-Once the rights are acquired Tomb executes as root only those commands
-requiring it, while it executes desktop applications as the user.
+execute most of its operations: to do so it uses sudo(8), while
+pinentry(1) is adopted to collect passwords from the user.
 
-The escalation to super user privileges is triggered automatically by
-calling 'gksu' or 'sudo' commands.
+Tomb executes as super user only those commands requiring it, while it
+executes desktop applications as processes owned by the user.
 
 
 .SH BUGS
diff --git a/src/tomb b/src/tomb
@@ -437,9 +437,7 @@ mount_tomb() {
     notice "mounting $tombfile on mountpoint $tombmount"
 
     # we need root from here on
-
-    local norm=$(test -d $tombmount)
-    $norm || mkdir -p $tombmount
+    mkdir -p $tombmount
     
     nstloop=`losetup -f`
     losetup -f ${tombdir}/${tombfile}
diff --git a/src/tomb-open b/src/tomb-open
@@ -23,8 +23,6 @@
 # startup wrapper to open tombs
 
 
-echo "arg: $1"
-
 try() {
     which ${1} > /dev/null
     if [ $? = 0 ]; then return 0;
@@ -49,7 +47,6 @@ tomb-notify() {
     if [ -z $1 ]; then
 	notify-send -i $icon \
 	    -u low -h string:App:Tomb \
-	    -h double:Version:${VERSION} \
 	    "Tomb version $VERSION" \
 	    "Hi, I'm the Undertaker.
 Let's start setting your Crypt?"