diff options
Diffstat (limited to 'mkuid.sh')
-rwxr-xr-x | mkuid.sh | 20 |
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 | |||
3 | echo "extracting UID_MIN and GID_MIN" | ||
4 | echo "#ifndef FIREJAIL_UIDS_H" > uids.h | ||
5 | echo "#define FIREJAIL_UIDS_H" >> uids.h | ||
6 | |||
7 | if [ -f /etc/login.defs ] | ||
8 | then | ||
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 | ||
14 | else | ||
15 | echo "// using default values" >> uids.h | ||
16 | echo "#define UID_MIN 1000" >> uids.h | ||
17 | echo "#define GID_MIN 1000" >> uids.h | ||
18 | fi | ||
19 | |||
20 | echo "#endif" >> uids.h | ||