ports/102897: linux_base-fc-4 - remove() function does not delete empty directories

Knut Anders Hatlen kahatlen at gmail.com
Tue Sep 5 08:40:33 UTC 2006


>Number:         102897
>Category:       ports
>Synopsis:       linux_base-fc-4 - remove() function does not delete empty directories
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 05 08:40:20 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Knut Anders Hatlen
>Release:        FreeBSD 6.1-RELEASE-p5 i386
>Organization:
>Environment:
System: FreeBSD ugle.hatlen.net 6.1-RELEASE-p5 FreeBSD 6.1-RELEASE-p5 #4: Mon Sep 4 22:19:20 CEST 2006 root at ugle.hatlen.net:/usr/obj/usr/src/sys/KAH-KERNEL-I386 i386

linux_base-fc-4_8

	
>Description:

After upgrading linux_base from the RedHat port to FC4, I noticed that
a Linux application was unable to remove empty directories (it could
with the RedHat port). When investigating the issue further, it seems
like FC4 has changed the behaviour of the remove() function. With the
RedHat port, it behaves as rmdir() on directories and as unlink()
otherwise (which is the correct behaviour according to the manual for
the GNU C Library). With the FC4 port, it always behaves as unlink()
and therefore fails when it is used on directories.

>How-To-Repeat:

% cat removetest.c
#include <stdio.h>

int main()
{
  if (remove("emptydir") == -1) {
    perror("error");
  }
  return 0;
}
% /usr/compat/linux/usr/bin/gcc removetest.c
% mkdir emptydir
% ./a.out 
error: Operation not permitted


>Fix:

	


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list