Commit 38c57737 authored by m3hm00d's avatar m3hm00d

Moved 'tails.py' from 'tails.git' to pythonlib/tailslib/adminpassword.py

- Appropriate changes in 'tails-screen-locker' and 'replace-su-with-sudo'
made.
- URL to 'pythonlib' submodule updated.
- PYTHON_PROGS sorted.
parent 0e1278c7
[submodule "submodules/pythonlib"]
path = submodules/pythonlib
url = https://git-tails.immerda.ch/pythonlib
url = https://gitlab.com/m3hm00d/pythonlib
[submodule "submodules/jenkins-tools"]
path = submodules/jenkins-tools
url = https://git-tails.immerda.ch/jenkins-tools
......
......@@ -6,18 +6,18 @@
#
# This script is called by '/etc/bash.bashrc.d/replace-su-with-sudo.sh'.
# It checks if the current user's password is set or not using
# 'is_password_set()' function from 'tails.py' library. If the password
# is set, the user is asked to use 'sudo' instead of 'su'. Otherwise,
# the user is asked to first set the administration password.
# 'is_password_set()' function from 'adminpassword.py' library. If the
# password is set, the user is asked to use 'sudo' instead of 'su'.
# Otherwise, the user is asked to first set the administration password.
#
# https://redmine.tails.boum.org/code/issues/15583
import gettext
import sys
import tails
import adminpassword
def main() -> None:
if tails.is_password_set():
if adminpassword.is_password_set():
print(_('su is disabled. Please use sudo instead.'))
sys.exit(0)
else:
......
......@@ -17,7 +17,7 @@ from gi.repository import Gtk, GLib
gi.require_version('Gdk', '3.0')
from gi.repository import Gdk
import tails
import adminpassword
_ = gettext.gettext
gettext.textdomain("tails")
......@@ -200,7 +200,7 @@ def get_lock():
def main():
get_lock()
if tails.is_password_set():
if adminpassword.is_password_set():
lock_screen()
return
......
#!/usr/bin/env python3
# This file is part of Tails. The purpose of this file is to provide a
# system-wide library that may be useful for other components of Tails.
import subprocess
def is_password_set():
output = subprocess.check_output(["passwd", "--status"])
return output.split()[1] == b"P"
......@@ -3,6 +3,7 @@ tmp/pot/60-tor-ready.sh.pot
tmp/pot/config.py.pot
tmp/pot/configuration-window.ui.pot
tmp/pot/electrum.pot
tmp/pot/replace-su-with-sudo.pot
tmp/pot/status-menu-helper-extension.js.pot
tmp/pot/tails-about.pot
tmp/pot/tails-additional-software.pot
......@@ -20,7 +21,6 @@ tmp/pot/unsafe-browser.pot
tmp/pot/unlock-veracrypt-volumes-volume.py.pot
tmp/pot/unlock-veracrypt-volumes-volume_list.py.pot
tmp/pot/unlock-veracrypt-volumes-volume_manager.py.pot
tmp/pot/replace-su-with-sudo.pot
# Files updated by intltool-update --desktop-style
config/chroot_local-includes/etc/skel/Desktop/Report_an_error.desktop.in
......
......@@ -8,6 +8,7 @@ PERL_PROGS="/usr/local/bin/tails-security-check \
/usr/local/lib/tails-virt-notify-user"
PYTHON_PROGS="/etc/whisperback/config.py \
/usr/local/bin/electrum \
/usr/local/bin/replace-su-with-sudo \
/usr/local/bin/tails-about \
/usr/local/bin/tails-additional-software-config \
/usr/local/bin/tails-screen-locker \
......@@ -17,8 +18,7 @@ PYTHON_PROGS="/etc/whisperback/config.py \
/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_list.py \
/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py
/usr/local/lib/tails-additional-software-notify \
/usr/local/sbin/tails-additional-software \
/usr/local/bin/replace-su-with-sudo"
/usr/local/sbin/tails-additional-software"
SHELL_PROGS="/etc/NetworkManager/dispatcher.d/60-tor-ready.sh \
/usr/local/bin/keepassx \
/usr/local/lib/tails-spoof-mac \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment