SHA256
1
0
forked from pool/texlive

Make mktexlsr work even in root's home

OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive?expand=0&rev=387
This commit is contained in:
Dr. Werner Fink 2021-04-13 08:53:15 +00:00 committed by Git OBS Bridge
parent 23eb405cbc
commit 9b9218ef73
2 changed files with 16 additions and 0 deletions

View File

@ -127,6 +127,7 @@ int main(int argc, char *argv[])
if (ruid == 0 || euid == 0) { /* If user is root switch over to mktex:mktex */
int initgrp = 0;
char *cwd;
if ((pwd = getpwnam(TEXUSR)) == (struct passwd*)0)
goto err;
@ -171,6 +172,15 @@ int main(int argc, char *argv[])
setenv(ep->name, ep->value, 1);
}
if ((cwd = getcwd(NULL, 0))) {
if (access(cwd, X_OK) < 0) {
int ret = chdir(pwd->pw_dir);
if (ret < 0)
fprintf(stderr, "public: %m\n");
}
free(cwd);
}
} else if (rgid != grp->gr_gid && egid == grp->gr_gid) {
rgid = grp->gr_gid;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Apr 13 08:50:31 UTC 2021 - Dr. Werner Fink <werner@suse.de>
- Make public wrapper change into mktex home directory if current
directory is not accessible
-------------------------------------------------------------------
Mon Apr 12 12:41:38 UTC 2021 - Dr. Werner Fink <werner@suse.de>