Bug 28318

Summary: vnc-server starts VNC in root directory, not home directory
Product: [Retired] Red Hat Linux Reporter: David Konerding <dek>
Component: vncAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-06-05 09:19:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/etc/init.d/vncserver none

Description David Konerding 2001-02-19 16:50:11 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.73 [en] (Win98; U)


starting the vnc-server at boot time for a user starts VNC in the root (/) directory, rather than the user's
home directory.  Whenever a user connects to the VNC server and opens a shell, it will open in
/ (I'm using fvwm2 as my window managed and rxvt as my shell) rather than the user's hme dir.

Reproducible: Always
Steps to Reproduce:
install vnc and vnc-server.  edit /etc/sysconfig/vncservers to add a user.  Start vnc using /etc/rc.d/init.d/vnc start.
Then, connect to the VNC session and start a shell.
This problem isn't exhibited with GNOME or KDE shells, presumably because they try to cd to the user's home
dir when they start.

Actual Results:  The rxvt shell starts in / instead of ~.


Expected Results:  VNC should be started from the user's home directory.  Any application that it started but
does not cd to the home dir will run from the root directory.

Comment 1 Tim Waugh 2001-02-19 22:29:01 UTC
Thanks for the report.  Please try out the attached replacement for
/etc/init.d/vncserver.  'service vncserver stop' should also now work.

Comment 2 Tim Waugh 2001-02-19 22:29:26 UTC
Created attachment 10420 [details]
/etc/init.d/vncserver

Comment 3 Tim Waugh 2001-02-20 16:19:43 UTC
Fixed in 3.3.3r2-14.

Comment 4 Curtis Doty 2001-06-04 19:39:32 UTC
But the initscript still starts up in /root as evident by the message 
syslogged 'su: bash: /root/.bashrc: Permission denied'. Here's how I worked 
around:

--- vncserver-3.3.3r2-14        Mon Feb 19 10:27:06 2001
+++ vncserver   Mon Jun  4 12:30:22 2001
@@ -26,7 +26,7 @@
     do
         echo -n "${display} "
         initlog $INITLOG_ARGS -c \
-            "su ${display##*:} -c \"cd && [ -f .vnc/passwd ] && 
vncserver :${display%%:*}\""
+            "su ${display##*:} -c \"cd ~${display##*:} && [ -f .vnc/passwd ] 
&& vncserver :${display%%:*}\""
         RETVAL=$?
         [ "$RETVAL" -ne 0 ] && break
     done

Comment 5 Tim Waugh 2001-06-05 13:18:18 UTC
Patch applied in 3.3.3r2-16.  Thanks.