Bug 972

Summary: Xprint installs outside of ProjectDir when NothingOutsideProjectRoot is YES
Product: xorg Reporter: Kevin E. Martin <kem>
Component: ReleaseAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: ajax, krh, roland.mainz
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 351    
Attachments:
Description Flags
Patch to fix initscript symlinks for Red Hat systems
none
New patch for initscript installation
none
Patch to prevent installation outside ProjectRoot none

Description Kevin E. Martin 2004-08-02 18:29:35 UTC
NothingOutsideProjectRoot is supposed to disable installing anything outside of
the ProjectRoot, but Xprint does not obey this define.  On my Red Hat Linux
system, it tries to install files outside of the ProjectRoot.  See log below.

make[6]: Entering directory
`/usr/src/kem/build/xorg/xc/programs/Xserver/Xprint/etc/init.d'
install -c -m 0755 xprint /etc/init.d/xprint
install: cannot create regular file `/etc/init.d/xprint': Permission denied
make[6]: *** [install] Error 1
echo "# Installing /etc/init.d links for RedHat Linux(-like)"
# Installing /etc/init.d links for RedHat Linux(-like)
ln: creating symbolic link `/etc/rc.d/rc0.d/K61xprint' to `/etc/init.d/xprint':
Permission denied
make[6]: *** [install] Error 1
install in programs/Xserver/Xprint/etc/init.d done
make[6]: Leaving directory
`/usr/src/kem/build/xorg/xc/programs/Xserver/Xprint/etc/init.d'
installing in programs/Xserver/Xprint/etc/profile.d...
make[6]: Entering directory
`/usr/src/kem/build/xorg/xc/programs/Xserver/Xprint/etc/profile.d'
install -c -m 0755 xprint.csh /etc/profile.d/xprint.csh
install: cannot create regular file `/etc/profile.d/xprint.csh': Permission denied
make[6]: *** [install] Error 1
install -c -m 0755 xprint.sh /etc/profile.d/xprint.sh
install: cannot create regular file `/etc/profile.d/xprint.sh': Permission denied
make[6]: *** [install] Error 1
install in programs/Xserver/Xprint/etc/profile.d done
make[6]: Leaving directory
`/usr/src/kem/build/xorg/xc/programs/Xserver/Xprint/etc/profile.d'
installing in programs/Xserver/Xprint/etc/Xsession.d...
make[6]: Entering directory
`/usr/src/kem/build/xorg/xc/programs/Xserver/Xprint/etc/Xsession.d'
+ mkdir -p /etc/X11/Xsession.d
mkdir: cannot create directory `/etc/X11/Xsession.d': Permission denied
make[6]: *** [install] Error 1
install -c -m 0755 cde_xsessiond_xprint.sh
/etc/X11/xinit/xinitrc.d/92xprint-xpserverlist.sh
install: cannot create regular file
`/etc/X11/xinit/xinitrc.d/92xprint-xpserverlist.sh': Permission denied
make[6]: *** [install] Error 1
install in programs/Xserver/Xprint/etc/Xsession.d done
make[6]: Leaving directory
`/usr/src/kem/build/xorg/xc/programs/Xserver/Xprint/etc/Xsession.d'
make[5]: *** [install] Error 2
make[5]: Leaving directory `/usr/src/kem/build/xorg/xc/programs/Xserver/Xprint/etc'
make[4]: *** [install] Error 2
make[4]: Leaving directory `/usr/src/kem/build/xorg/xc/programs/Xserver/Xprint'
Comment 1 Adam Jackson 2004-08-02 18:50:05 UTC
*** Bug 907 has been marked as a duplicate of this bug. ***
Comment 2 Kristian Høgsberg 2004-08-05 18:45:36 UTC
Created attachment 581 [details] [review]
Patch to fix initscript symlinks for Red Hat systems

Also, on Red Hat systems the xprint should be installed into /etc/rc.d/init.d
and rc*.d links should be relative links to ../init.d/xprint.
Comment 3 Kevin E. Martin 2004-08-05 21:22:39 UTC
When defining NothingOutsideProjectRoot to YES, should these startup scripts be
installed in ProjectRoot/etc or should they just not be installed at all?
Comment 4 Kristian Høgsberg 2004-08-08 10:31:42 UTC
Created attachment 587 [details] [review]
New patch for initscript installation

Okay, I just went over this with mharris, and learned that on Red Hat systems
we should actually install into /etc/init.d and /etc/rc*.d.  New patch attached
Comment 5 Kevin E. Martin 2004-08-08 11:01:07 UTC
(In reply to comment #4)
> Okay, I just went over this with mharris, and learned that on Red Hat systems
> we should actually install into /etc/init.d and /etc/rc*.d.  New patch attached

I just looked at the patch, and it looks like you've got the links going from
/etc/rc*.d/{SK}61xprint to ../xprint instead of ../init.d/xprint.

We still need to resolve how to handle the main problem here which is to either
get these scripts installed in ProjectRoot or not at all, when
NothingOutsideProjectRoot is YES.
Comment 6 Kristian Høgsberg 2004-08-08 12:12:58 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Okay, I just went over this with mharris, and learned that on Red Hat systems
> > we should actually install into /etc/init.d and /etc/rc*.d.  New patch attached
> 
> I just looked at the patch, and it looks like you've got the links going from
> /etc/rc*.d/{SK}61xprint to ../xprint instead of ../init.d/xprint.

Argh, you're right, should be ../init.d/xprint.

> We still need to resolve how to handle the main problem here which is to either
> get these scripts installed in ProjectRoot or not at all, when
> NothingOutsideProjectRoot is YES.

Yep, that's the main issue.  I think it makes sense to install the scripts in
$ProjectRoot/etc.  It may not work out of the box, but it leaves the user the
option of moving the files into /etc or create the links by hand.
Comment 7 Kevin E. Martin 2004-08-08 12:23:42 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > We still need to resolve how to handle the main problem here which is to either
> > get these scripts installed in ProjectRoot or not at all, when
> > NothingOutsideProjectRoot is YES.
> 
> Yep, that's the main issue.  I think it makes sense to install the scripts in
> $ProjectRoot/etc.  It may not work out of the box, but it leaves the user the
> option of moving the files into /etc or create the links by hand.

Yes, I think this is probably the best way to go.  Here is a summary of what
Roland and I have been talking about in e-mail...

I see three ways to handle this bug:

1. When NothingOutsideProjectRoot is YES, install the scripts under
ProjectRoot/etc.  To make it clear to the sysadmin, a note could be added that
the scripts installed there should be included in the system's rc.d init scripts.
2. Don't install any init scripts when NothingOutsideProjectRoot is YES.
3. Create a new program that allows users to start Xprint on their own (Roland
described one way to do this in his e-mail, which he can expand upon here if he
chooses to go that way).

Solutions #1 and #2 are fairly straightforward.

Solution #3 is much more work and is starting to look like a new feature, but
since the current installation is broken and cannot ship the way it is, I would
still consider adding the changes to for this release.  However, if solution #3
is chosen, please submit it as a patch to bug 972 so that the changes can get
proper review.

Roland, pleaes feel free to follow up here instead of the private e-mail so that
others can benefit and comment on our discussion.
Comment 8 Kristian Høgsberg 2004-08-11 10:12:30 UTC
Created attachment 605 [details] [review]
Patch to prevent installation outside ProjectRoot

The attached patch fixes Xprint/etc/*/Imakefile so they don't try to install in
/etc if NothingOutsideProject root is set.  If it set, they install in
ProjectRoot/etc instead.
Comment 9 Kevin E. Martin 2004-08-11 12:47:43 UTC
Kristian, yes, that looks good.
Comment 10 Kristian Høgsberg 2004-08-11 13:23:19 UTC
Patch committed, closing bug.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.