initial script directory is always /root

Bug #235468 reported by Andreas Hasenack
4
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
Low
Thomas Herve
Landscape Server
Fix Released
Low
Thomas Herve

Bug Description

Whatever script is sent to a computer, the initial directory for it is always /root, independent of the user running the script.

The initial directory should be the target user's home directory, and if that is not available or some error occurs, then it should be /tmp.

Changed in landscape:
assignee: nobody → radix
importance: Undecided → Low
milestone: none → mthood+1
Revision history for this message
Thomas Herve (therve) wrote :

The reported problem is fixed: we change to the user directory if it exists, or change to / (as login does).

Changed in landscape:
milestone: mthood+1 → mthood-post-2
Changed in landscape:
milestone: mthood-post-2 → mthood-post-2a
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

- self.process_factory.spawnProcess(pp, filename, uid=uid, gid=gid)
+ self.process_factory.spawnProcess(pp, filename, uid=uid, gid=gid,
+ path=path)

Via experimentation, I ended up as a regular user inside /root under these conditions:

- /home/andreas is for some reason unreachable (I used 0000 for /home/andreas to see what would happen)
- /root is 0700, owned by root:root

The script I asked to run as andreas is:
id
echo "pwd = $(pwd)"
ls -lad /home/andreas /root

And this is the response:
uid=1000(andreas) gid=1000(andreas) groups=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),107(fuse),111(lpadmin),112(admin),1000(andreas)
pwd = /home/andreas
d--------- 2 andreas andreas 4096 Jun 11 11:47 /home/andreas
drwx------ 4 root root 4096 Jun 13 12:05 /root

The desired response would be to run the script in "/" in this case.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Never mind the previous posting, it actually ended up inside /home/andreas and worked as expected. For some reason I thought it ended up in /root again.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

QA +1

Changed in landscape-client:
assignee: nobody → therve
importance: Undecided → Low
status: New → In Progress
Changed in landscape:
assignee: radix → therve
status: New → In Progress
Revision history for this message
Christopher Armstrong (radix) wrote :

Thanks very much for refactoring test_user.

+1

Revision history for this message
Jamu Kakar (jkakar) wrote :

[1]

+ return self._run_script("user", 1234, 5678, "/")

There's an extra space between 'return' and 'self._...'.

+1!

Thomas Herve (therve)
Changed in landscape-client:
status: In Progress → Fix Committed
Changed in landscape:
status: In Progress → Fix Committed
Changed in landscape:
status: Fix Committed → Fix Released
Changed in landscape-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.