Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpio: … Cannot extract through symlink …. #287

Closed
Juronski opened this issue Apr 26, 2018 · 7 comments
Assignees

Comments

@Juronski
Copy link

@Juronski Juronski commented Apr 26, 2018

Mandatory info for bug reports:

FreeBSD version ( uname -a ): 11.1-RELEASE-p9 FreeBSD 11.1-RELEASE-p9

CBSD version ( cbsd version ): 11.1.18

Hi,

After upgrading the system from FreeBSD 10.3 to 11.1 I tried to upgrade the jails with “cbsd jupgrade” but I get “cpio: … Cannot extract through symlink …. ” errors

this is an example of a error-line

cpio: .//bin/rmail: Cannot extract through symlink /usr/jails/jails-data/jailname-data/bin/rmail

“/usr/jails/jails-data” is the symlink to "/tank/jails-data"

Never had this before eg when upgrading from 10.0 to 10.1 and to 10.3. I’m not sure if this is a CBSD issue and I hope someone has a solution.

Thank you in advance.
J.

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Apr 26, 2018

Hi, your environments are configured in the baserw=1 mode?
''cbsd jls display=jname,ver,baserw'
?

@olevole olevole self-assigned this Apr 26, 2018
@Juronski

This comment has been minimized.

Copy link
Author

@Juronski Juronski commented Apr 27, 2018

Hi,
Yes, environment is configured in the baserw=1 mode.
"jailname 11.1 1"
J.

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Apr 27, 2018

Hmm. I suggest you use at the moment default FreeBSD tools: freebsd-update ( https://www.bsdstore.ru/en/11.1.x/wf_jupgrade_ssi.html#freebsd-upgrade ). I'm not sure I can fix it quickly. And maybe it does not make sense anymore:

because at the moment @mekanix works on a new and more universal script for jail updating ( formally, the new script will use freebsd-update for FreeBSD or hbsd-update for HardenedBSD .. to update files).

Also, I plan to make support in the near future for FreeBSD-in-packages update method. E.g, I update my servers through 'pkg': https://pastebin.com/wRQd1NHr

It seems that this is the best and fastest method of updating FreeBSD bases.

So, most likely, we will no longer develop and maintain the old 'jupgrade' script.

@Juronski

This comment has been minimized.

Copy link
Author

@Juronski Juronski commented Apr 27, 2018

Ok. Thank you. Always used the cbsd jupgrade script. Now I use freebsd-update for jailbase-dir and then sudo cbsd jset jname=namejail ver=11.1, restarted the jail and went on with pkg-static etc to upgrade the jailsystem. Flawless . Great!!

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Apr 27, 2018

You're welcome! We will soon update the documentation on the jupgrade in accordance with the latest changes. I will leave this Issue open as a reminder.

@mekanix

This comment has been minimized.

Copy link
Member

@mekanix mekanix commented May 2, 2018

Just a heads up, baseupdate updates all jails and it fails if there's no update (I saw it too late, code was in the release). As baseupdate is not stable, we decided to keep it as a hidden feature until it's mature.

olevole added a commit that referenced this issue Jun 30, 2018
In some cases, the source and target directories can be in the form of symbolic links.
In these cases, symbolic links are not handled correctly by cpio with follow notices:
  cpio: <src>: Cannot extract through symlink <dst>
We must make sure that we always go to the actual real directory before cpio from curdir,
therefore we process src/dst directory by realpath(1).
  Issue #287, Reported by: Juronski. Thanks!
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Jun 30, 2018

@Juronski

“/usr/jails/jails-data” is the symlink to "/tank/jails-data"

^^ it was a very useful remark. We use cpio from current directory. In your case this was not the real path, so I've add realpath(1) in these places. Your situation only occurs when directories use symbolic links. Thanks for reports, fixed via 5a541d8

@olevole olevole closed this Jun 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.