LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-23-2014, 11:28 AM   #1
rperlberg
LQ Newbie
 
Registered: May 2006
Posts: 18

Rep: Reputation: 0
000 permissions on symbolic links


We're using rsync to copy files into an existing directory structure which includes symbolic links. After the copy, the permissions on the symlinks are changed to 000: "l---------". To the best of my understanding, this shouldn't even be possible. What's happening and how can we stop it?
 
Old 04-23-2014, 06:53 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,636
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
A symlink is basically a tiny file with a filename in it. I don't think that its permissions matter anyway. It's an indirect reference to a file, and either you can open that file or you can't.
 
Old 04-24-2014, 09:49 AM   #3
rperlberg
LQ Newbie
 
Registered: May 2006
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sundialsvcs View Post
A symlink is basically a tiny file with a filename in it. I don't think that its permissions matter anyway. It's an indirect reference to a file, and either you can open that file or you can't.
Incorrect. It is preventing us from following the link.
 
Old 05-04-2014, 08:21 PM   #4
DJ Shaji
Member
 
Registered: Dec 2004
Location: Yo Momma's house
Distribution: Fedora Rawhide, ArchLinux
Posts: 518
Blog Entries: 15

Rep: Reputation: 106Reputation: 106
Because the files the symlinks link to don't exist anymore. Symlinks don't have permissions. Dead ones do. The files the links refer to are no longer in their original location. Make the symlinks relative rather than absolute.
 
Old 05-05-2014, 07:21 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,636
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
Don't be so quick to brand a very-correct answer as "incorrect" merely because you do not yet understand it.

First of all, remember that there are two kinds of links: "hard" and "soft" (or "symbolic"). The latter is what I was referring to. A "hard" link is an additional reference to the same underlying file-system data structure (the so-called inode), which will not actually go-away until all of the hard-links are gone. But a "symbolic" link has no skin in the game. If the file(name) to which it refers is moved or changed in any way, the symbolic link becomes "broken" and can no longer be followed. The symbolic-links are not tracked and will not be updated in that case.

"Symbolic links" are, just as I/we said, "tiny files with file-names in them, flagged to the filesystem as being 'a symbolic link.'" The filesystem will silently follow that chain of filenames ("de-reference" the symbolic link ...) a certain number of times until it either: finds a file, finds a circular reference, or gives up. It will speak to you throughout in terms of the symbolic-link name, not its so-called "target," since the link is what you asked to open and the target is malleable.

You can't "protect" a symlink, and you can't keep the curious from finding out the name of the eventual target. Permissions for "hard" links are, IIRC, actually maintained at the inode level.

Last edited by sundialsvcs; 05-05-2014 at 07:23 AM.
 
Old 10-26-2016, 07:04 AM   #6
rperlberg
LQ Newbie
 
Registered: May 2006
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sundialsvcs View Post
Don't be so quick to brand a very-correct answer as "incorrect" merely because you do not yet understand it.
I understand the situation better than you do. Symbolic links definitely do have permissions of their own apart from the target file, whether or not it exists.

I still don't know what is causing the symlinks to be created with 000 permissions, but I found out how to fix it. "chmod -h".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Symbolic Links Permissions Unique Problem! tliggins Programming 3 02-21-2011 11:30 AM
symbolic links directories access and permissions goncalopp Linux - Security 2 05-07-2009 12:28 PM
Symbolic links Vs Hard links sulekha Linux - General 2 10-02-2008 07:03 AM
symbolic links and permissions jcai Linux - Newbie 2 06-09-2006 03:37 PM
symbolic links winger Linux - General 5 04-06-2002 05:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration