SHA256
1
0
forked from pool/texlive

Introduce a user mktex as replacement for user nobody (boo#1159740)

OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive?expand=0&rev=345
This commit is contained in:
Dr. Werner Fink 2020-01-31 12:37:27 +00:00 committed by Git OBS Bridge
parent 149656bff8
commit c184a6766a
4 changed files with 19 additions and 7 deletions

View File

@ -17,9 +17,9 @@
.\"
.TH NOBODY 8 "Apr 27, 2012" "" "Linux System Administrator's Manual"
.SH NAME
public \- for user root run specific TeX programs as user \fInobody\fP
public \- for user root run specific TeX programs as user \fImktex\fP
.br
public \- for all users run specific TeX programs as group \fIpublic\fP
public \- for all users run specific TeX programs as group \fImktex\fP
.SH SYNOPSIS
.B public
.RB \->\ [ texhash | mktexlsr | mktexmf | mktexpk | mktextfm ]

View File

@ -1,5 +1,5 @@
/*
* Public For user root run a specific program as user nobody
* Public For user root run a specific program as user mktex
* for user root and others use group public and umask 0002
*
* Usage: public -> [texhash|mktexlsr|mktexmf|mktexpk|mktextfm]
@ -36,7 +36,10 @@
#include <sys/stat.h>
#ifndef TEXGRP
# define TEXGRP "public"
# define TEXGRP "mktex"
#endif
#ifndef TEXUSR
# define TEXUSR "mktex"
#endif
#ifndef MKTEX
# define "/usr/lib/mktex"
@ -122,10 +125,10 @@ int main(int argc, char *argv[])
if ((grp = getgrnam(TEXGRP)) == (struct group*)0)
goto err;
if (ruid == 0 || euid == 0) { /* If user is root switch over to nobody:public */
if (ruid == 0 || euid == 0) { /* If user is root switch over to mktex:mktex */
int initgrp = 0;
if ((pwd = getpwnam("nobody")) == (struct passwd*)0)
if ((pwd = getpwnam(TEXUSR)) == (struct passwd*)0)
goto err;
if (ruid != pwd->pw_uid)

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jan 31 12:32:25 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Introduce a user mktex as replacement for user nobody (boo#1159740)
-------------------------------------------------------------------
Thu Jan 16 10:41:17 UTC 2020 - Dr. Werner Fink <werner@suse.de>

View File

@ -312,7 +312,9 @@ Obsoletes: pdfjam < %{version}
%define _appdefdir %{_x11data}/app-defaults
#
%define texgrp mktex
%define texusr mktex
#%define texgid 505
#%define texuid 505
#
%description
After installing texlive and the package texlive-latex, find a large
@ -3932,7 +3934,7 @@ fi
# compile public
mkdir -p ${prefix}/lib/mktex
$CC ${RPM_OPT_FLAGS} -DTEXGRP='"%{texgrp}"' -DMKTEX='"%{_libexecdir}/mktex"' -fPIE -pie -o ${prefix}/lib/mktex/public %{S:50}
$CC ${RPM_OPT_FLAGS} -DTEXGRP='"%{texgrp}"' -DTEXUSR='"%{texusr}"' -DMKTEX='"%{_libexecdir}/mktex"' -fPIE -pie -o ${prefix}/lib/mktex/public %{S:50}
# install our own scripts
mkdir -p ${prefix}/bin
@ -4279,6 +4281,7 @@ fi
%pre kpathsea-bin
%{_bindir}/getent group %{texgrp} > /dev/null 2>&1 || %{_sbindir}/groupadd -r %{?texgid:-g %texgid} %{texgrp}
%{_bindir}/getent group %{texusr} > /dev/null 2>&1 || %{_sbindir}/useradd -r %{?texuid:-u %texuid} -g %{texgrp} -d %{_fontcache} -s /bin/false %{texusr}
%post kpathsea-bin
%if %{defined set_permissions}
@ -4287,6 +4290,7 @@ fi
%pre
%{_bindir}/getent group %{texgrp} > /dev/null 2>&1 || %{_sbindir}/groupadd -r %{?texgid:-g %texgid} %{texgrp}
%{_bindir}/getent group %{texusr} > /dev/null 2>&1 || %{_sbindir}/useradd -r %{?texuid:-u %texuid} -g %{texgrp} -d %{_fontcache} -s /bin/false %{texusr}
%post
mkdir -p /var/run/texlive