aboutsummaryrefslogtreecommitdiffstats
path: root/mkuid.sh
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-07-29 09:37:51 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-07-29 09:37:51 -0400
commitbdcb2be80f78082650283e13fcb9a90d75e02eba (patch)
tree16c5acb08efa77aa9bc78e55bad4b2fd93254f30 /mkuid.sh
parentfix Makefile.in (diff)
downloadfirejail-bdcb2be80f78082650283e13fcb9a90d75e02eba.tar.gz
firejail-bdcb2be80f78082650283e13fcb9a90d75e02eba.tar.zst
firejail-bdcb2be80f78082650283e13fcb9a90d75e02eba.zip
using UID_MIN/GID_MIN values from /etc/login.def
Diffstat (limited to 'mkuid.sh')
-rwxr-xr-xmkuid.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/mkuid.sh b/mkuid.sh
new file mode 100755
index 000000000..f03fdaf94
--- /dev/null
+++ b/mkuid.sh
@@ -0,0 +1,20 @@
1#!/bin/bash
2
3echo "extracting UID_MIN and GID_MIN"
4echo "#ifndef FIREJAIL_UIDS_H" > uids.h
5echo "#define FIREJAIL_UIDS_H" >> uids.h
6
7if [ -f /etc/login.defs ]
8then
9 echo "// using values extracted from /etc/login.defs" >> uids.h
10 UID_MIN=`awk '/^\s*UID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs`
11 GID_MIN=`awk '/^\s*GID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs`
12 echo "#define UID_MIN $UID_MIN" >> uids.h
13 echo "#define GID_MIN $GID_MIN" >> uids.h
14else
15 echo "// using default values" >> uids.h
16 echo "#define UID_MIN 1000" >> uids.h
17 echo "#define GID_MIN 1000" >> uids.h
18fi
19
20echo "#endif" >> uids.h