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:
parent
23eb405cbc
commit
9b9218ef73
10
public.c
10
public.c
@ -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;
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user