Compare commits

..

8 Commits

Author SHA1 Message Date
Melroy van den Berg
91adbbe183 Update copyright in translation source 2024-01-26 00:38:37 +01:00
Melroy van den Berg
766cd27c1b Update copyright lines 2024-01-26 00:38:13 +01:00
Narrat
dee2b0f8c4 list_processes: use lsof to list processes
Parsing the output from lsof had possibilities for race conditions.
Either due to short lived processes or issuing "tomb ps" from a terminal which cwd is from inside the tomb.
This would spit out available users on the system.
To avoid this use the lsof output directly.

In the future formatting could be reintroduced via commands like
"lsof +D "$tombmount" -F Lc" or "lsof +D "$tombmount" -F Lc0".

This fixes #503
2024-01-26 00:37:46 +01:00
nerun
13eeef7c6c manpage: replaced 'mlocate' to 'mlocate/plocate', because of commit 59d7331. 2024-01-26 00:30:58 +01:00
nerun
194d60fe9a manpage: better formatting of .EX/.EE macros 2024-01-26 00:30:58 +01:00
nerun
7f91cc917d manpage: fixed typo in "bind-hooks" 2024-01-26 00:30:58 +01:00
nerun
09d981f0fc manpage: 80 columns line break in PASSWORD INPUT. 2024-01-26 00:30:58 +01:00
vladislav doster
e1afecb832 fix: remove duplicate help in subcommands_opts 2024-01-26 00:28:50 +01:00
3 changed files with 34 additions and 44 deletions

View File

@ -122,7 +122,7 @@ internally to enumerate processes running in one or all tombs.
.IP "index"
Creates or updates the search indexes of all tombs currently open:
enables use of the \fIsearch\fR command using simple word patterns on
file names. Indexes are created using mlocate's updatedb(8) and
file names. Indexes are created using mlocate/plocate's updatedb(8) and
swish-e(1) if they are found on the system. Indexes allow one to search
very fast for filenames and contents inside a tomb, they are stored
inside it and are not accessible if the Tomb is closed. To avoid
@ -132,7 +132,7 @@ indexing a specific tomb simply touch a \fI.noindex\fR file in it.
.IP "search"
Takes any string as argument and searches for them through all tombs
currently open and previously indexed using the \fIindex\fR command.
The search matches filenames if mlocate is installed and then also
The search matches filenames if mlocate/plocate is installed and then also
file contents if swish++ is present on the system, results are listed
on the console.
@ -375,7 +375,7 @@ base root of the tomb.
.IP "bind-hooks"
This hook file consists of a simple text file named \fIbind-hooks\fR
containing a two column list of paths to files or directories inside
the tomb. The files and directories will be be made directly
the tomb. The files and directories will be made directly
accessible by the tomb \fIopen\fR command inside the current user's
home directory. Tomb uses internally the "mount \-o bind" command to
bind locations inside the tomb to locations found in $HOME. In the
@ -475,7 +475,12 @@ alias tomb=' tomb'
.SH PASSWORD INPUT
Tomb uses the external program "pinentry" to let users type the key password into a terminal or a graphical window. This program works in conjunction with "gpg-agent", a daemon running in background to facilitate secret key management with gpg. It is recommended one runs "gpg-agent" launching it from the X session initialization ("~/.xsession" or "~/.xinitrc" files) with this command:
Tomb uses the external program "pinentry" to let users type the key password
into a terminal or a graphical window. This program works in conjunction with
"gpg-agent", a daemon running in background to facilitate secret key
management with gpg. It is recommended one runs "gpg-agent" launching it from
the X session initialization ("~/.xsession" or "~/.xinitrc" files) with this
command:
.EX
eval $(gpg-agent --daemon --write-env-file "${HOME}/.gpg-agent-info")

View File

@ -1,6 +1,6 @@
# Tomb - The Crypto Undertaker.
# Copyright (C) 2007-2014 Dyne.org Foundation
# Copyright (C) 2007-2024 Dyne.org Foundation
# Denis Roio <jaromil@dyne.org>, 2013.
#
#, fuzzy
@ -1123,7 +1123,7 @@ msgid "Tomb ::1 version:: - a strong and gentle undertaker for your secrets"
msgstr ""
#: tomb:Main routine:main:2806
msgid " Copyright (C) 2007-2017 Dyne.org Foundation, License GNU GPL v3+"
msgid " Copyright (C) 2007-2024 Dyne.org Foundation, License GNU GPL v3+"
msgstr ""
#: tomb:Main routine:main:2807

23
tomb
View File

@ -7,7 +7,7 @@
# {{{ License
# Copyright (C) 2007-2023 Dyne.org Foundation
# Copyright (C) 2007-2024 Dyne.org Foundation
#
# Tomb is designed, written and maintained by Denis Roio <jaromil@dyne.org>
#
@ -3192,10 +3192,8 @@ umount_tomb() {
list_processes() {
# $1 = (optional) name of tomb
# returns a list of process UIDs, one per line
# runs lsof on the mounted_tombs
local mounted_tombs i
local pnum puid pcmd powner found
found=0
mounted_tombs=(`list_tomb_mounts $1`)
if [[ "${#mounted_tombs}" -gt 0 ]]; then
if [[ -z $1 ]]; then
@ -3207,21 +3205,9 @@ list_processes() {
for i in ${mounted_tombs}; do
_verbose "scanning tomb: ::1 tombmount::" $i
tombmount="${i[(ws:;:)2]}"
tombname=${i[(ws:;:)5]}
for pnum in ${(f)"$(_sudo lsof -t +D "$tombmount")"}; do
found=$(($found + 1))
_verbose "process found: $pnum"
puid=$(cat /proc/${pnum}/loginuid)
pcmd=$(cat /proc/${pnum}/cmdline)
powner=`_get_username $puid`
_verbose "process found: $pnum $pcmd ($powner)"
_message "::1 tombname:: ::2 cmd:: (::3 owner::)" \
$tombname $pcmd $powner
done
_sudo lsof +D "${i[(ws:;:)2]}"
done
fi
_message "::1 foundproc:: running processes found inside ::2 numtombs:: open tombs" \
$found ${#mounted_tombs}
return 0
}
@ -3335,7 +3321,6 @@ main() {
subcommands_opts[index]=""
subcommands_opts[search]=""
subcommands_opts[help]=""
subcommands_opts[bury]="k: -tomb-pwd: r: R: -sphx-host: -sphx-user: "
subcommands_opts[exhume]="k: -tomb-pwd: r: R: -sphx-host: -sphx-user: "
subcommands_opts[cloak]="k: "
@ -3590,7 +3575,7 @@ main() {
__default)
_print "Tomb ::1 version:: - a strong and gentle undertaker for your secrets" $VERSION
echo
_print " Copyright (C) 2007-2021 Dyne.org Foundation, License GNU GPL v3+"
_print " Copyright (C) 2007-2024 Dyne.org Foundation, License GNU GPL v3+"
_print " This is free software: you are free to change and redistribute it"
_print " For the latest sourcecode go to <http://dyne.org/software/tomb>"
echo