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:
parent
149656bff8
commit
c184a6766a
4
public.8
4
public.8
@ -17,9 +17,9 @@
|
|||||||
.\"
|
.\"
|
||||||
.TH NOBODY 8 "Apr 27, 2012" "" "Linux System Administrator's Manual"
|
.TH NOBODY 8 "Apr 27, 2012" "" "Linux System Administrator's Manual"
|
||||||
.SH NAME
|
.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
|
.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
|
.SH SYNOPSIS
|
||||||
.B public
|
.B public
|
||||||
.RB \->\ [ texhash | mktexlsr | mktexmf | mktexpk | mktextfm ]
|
.RB \->\ [ texhash | mktexlsr | mktexmf | mktexpk | mktextfm ]
|
||||||
|
11
public.c
11
public.c
@ -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
|
* for user root and others use group public and umask 0002
|
||||||
*
|
*
|
||||||
* Usage: public -> [texhash|mktexlsr|mktexmf|mktexpk|mktextfm]
|
* Usage: public -> [texhash|mktexlsr|mktexmf|mktexpk|mktextfm]
|
||||||
@ -36,7 +36,10 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#ifndef TEXGRP
|
#ifndef TEXGRP
|
||||||
# define TEXGRP "public"
|
# define TEXGRP "mktex"
|
||||||
|
#endif
|
||||||
|
#ifndef TEXUSR
|
||||||
|
# define TEXUSR "mktex"
|
||||||
#endif
|
#endif
|
||||||
#ifndef MKTEX
|
#ifndef MKTEX
|
||||||
# define "/usr/lib/mktex"
|
# define "/usr/lib/mktex"
|
||||||
@ -122,10 +125,10 @@ int main(int argc, char *argv[])
|
|||||||
if ((grp = getgrnam(TEXGRP)) == (struct group*)0)
|
if ((grp = getgrnam(TEXGRP)) == (struct group*)0)
|
||||||
goto err;
|
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;
|
int initgrp = 0;
|
||||||
|
|
||||||
if ((pwd = getpwnam("nobody")) == (struct passwd*)0)
|
if ((pwd = getpwnam(TEXUSR)) == (struct passwd*)0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (ruid != pwd->pw_uid)
|
if (ruid != pwd->pw_uid)
|
||||||
|
@ -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>
|
Thu Jan 16 10:41:17 UTC 2020 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
@ -312,7 +312,9 @@ Obsoletes: pdfjam < %{version}
|
|||||||
%define _appdefdir %{_x11data}/app-defaults
|
%define _appdefdir %{_x11data}/app-defaults
|
||||||
#
|
#
|
||||||
%define texgrp mktex
|
%define texgrp mktex
|
||||||
|
%define texusr mktex
|
||||||
#%define texgid 505
|
#%define texgid 505
|
||||||
|
#%define texuid 505
|
||||||
#
|
#
|
||||||
%description
|
%description
|
||||||
After installing texlive and the package texlive-latex, find a large
|
After installing texlive and the package texlive-latex, find a large
|
||||||
@ -3932,7 +3934,7 @@ fi
|
|||||||
|
|
||||||
# compile public
|
# compile public
|
||||||
mkdir -p ${prefix}/lib/mktex
|
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
|
# install our own scripts
|
||||||
mkdir -p ${prefix}/bin
|
mkdir -p ${prefix}/bin
|
||||||
@ -4279,6 +4281,7 @@ fi
|
|||||||
|
|
||||||
%pre kpathsea-bin
|
%pre kpathsea-bin
|
||||||
%{_bindir}/getent group %{texgrp} > /dev/null 2>&1 || %{_sbindir}/groupadd -r %{?texgid:-g %texgid} %{texgrp}
|
%{_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
|
%post kpathsea-bin
|
||||||
%if %{defined set_permissions}
|
%if %{defined set_permissions}
|
||||||
@ -4287,6 +4290,7 @@ fi
|
|||||||
|
|
||||||
%pre
|
%pre
|
||||||
%{_bindir}/getent group %{texgrp} > /dev/null 2>&1 || %{_sbindir}/groupadd -r %{?texgid:-g %texgid} %{texgrp}
|
%{_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
|
%post
|
||||||
mkdir -p /var/run/texlive
|
mkdir -p /var/run/texlive
|
||||||
|
Loading…
Reference in New Issue
Block a user