From c713cd6cb8edc29c1a9cc50f6e377930a8e5d073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Tue, 7 Jun 2016 16:58:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D1=81=20=D1=88=D0=B8=D1=84=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D0=BC=20=D0=BF=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D0=B5=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/logout.d/95syncface | 1 + pym/desktop/desktop.py | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/data/logout.d/95syncface b/data/logout.d/95syncface index e8699a0..870ccad 100644 --- a/data/logout.d/95syncface +++ b/data/logout.d/95syncface @@ -24,6 +24,7 @@ get_kdm_icon_face_dir() { get_sddm_icon_face_dir() { local config_file=/etc/sddm.conf if [[ -f $config_file ]] + then if grep ^FacesDir $config_file &>/dev/null then sed -rn 's/^FacesDir=(.*)/\1/p' $config_file diff --git a/pym/desktop/desktop.py b/pym/desktop/desktop.py index 3d7b893..0d034ea 100644 --- a/pym/desktop/desktop.py +++ b/pym/desktop/desktop.py @@ -119,15 +119,22 @@ class Desktop(MethodsInterface): _(": ") + _("The home directory contains mount points")) # поместить данные во временный tarfile - calculateName = ".calculate" - calculatePath = path.join(userDir, calculateName) + remove_files = [] tf = tempfile.TemporaryFile() - with tarfile.open(fileobj=tf, mode='w:') as tarf: - tarf.add(calculatePath, calculateName) + for fn in (".calculate", ".dmrc", ".face", ".face.icon"): + full_fn = path.join(userDir, fn) + if path.lexists(full_fn): + with tarfile.open(fileobj=tf, mode='w:') as tarf: + tarf.add(full_fn, fn) + remove_files.append(full_fn) tf.flush() tf.seek(0) # удалить эти данные - shutil.rmtree(calculatePath) + for fn in remove_files: + if not path.islink(fn) and path.isdir(fn): + shutil.rmtree(fn) + else: + os.unlink(fn) # создать шифрованные данные e = process('/usr/bin/ecryptfs-setup-private', '-u', userName,