summaryrefslogtreecommitdiffstats
path: root/meta-security/lib/oeqa/runtime/files/notroot.py
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-02-08 09:57:25 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2018-02-13 11:02:00 +0100
commit0ffb178ea81ebcde3990dd8269ccc08ebbc83416 (patch)
treeeb7db261cbbda2bb1ca31b962d9d2255a0931734 /meta-security/lib/oeqa/runtime/files/notroot.py
parent4c1200c414361d35faf90ba887e012ab3cbab3db (diff)
meta-security: Remove unused content
This unused content can be devided in two parts: - setting and feature in bitbake classes - tests None are actually used by AGL. Even if this content can be later included in distribution, I prefer to remove it now. Change-Id: I4e6a8ac6326986a5652a7c47614dcaa3db8cabb6 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'meta-security/lib/oeqa/runtime/files/notroot.py')
-rw-r--r--meta-security/lib/oeqa/runtime/files/notroot.py33
1 files changed, 0 insertions, 33 deletions
diff --git a/meta-security/lib/oeqa/runtime/files/notroot.py b/meta-security/lib/oeqa/runtime/files/notroot.py
deleted file mode 100644
index f0eb0b5b9..000000000
--- a/meta-security/lib/oeqa/runtime/files/notroot.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-#
-# Script used for running executables with custom labels, as well as custom uid/gid
-# Process label is changed by writing to /proc/self/attr/curent
-#
-# Script expects user id and group id to exist, and be the same.
-#
-# From adduser manual:
-# """By default, each user in Debian GNU/Linux is given a corresponding group
-# with the same name. """
-#
-# Usage: root@desk:~# python notroot.py <uid> <label> <full_path_to_executable> [arguments ..]
-# eg: python notroot.py 1000 User::Label /bin/ping -c 3 192.168.1.1
-#
-# Author: Alexandru Cornea <alexandru.cornea@intel.com>
-import os
-import sys
-
-try:
- uid = int(sys.argv[1])
- sys.argv.pop(1)
- label = sys.argv[1]
- sys.argv.pop(1)
- open("/proc/self/attr/current", "w").write(label)
- path=sys.argv[1]
- sys.argv.pop(0)
- os.setgid(uid)
- os.setuid(uid)
- os.execv(path,sys.argv)
-
-except Exception,e:
- print e.message
- sys.exit(1)