bugJailkit - Bugs: bug #23100, --prefix Problem


bug #23100: --prefix Problem

Submitter:  David Olivier <adadov>
Submitted:  Tue 29 Apr 2008 12:52:00 PM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:
       No canned response available


( Jump to the original submission )

Sat 11 Sep 2010 01:46:31 PM UTC, comment #14: 

thanks, fixed that too

I'll do a new release soon

Olivier Sessink <oli4>
Project Administrator
Sat 11 Sep 2010 01:21:01 PM UTC, comment #13: 

regarding the installation of the .ini files, I just found this in the Makefile.in file:

        ${INSTALL} -d -m 755 ${DESTDIR}${iniprefix}
        for file in ${INIFILES} ; do \
                if [ -f ${iniprefix}$${file} ]; then \
                        ${INSTALL} -m 0644 ini/$${file} ${DESTDIR}${iniprefix}$${file}.dist ;\
                else \
                        ${INSTALL} -m 0644 ini/$${file} ${DESTDIR}${iniprefix} ;\
                fi ;\

Where I guess the if check should probably test for: ${DESTDIR}${iniprefix}$${file} instead of ${iniprefix}$${file}

Sebastian Reitenbach <buzzdee>
Sat 11 Sep 2010 06:24:31 AM UTC, comment #12: 

Thanks for adding those bits too.

As I said, from my point of view, you may leave the .ini files as is. The more annoying parts of this report are fixed for me ;)

Btw: I don't know how often you create new releases, and whether those stuff I reported and that got fixed is worth a new release, but if you plan on releasing sth. in the next few days/weeks, then I'd wait to send my port of jailkit for OpenBSD to others to get it into the ports tree. With a new release, I'd get rid of a lot of patches, and the port would look much cleaner ;)
If not, I'd send what I have this weekend to others for review, and have to update it later when you made a new jailkit release.

Sebastian Reitenbach <buzzdee>
Fri 10 Sep 2010 02:53:56 PM UTC, comment #11: 

sorry, missed that one, applied to cvs now.

still in doubt about the .ini files

Olivier Sessink <oli4>
Project Administrator
Wed 08 Sep 2010 07:44:23 AM UTC, comment #10: 

jk_jailuser has the PREFIX configured, but the Makefile in py subdirectory doesn't update the PREFIX, it only updates the INIPREFIX, LIBDIR, and the PYTHONINTERPRETER, but misses the PREFIX:

sed -e "s!INIPREFIX='/etc/jailkit'!INIPREFIX='${INIPREFIX}'!" \
    -e "s!LIBDIR='[a-z/]*'!LIBDIR='${PYLIBDIR}'!" \
    -e "s:#!/usr/bin/python:#!$(PYTHONINTERPRETER):" < $< > $@

see my patch to the Makefile.in in the latest tarball.
For jk_check see the patch to jk_check.in in the latest tarball.

With the jk_init.ini file, as I said, I'm fine, I can update all the paths to match all the stuff in OpenBSD.

Sebastian Reitenbach <buzzdee>
Tue 07 Sep 2010 09:54:08 PM UTC, comment #9: 

for different versions of the binary the whole problem doesn't exist: the default ini files are not installed anyway if a copy of jailkit exists already somewhere on the disk.

for jk_jailuser: it uses prefix correctly, doesn't it?

jk_check indeed has a hardcoded path left, I overlooked that one.

Olivier Sessink <oli4>
Project Administrator
Tue 07 Sep 2010 12:53:42 PM UTC, comment #8: 

I took a look at the changes. I'm not sure whether making use of the PATH environment variable is the right way to go. It may make things simpler, but may also be a cause of errors. Think of different versions of the binary that you want to get into the chroot jail in the PATH? As far as I can see, it will pick up the first? (I have to admit I haven't tried yet)

For me as a porter, its actually not a problem to update the fully qualified paths in the example jk_init.ini file to make the paths fit for OpenBSD. I'll prefer to use the full path to the binary, just to be sure it picks up the right one every time. I only thought that at least the files that get installed with jailkit should get the right path in the configuration file, since ./configure knows where they end up in the system. I added the ini/Makefile.in and the .ini.in files for all files in the directory, but IIRC the only file that actually gets changed in the end is the jk_init.ini.

And what about the still hardcoded paths in py/jk_check.in and py/jk_jailuser.py?
From the last tarball I updated, there in the jailkit-patch2, the patches to py/Makefile.in, and py/jk_check.in?

Sebastian Reitenbach <buzzdee>
Sun 05 Sep 2010 08:28:38 PM UTC, comment #7: 

I've created a different solution: jk_cp and jk_init can now resolve files using the PATH. So in jk_init.ini you can now just specify 'jk_lsh' without any prefix and, jk_init will resolve it automatically. This will fix the default config file for many more binaries that might have a different location on different platforms.

Do you think that fixes this bug?

Olivier Sessink <oli4>
Project Administrator
Sun 15 Aug 2010 01:46:02 PM UTC, comment #6: 

attached a new tarball. It contains a combined patch, and new contents for the ini directory. Replace the actual ini directory wit the contents of the tarball.

(file #21225)

Sebastian Reitenbach <buzzdee>
Fri 13 Aug 2010 02:26:22 PM UTC, comment #5: 

can you create one diff for your complete jailkit directory in one patch so I can apply the complete patch in one command?

create the patch using

diff -u /path/to/oldjailkit /path/to/newjailkit

Olivier Sessink <oli4>
Project Administrator
Thu 12 Aug 2010 06:58:59 AM UTC, comment #4: 

Updated tarball now with configure.ac. Also fixed a small bug in the jk_init.ini.in file I introduced, and added /bin/ksh to the basicshell section to jk_init.ini.

(file #21202)

Sebastian Reitenbach <buzzdee>
Wed 11 Aug 2010 11:36:25 AM UTC, comment #3: 

The attached tarball allows to makes the ini/*ini files more flexible. The ini/*ini files need to be removed, and then replaced with the ini/*ini.in files from the tarball. The configure script is updated to take the ini/Makefile.in from the tarball into account.

(file #21192)

Sebastian Reitenbach <buzzdee>
Wed 11 Aug 2010 10:11:57 AM UTC, comment #2: 

Attached patches try to fix the --prefix problem at least in the pythong scripts. It is used to fix the PREFIX in py/jk_check.in and py/jk_jailuser.py

The jk_jailuser.py already had a PREFIX defined, but statically which was not changed to match --prefix.

Added the update of PREFIX to the Makefile.in and added a PREFIX statement to the jk_check.in file.

(file #21188, file #21189)

Sebastian Reitenbach <buzzdee>
Thu 01 May 2008 04:08:38 PM UTC, comment #1: 

true. the example jk_init.ini file has the default jailkit prefix. However, it has default values for many more executables, and all of those could be wrong. It is only an example file.

if we're going to fix it we should try to fix it for all the exaple entries.

Olivier Sessink <oli4>
Project Administrator
Tue 29 Apr 2008 12:52:00 PM UTC, original submission:  

If you choose to install jailkit in a custom prefix there is some wrong issues especially for jk_lsh executable. jk_init don't know the right location so it can't copy it to the jail.

I tried to install in the /opt/jailkit prefix and it was searching for /usr/sbin/jk_lsh instead of /opt/jailkit/sbin/jk_lsh.

David Olivier <adadov>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #21225:  jailkit-ini-and-patch.tar.gz added by buzzdee (5KiB - application/gzip - new tarball containing ini directory and patch)
file #21202:  prefix-in-inifiles.tar.gz added by buzzdee (4KiB - application/x-compressed-tar - updated tarball, now with configure.ac)
file #21192:  prefix-for-inifiles.tar.gz added by buzzdee (4KiB - application/x-gzip - tarball addng a Makefile to fix PREFIX and INIPREFIX in ini/*ini files)
file #21188:  patch-py_jk_check_in added by buzzdee (871B - application/octet-stream)
file #21189:  patch-py_Makefile_in added by buzzdee (433B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by buzzdee (Updated the item)
  • -email is unavailable- added by oli4 (Posted a comment)
  • -email is unavailable- added by adadov (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-08-02 oli4 Open/ClosedOpen Closed
    2010-08-15 buzzdee Attached File- Added jailkit-ini-and-patch.tar.gz, #21225
    2010-08-12 buzzdee Attached File- Added prefix-in-inifiles.tar.gz, #21202
    2010-08-11 buzzdee Attached File- Added prefix-for-inifiles.tar.gz, #21192
    2010-08-11 buzzdee Attached File- Added patch-py_jk_check_in, #21188
        Attached File- Added patch-py_Makefile_in, #21189

    Back to the top

    Powered by Savane 3.9