termih / libtrash Goto Github PK
View Code? Open in Web Editor NEWTrash for GNU/Linux command line
License: GNU General Public License v2.0
Trash for GNU/Linux command line
License: GNU General Public License v2.0
Newest libtrash can be found at http://pages.stern.nyu.edu/~marriaga/software/libtrash/. This repository here is not by the author of libtrash and thus not maintained by him.
it appeared to me with https://github.com/openwrt/openwrt/archive/v17.01.4.tar.gz
(sha256sum v17.01.4.tar.gz
: a833a0c1c212209fdb6717ee943b0d8c6ce60a33c6e2792e6b59302387c69b44 v17.01.4.tar.gz
)
When I extract it with LIBTRASH preloaded (and I am not in a directory
which is listed at TEMPORARY_DIRS
or somewhere else in ~/.libtrash
):
tar -xvzf v17.01.4.tar.gz
at the end I sometimes get the error
tar: openwrt-17.01.4/target/linux/layerscape/32b/profiles/00-default.mk: Cannot unlink: Permission denied
tar: openwrt-17.01.4/package/base-files/files/etc/os-release: Cannot unlink: Permission denied
tar: Exiting with failure status due to previous errors
and sometimes the error
tar: Exiting with failure status due to previous errors
(Always one of those two).
If I look at the files openwrt-17.01.4/target/linux/layerscape/32b/profiles/00-default.mk
and openwrt-17.01.4/package/base-files/files/etc/os-release
, they have permission 000 (i.e. no read, write or execute permission for user, for group and for all).
The complete output of
tar -xvzf v17.01.4.tar.gz 2>&1 | tee logfile
is here: error-variant 1 (size: ca. 612 kB), error-variant 2 (size: ca. 612 kB).
I have also attached the output of
strace tar -xvzf v17.01.4.tar.gz 2>&1 | tee logfile
(for the second error variant): here (size: ca. 4.5 MB).
When I extract it with
TRASH_OFF=YES tar -xvzf v17.01.4.tar.gz
or with
LD_PRELOAD='' tar -xvzf v17.01.4.tar.gz
everything works fine.
Error also happens if I
gunzip v17.01.4.tar.gz
first and then just
tar -xvf v17.01.4.tar
Attached you also find my current ~/.libtrash
:
here (size: ca. 18 kB)
Note: My ~/.libtrash
is a symlink to a system-wide libtrash config file
I use for all users.
I am trying to use libtrash to delete the files via afp, I noticed that this version does not have the netatalk file in init.d
Has anyone used trash over network?
Recently, additionally to the bug of chrome and vivaldi browsers not
showing up any window if libtrash is preloaded, there are issues with
LyX in the current version of LyX:
If LyX is started with libtrash preloaded, and I open an already
existing file, and then safe it, the permissions are changed: It gets
write permission for the user and read permission for the group but NOT
THE USER (mode 240).
Meaning, usually, the user cannot read the file anymore.
Since lyx uses some default .lyx-file at startup when creating a new
document, copying it over to a temporary file, it cannot read that file
anymore, thus it is impossible to start a new document.
Attached are two screenshots of dialogues showing up if I want to
create a new document with LyX. The second dialogue comes up when I
close the first one.
The file ~/.lyx/templates/defaults.lyx has "usual" permissions (644),
but the /tmp/lyx_tmpdir.PuDcxaWoEgGU/Buffer_convertLyXFormatmVnNfa.lyx,
which is a file created transiently by LyX from
~/.lyx/templates/defaults.lyx has mode 240, making LyX unable to read
it and fail (and thus LyX thinks that ~/.lyx/templates/defaults.lyx is
not readable, since LyX does not expect that file permissions differ
from what LyX wants them to be).
Starting lyx with an empty LD_PRELOAD mitigates this problems.
Can you have a look into it? Are you sure that this is not a problem
with libtrash?
Output of lyx --version:
LyX 2.2.3 (2017-05-17)
Configuration
Host type: x86_64-unknown-linux-gnu
Special build flags: build=release c++11 std-regex use-aspell use-enchant use-hunspell
C++ Compiler: g++ (7.2.1)
C++ Compiler flags: -std=c++11 -fPIC -O2 -Wno-deprecated-declarations
C++ Compiler user flags: -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -fpermissive
Linker flags:
Linker user flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
Qt Frontend:
Qt version: 5.10.0
Packaging: posix
LyX binary dir: /usr/bin
LyX files dir: /usr/share/lyx
libtrash version: 3.3
I use:
kate --version
: kate 17.12.3,env
): env.txt,~/.libtrash
: .libtrash.txt, which I installed as a symlink to /etc/libtrash.conf
which again is a symlink to /usr/local/etc/libtrash.conf
. (I deliberately did choose to do so to have same config for all users; it is my machine and not a multi user machine.)I run
kate -n textfile.txt
(textfile.txt
does not exist yet), write a line (I write 1st edit
, followed by a newline), and save.
Output of ls -l textfile.txt
:
--w-r----- 1 felics felics 9 Mar 11 11:45 textfile.txt
(Mode is 240, but it shout be 644.)
I write a second line (I write 2nd edit
, followed by a newline) in kate, and save.
Now I see a temporary file in the directory:
--w-r----- 1 felics felics 18 Mar 11 11:48 textfile.txt.LrTBro
As well as the usual crash-recovery .kate-swp
file:
-rw------- 1 felics felics 291 Mar 11 11:48 .textfile.txt.kate-swp
which has interestingly permissions as they should be, and kate displays the attached error message:
The temporary file textfile.txt.LrTBro
has the content I wanted to save, while the textfile.txt
did stay unchanged. I assume that kate saves to the temporary file first if the target file already exists and then tries to "move to the new file" (maybe by renaming), which fails (seems to be related to libtrash trying to save to ~/.Trash
what kate would overwrite, see below).
When exiting kate without saving, the .textfile.txt.kate-swp
gets correctly removed, but the temporary file stays.
I attach the output of
kate -n textfile.txt 2>&1 | tee kate_with_lintrash.log
and
strace kate -n textfile.txt 2>&1 | tee kate_strace_with_lintrash.log
(kate_strace_with_lintrash.log.txt.gz),
both were started over with removed textfile.txt
.
(The 'kate_strace_with_lintrash.log' I attached gzip-compressed due to it's uncompressed size of about 3.8 MB, and I gave them the extension .txt
due to github's restrictions on file extensions.)
With
TRASH_OFF=YES kate -n textfile.txt
the second save works fine, but the created file also get's wrong permissions:
--w-r----- 1 felics felics 18 Mar 11 12:01 textfile.txt
(It seems to me that the failure in resaves is that libtrash fails to move something to ~/.Trash/
).
With
LD_PRELOAD='' kate -n textfile.txt
everything is fine and the created file has correct permissions:
-rw-r--r-- 1 felics felics 18 Mar 11 12:04 textfile.txt
Also I attach textfile.txt
as it should be after two successful saves: textfile.txt.
When I open with kate a file that is already existing, the permissions stay as they are.
Similar things also happen with LyX 2.2.3.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.