🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

4 total messages Started by root Fri, 11 Jul 1986 19:07
Symlink() bug
#313
Author: root
Date: Fri, 11 Jul 1986 19:07
32 lines
1205 bytes
Subject: symlink bug
Index:	sys/sys3.c 2.9bsd

Description:
	Symlink() always creates a link to "something", even if the original
	file doesn't exist.

Repeat-By:
	ln -s xxx xxx [presto, a "funny" xxx file is created.]
	[Fortunately, nothing "fatal" happens.  Attempts to look at the
	file gives EWOULDBLOCK.]

Fix:
	In sys/sys3.c, function symlink(), after the line

		uap = (struct a *)u.u_ap;

	add

		ip = namei(uchar, LOOKUP, 1);
		if (ip == NULL)
			return;

	This is the exact same way link() does it in sys/sys2.c.

	Kevin W. Thomas
	Univ. of Oklahoma
	School of Meteorology
	Norman, OK

UUCP:	...!ihnp4!okstate!uokvax!uokmet!kwthomas
Re: Symlink() bug
#314
Author: ddl
Date: Sun, 13 Jul 1986 23:01
19 lines
1218 bytes
In article <1500018@uokmet.UUCP>, root@uokmet.UUCP writes:
> 
> Subject: symlink bug
> Index:	sys/sys3.c 2.9bsd
> 
> Description:
> 	Symlink() always creates a link to "something", even if the original
> 	file doesn't exist.
> 
	This is not a bug; do not apply the fix shown.  It is often
necessary/useful to create symlinks to files that do not (yet) exist.
We do it all the time for log files which can be removed by cron.  In
any event, the proposed fix would not prevent symlinks which point
at nothing as it is still possible to remove the pointed-to file
after the fact.  If you are really worried about this, modify ln(1)
to check for the source file, but don't bother posting the change.

					Dan Lanciani
					ddl@harvard.*
Re: Symlink() bug
#315
Author: chris
Date: Mon, 14 Jul 1986 00:28
19 lines
1080 bytes
In article <1500018@uokmet.UUCP> root@uokmet.UUCP writes:
>Description:
>	Symlink() always creates a link to "something", even if the original
>	file doesn't exist.

This is not a bug.

>Fix:
>	add
>		ip = namei(uchar, LOOKUP, 1);
>		if (ip == NULL)
>			return;

You had better iput() the inode afterward---not that you should be
checking for existence of the `destination' string in the first place.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@mimsy.umd.edu
Re: Symlink() bug
#317
Author: root
Date: Tue, 15 Jul 1986 17:53
11 lines
1053 bytes
I just discovered that the "bug fix" now creates major problems.  Accessing
the symbolic link cause the process to HANG ("ps" shows "inode").  It
looks like perhaps things like "iupdat" and "prele" may need to be called.
If anyone knows the specifics on this, let me (and the rest of the 2bsd
world) know, so the original problem can be fixed once and for all.

In the mean time, DON'T use the bug fix.

	Kevin W. Thomas
UUCP: ihnp4!okstate!uokvax!uokmet!kwthomas
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads