Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 690046 - net-misc/tigervnc: cannot start user-server when user-home is on nfs and not readable by root
Summary: net-misc/tigervnc: cannot start user-server when user-home is on nfs and not ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal trivial (vote)
Assignee: Viorel Munteanu
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2019-07-17 07:13 UTC by Manuel Mommertz
Modified: 2022-04-03 10:02 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix tigervnc initskript to work with home on nfs (tigervnc_initd.patch,508 bytes, patch)
2021-02-16 07:04 UTC, Manuel Mommertz
Details | Diff
Fix to handle non-existing users (tigervnc_initd.patch,508 bytes, patch)
2021-02-17 06:52 UTC, Manuel Mommertz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Mommertz 2019-07-17 07:13:03 UTC
In /etc/init.d/tigervnc the checkconfig function fails if it cannot find ~user/.vnc/passwd. But this may also happen when the user doesn't allow access for other users and has his home on an nfs-server which maps root to nobody.

To fix it the test should be run as the corresponding user. Patch attached.
Comment 1 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2021-02-15 05:00:48 UTC
If this is still reproducible, I'm not sure if this would be a Gentoo problem or an upstream problem. If upstream's sources can reproduce then a bug should be filed upstream. Of course if their sources can't reproduce then please reopen this bug.
Comment 2 Manuel Mommertz 2021-02-16 07:04:47 UTC
Created attachment 686853 [details, diff]
Fix tigervnc initskript to work with home on nfs
Comment 3 Manuel Mommertz 2021-02-16 07:06:31 UTC
Seems I forgot to attach the patch... Sorry, fixed :)

The problem exists in /etc/init.d/tigervnc which is not present upstream. So no way to fix this in upstream. ;)
Comment 4 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2021-02-16 17:05:04 UTC
I'm not sure this patch works as expected, the condition always fails even if the user doesn't exist (when it should succeed when the user exists so it fails into the `if`).

~ $ runuser -l "user" -c "[ ! -f ~/.vnc/passwd ]"  || echo "false"
pass
~ $ runuser -l "notauser" -c "[ ! -f ~/.vnc/passwd ]"  || echo "false"
runuser: user notauser does not exist or the user entry does not contain all the required fields
pass
Comment 5 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2021-02-16 17:06:30 UTC
(In reply to John Helmert III (ajak) from comment #4)
> I'm not sure this patch works as expected, the condition always fails even
> if the user doesn't exist (when it should succeed when the user exists so it
> fails into the `if`).
> 
> ~ $ runuser -l "user" -c "[ ! -f ~/.vnc/passwd ]"  || echo "false"
> pass
> ~ $ runuser -l "notauser" -c "[ ! -f ~/.vnc/passwd ]"  || echo "false"
> runuser: user notauser does not exist or the user entry does not contain all
> the required fields
> pass

Well, I attempted some editing between what I ran and what I commented and made some typos, so 's/false/pass/'
Comment 6 Manuel Mommertz 2021-02-17 06:52:45 UTC
Created attachment 687063 [details, diff]
Fix to handle non-existing users

You are right! I moved the exclamation mark to the front. I did not redirect stderr to /dev/null, so the user gets a hint that the missing file is not the only problem with the setup. :)
Comment 7 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2021-02-17 18:16:25 UTC
(In reply to Manuel Mommertz from comment #6)
> Created attachment 687063 [details, diff] [details, diff]
> Fix to handle non-existing users
> 
> You are right! I moved the exclamation mark to the front. I did not redirect
> stderr to /dev/null, so the user gets a hint that the missing file is not
> the only problem with the setup. :)

Alright, seems to work better now. I'm working on bumping the package for a number of bugs so if you'll comment your signoff (https://www.gentoo.org/glep/glep-0076.html#certificate-of-origin) I can include it in my bump.
Comment 8 Manuel Mommertz 2021-02-18 06:38:26 UTC
(In reply to John Helmert III (ajak) from comment #7)
> so if you'll comment your signoff I can include it in my bump.

You mean just here? There you go:

Signed-off-by: Manuel Mommertz <2kmm@gmx.de>
Comment 9 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2021-02-19 01:42:33 UTC
(In reply to Manuel Mommertz from comment #8)
> (In reply to John Helmert III (ajak) from comment #7)
> > so if you'll comment your signoff I can include it in my bump.
> 
> You mean just here? There you go:
> 
> Signed-off-by: Manuel Mommertz <2kmm@gmx.de>

Exactly, thank you!
Comment 10 Larry the Git Cow gentoo-dev 2022-04-03 10:02:39 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2bda6cc82caf55afd1f0c5c213f6525cb2d2fd3d

commit 2bda6cc82caf55afd1f0c5c213f6525cb2d2fd3d
Author:     Viorel Munteanu <ceamac.paragon@gmail.com>
AuthorDate: 2022-04-02 06:48:39 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2022-04-03 09:56:23 +0000

    net-misc/tigervnc: Fix bug in init script
    
    cannot start user-server when user-home is on nfs and not readable by
    root
    
    Closes: https://bugs.gentoo.org/690046
    Signed-off-by: Manuel Mommertz <2kmm@gmx.de>
    Signed-off-by: Viorel Munteanu <ceamac.paragon@gmail.com>
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 net-misc/tigervnc/files/tigervnc-1.12.0.initd | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)