Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* touch symbolic links
@ 2000-03-15 21:17 Dan Schult
  2000-03-15 23:13 ` Cameron Simpson
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Schult @ 2000-03-15 21:17 UTC (permalink / raw)
  To: axp-list

I had a problem with dates when I first installed Linux on 
an XP1000.  The hardware clock was off by 48 years, and the
system kept getting reset to that time upon boot (as it should).
I have now fixed that problem based on a posting from Dec 1999
to this list.  Now I just need to correct all the files that
have been given dates in the future.

I hacked a bash script to touch the files with the corrected dates
but I can't touch the symbolic links.  

==============
Can someone explain how to change the timestamp on a symbolic link?   
==============

It seems like it has to be possible.  
If not, I may have to resort to recreating the links...   

Dan Schult
dschult@colgate.edu


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: touch symbolic links
  2000-03-15 21:17 touch symbolic links Dan Schult
@ 2000-03-15 23:13 ` Cameron Simpson
  0 siblings, 0 replies; 3+ messages in thread
From: Cameron Simpson @ 2000-03-15 23:13 UTC (permalink / raw)
  To: axp-list

On Wed, Mar 15, 2000 at 04:17:21PM -0500, Dan Schult wrote:
| I had a problem with dates when I first installed Linux on 
| an XP1000.  The hardware clock was off by 48 years, and the
| system kept getting reset to that time upon boot (as it should).
| I have now fixed that problem based on a posting from Dec 1999
| to this list.  Now I just need to correct all the files that
| have been given dates in the future.
| 
| I hacked a bash script to touch the files with the corrected dates
| but I can't touch the symbolic links.  
| 
| ==============
| Can someone explain how to change the timestamp on a symbolic link?   
| ==============
| 
| It seems like it has to be possible.  

It's not.

| If not, I may have to resort to recreating the links...   

This is the correct approach.

On some systems symlinks aren't even separate objects but merely
special directory entries (thus no inode, no perms, no ownership etc).
Almost every system call follows symlinks, including things like chown
and chmod. While this makes a certain warped sense because nothing you
do to perms on a symlink will really affect security (since you can
always just use the path the link uses direct), I think it's horrible.
IMHO, the only system calls which should follow symlinks are stat, open
and chdir.

Then you could do the old "chmod -R" etc without fear of a rogue symlink.
Instead one has to say uglinesses like
	find . ! -type l -exec chown blah {} ';'
to avoid treading on things outside the namespace. Very grody.

Cheers,
-- 
Cameron Simpson, DoD#743        cs@zip.com.au    http://www.zip.com.au/~cs/

WHAT is your name?                           Captain Jean-Luc Picard
WHAT is your quest?                            I seek the Holy Grail
WHAT is the top velocity of a Bird of Prey?      Romulan or Klingon?
I....I don't know...AAAHHHH!!!!
	- Mike Gaines, meg5184@hertz.njit.edu


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: touch symbolic links
@ 2000-03-15 23:30 cpg
  0 siblings, 0 replies; 3+ messages in thread
From: cpg @ 2000-03-15 23:30 UTC (permalink / raw)
  To: axp-list

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]



On 03/15/2000 09:17:21 PM GMT Dan Schult wrote:
>
>If not, I may have to resort to recreating the links...

I once had the same problem. I've written a small
perl script which does exactly that. Simply feed
it the links you want to touch, e.g.

find / /usr -xdev -type l -print | touchlinks.pl

I don't know what it does (didn't dare to try), when
going into proc and messing with the links there.
So the explicit mount points and -xdev as the argument
to find.

regards,
chris


(See attached file: touchlinks.pl.gz)

[-- Attachment #2: touchlinks.pl.gz --]
[-- Type: application/octet-stream, Size: 646 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-03-15 23:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-03-15 21:17 touch symbolic links Dan Schult
2000-03-15 23:13 ` Cameron Simpson
  -- strict thread matches above, loose matches on Subject: below --
2000-03-15 23:30 cpg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox