Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jun 1996 13:57:26 +0200
From:      Zahemszky Gabor <zgabor@code.hu>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1314: rmdir(1)/rmdir(2)
Message-ID:  <199606121157.NAA00494@zg.CoDe.hu>
Resent-Message-ID: <199606121210.FAA28270@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1314
>Category:       bin
>Synopsis:       rmdir(1)/rmdir(2)
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 12 05:10:03 PDT 1996
>Last-Modified:
>Originator:     Zahemszky Gabor
>Organization:
>Release:        FreeBSD 2.1.0-RELEASE i386
>Environment:

	2.1.0-Release from Walnut Creek CD

>Description:

	The rmdir(1) command cannot remove a directory with linknumber>2.
	With the link(2) system call, the superuser can make a hard link
	to a directory, and after it, rmdir failes.
	(Opps, from the source, I've found that the rmdir(2) syscall has
	this bug.)

>How-To-Repeat:

	$ cd /tmp
	$ mkdir lo
	$ link lo lolo
	$ rmdir lo
	rmdir: lo: Directory not empty

	/* And the link source: */
#include	<stdlib.h>
#include	<errno.h>

main( argc, argv )
int	argc;
char	*argv[];
{
if ( link( argv[ 1 ], argv[ 2 ] ) < 0 ) {
	perror( "link failed" );
	return( errno );
	}
return( 0 );
}
	/* end */

>Fix:
	
	

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606121157.NAA00494>