setup_chroot.sh does not copy file /lib/libnss_files.so.2

Bug #620019 reported by Chad Armstrong
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
scponly (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: scponly

I was getting the "connection closed" problem from SFTP clients until i copied libnss_files.so.2 to the chroot lib directory.

Ubuntu 10.04 LTS
scponly 4.8-4

Revision history for this message
Zeljko Lajic (mrzack) wrote :

Bug reproduced. I made a quick fix.
copy/paste the snip below to "setup_chroot.patch" file and apply with "patch -p0 < setup_chroot.patch"

Tested on Ubuntu 10.04 LTS

<snip>
--- /usr/share/doc/scponly/setup_chroot/setup_chroot.sh 2010-08-20 10:35:17.952660599 +0200
+++ setup_chroot.sh 2010-08-20 10:40:35.892684331 +0200
@@ -95,6 +95,11 @@
        LIB_LIST="$LIB_LIST /lib/libnss_compat*"
 fi

+/bin/ls /lib/libnss_files* > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+ LIB_LIST="$LIB_LIST /lib/libnss_files*"
+fi
+
 # check that the configure options are correct for chrooted operation:

 if [ xscponlyc = x ] || [ ! -f ./config.h ]; then
</snip>

Revision history for this message
Kurt Huwig (k-huwig) wrote :

I can confirm the bug and fix on 10.04 amd64

Revision history for this message
trolley (marktrolley) wrote :

Bug exists on 10.10 as well.

Revision history for this message
Rudolf Leitgeb (rudolf-leitgeb) wrote :

I can confirm this bug under Ubuntu 10.10. Before I copied libnss_files from /lib to the $chroot/lib, scp and sftp would not work. Please to produce an updated package, as this is highly annoying and has been reported a long time ago. I'd produce an updated package in a whim but wonder who would trust it ....

So for all those who want to use scponlyc and get the following error: "user xyz not found" with xyz being the user ID of the chroot user, do the following under Ubuntu 10.10:

sudo cp /lib/libnss_files-2.12.1.so $chroot/lib
cd $chroot/lib
sudo ln -s libnss_files-2.12.1.so libnss_files.so.2

with $chroot set to your chroot root directory.

Revision history for this message
lagerimsi (lagerimsi) wrote :

still exists in 11.04 (server 32bit)

patch doesn't work!

fix it:

sudo cp /lib/i386-linux-gnu/libnss_files-2.13.so $chroot/lib/i386-linux-gnu/

cd $chroot/lib/i386-linux-gnu/

sudo ln -s libnss_files-2.13.so libnss_files.so.2

with $chroot set to your chroot root directory

Revision history for this message
scoopex (ms-ubuntu) wrote :

Downloaded and installed https://launchpad.net/ubuntu/precise/amd64/scponly-full/4.8-4.1

"cp /lib/x86_64-linux-gnu/libnss_files.so.2 /home/scponly/lib/x86_64-linux-gnu/" solved the problem.

SCPONLY not seems to be part of ubuntu anymore - missing it.
Probably there is a better solution for this by using a apparmor profile?

Revision history for this message
Phillip Susi (psusi) wrote :

This package has been removed from Ubuntu. Closing all related bugs.

Changed in scponly (Ubuntu):
status: New → Invalid
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.