acl_delete.c revision 225736
1242275Sneel/*-
2242275Sneel * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3242275Sneel * All rights reserved.
4242275Sneel *
5242275Sneel * This software was developed by Robert Watson for the TrustedBSD Project.
6242275Sneel *
7242275Sneel * Redistribution and use in source and binary forms, with or without
8242275Sneel * modification, are permitted provided that the following conditions
9242275Sneel * are met:
10242275Sneel * 1. Redistributions of source code must retain the above copyright
11242275Sneel *    notice, this list of conditions and the following disclaimer.
12242275Sneel * 2. Redistributions in binary form must reproduce the above copyright
13242275Sneel *    notice, this list of conditions and the following disclaimer in the
14242275Sneel *    documentation and/or other materials provided with the distribution.
15242275Sneel *
16242275Sneel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17242275Sneel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18242275Sneel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19242275Sneel * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20242275Sneel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21242275Sneel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22242275Sneel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23242275Sneel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24242275Sneel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25242275Sneel * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26242275Sneel * SUCH DAMAGE.
27242275Sneel */
28242275Sneel/*
29242275Sneel * acl_delete_def_file -- remove a default acl from a file
30242275Sneel */
31242275Sneel
32242275Sneel#include <sys/cdefs.h>
33242275Sneel__FBSDID("$FreeBSD: stable/9/lib/libc/posix1e/acl_delete.c 192586 2009-05-22 15:56:43Z trasz $");
34242275Sneel
35242275Sneel#include <sys/types.h>
36242275Sneel#include "namespace.h"
37242275Sneel#include <sys/acl.h>
38242275Sneel#include "un-namespace.h"
39242275Sneel#include <sys/errno.h>
40242275Sneel
41267427Sjhb#include "acl_support.h"
42267427Sjhb
43267427Sjhbint
44242275Sneelacl_delete_def_file(const char *path_p)
45242275Sneel{
46242275Sneel
47242275Sneel	return (__acl_delete_file(path_p, ACL_TYPE_DEFAULT));
48267427Sjhb}
49242275Sneel
50242275Sneelint
51242275Sneelacl_delete_def_link_np(const char *path_p)
52242275Sneel{
53242275Sneel
54242275Sneel	return (__acl_delete_link(path_p, ACL_TYPE_DEFAULT));
55242275Sneel}
56242275Sneel
57242275Sneelint
58242275Sneelacl_delete_file_np(const char *path_p, acl_type_t type)
59242275Sneel{
60242275Sneel
61242275Sneel	type = _acl_type_unold(type);
62242275Sneel	return (__acl_delete_file(path_p, type));
63267427Sjhb}
64267427Sjhb
65267427Sjhbint
66267427Sjhbacl_delete_link_np(const char *path_p, acl_type_t type)
67267427Sjhb{
68267427Sjhb
69267427Sjhb	type = _acl_type_unold(type);
70267427Sjhb	return (__acl_delete_link(path_p, type));
71267427Sjhb}
72267427Sjhb
73267427Sjhbint
74267427Sjhbacl_delete_fd_np(int filedes, acl_type_t type)
75267427Sjhb{
76267427Sjhb
77267427Sjhb	type = _acl_type_unold(type);
78267427Sjhb	return (___acl_delete_fd(filedes, type));
79267427Sjhb}
80267427Sjhb