[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] fixup 0f365397 from 2019: drop everything live-build related

Holger Levsen gitlab at salsa.debian.org
Thu Mar 4 15:18:14 GMT 2021



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
6118d6b5 by Holger Levsen at 2021-03-04T16:18:04+01:00
fixup 0f365397 from 2019: drop everything live-build related

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


2 changed files:

- − live/config/chroot_local-includes/lib/live/config/9999-autotest
- − live/config/chroot_local-includes/usr/local/sbin/autotest_remote_shell.py


Changes:

=====================================
live/config/chroot_local-includes/lib/live/config/9999-autotest deleted
=====================================
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-SCRIPT=/usr/local/sbin/autotest_remote_shell.py
-
-if grep -qw "autotest_never_use_this_option" /proc/cmdline; then
-    # a more beautiful solution is desirable
-    sed -i 's/^exit.*$//' /etc/rc.local
-    echo "( while true ; do python ${SCRIPT} /dev/ttyS0 ; done ) &" >> \
-        /etc/rc.local
-    echo "exit 0" >> /etc/rc.local
-fi


=====================================
live/config/chroot_local-includes/usr/local/sbin/autotest_remote_shell.py deleted
=====================================
@@ -1,71 +0,0 @@
-#!/usr/bin/python
-
-# ATTENTION: Yes, this can be used as a backdoor, but only for an
-# adversary with access to you *physical* serial port, which means
-# that you are screwed any way.
-
-from subprocess import Popen, PIPE
-from sys import argv
-from json import dumps, loads
-from pwd import getpwnam
-from os import setgid, setuid, environ
-from glob import glob
-import serial
-
-def mk_switch_user_fn(uid, gid):
-    def switch_user():
-        setgid(gid)
-        setuid(uid)
-    return switch_user
-
-def run_cmd_as_user(cmd, user):
-  env = environ.copy()
-  pwd_user = getpwnam(user)
-  switch_user_fn = mk_switch_user_fn(pwd_user.pw_uid,
-                                     pwd_user.pw_gid)
-  env['USER'] = user
-  env['LOGNAME'] = user
-  env['USERNAME'] = user
-  env['HOME'] = pwd_user.pw_dir
-  env['MAIL'] = "/var/mail/" + user
-  env['PWD'] = env['HOME']
-  env['DISPLAY'] = ':0.0'
-  try:
-    env['XAUTHORITY'] = glob("/var/run/gdm3/auth-for-amnesia-*/database")[0]
-  except IndexError:
-    pass
-  cwd = env['HOME']
-  return Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True, env=env, cwd=cwd,
-               preexec_fn=switch_user_fn)
-
-def main():
-  dev = argv[1]
-  port = serial.Serial(port = dev, baudrate = 4000000)
-  port.open()
-  while True:
-    try:
-      line = port.readline()
-    except Exception as e:
-      # port must be opened wrong, so we restart everything and pray
-      # that it works.
-      print str(e)
-      port.close()
-      return main()
-    try:
-      cmd_type, user, cmd = loads(line)
-    except Exception as e:
-      # We had a parse/pack error, so we just send a \0 as an ACK,
-      # releasing the client from blocking.
-      print str(e)
-      port.write("\0")
-      continue
-    p = run_cmd_as_user(cmd, user)
-    if cmd_type == "spawn":
-      returncode, stdout, stderr = 0, "", ""
-    else:
-      stdout, stderr = p.communicate()
-      returncode = p.returncode
-    port.write(dumps([returncode, stdout, stderr]) + "\0")
-
-if __name__ == "__main__":
-  main()



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/6118d6b5b5fcb87967b8e097072a7d7436ee09e8

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/6118d6b5b5fcb87967b8e097072a7d7436ee09e8
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20210304/0b4e7091/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list