acl_delete.c revision 256281
1327952Sdim/*-
2283625Sdim * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3353358Sdim * All rights reserved.
4353358Sdim *
5353358Sdim * This software was developed by Robert Watson for the TrustedBSD Project.
6283625Sdim *
7283625Sdim * Redistribution and use in source and binary forms, with or without
8283625Sdim * modification, are permitted provided that the following conditions
9283625Sdim * are met:
10309124Sdim * 1. Redistributions of source code must retain the above copyright
11283625Sdim *    notice, this list of conditions and the following disclaimer.
12309124Sdim * 2. Redistributions in binary form must reproduce the above copyright
13309124Sdim *    notice, this list of conditions and the following disclaimer in the
14309124Sdim *    documentation and/or other materials provided with the distribution.
15309124Sdim *
16283625Sdim * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17283625Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18327952Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19283625Sdim * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20321369Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21327952Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22327952Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23327952Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24327952Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25327952Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26327952Sdim * SUCH DAMAGE.
27327952Sdim */
28283625Sdim/*
29327952Sdim * acl_delete_def_file -- remove a default acl from a file
30283625Sdim */
31327952Sdim
32283625Sdim#include <sys/cdefs.h>
33327952Sdim__FBSDID("$FreeBSD: stable/10/lib/libc/posix1e/acl_delete.c 192586 2009-05-22 15:56:43Z trasz $");
34327952Sdim
35360784Sdim#include <sys/types.h>
36327952Sdim#include "namespace.h"
37327952Sdim#include <sys/acl.h>
38314564Sdim#include "un-namespace.h"
39327952Sdim#include <sys/errno.h>
40327952Sdim
41327952Sdim#include "acl_support.h"
42327952Sdim
43327952Sdimint
44283625Sdimacl_delete_def_file(const char *path_p)
45283625Sdim{
46283625Sdim
47321369Sdim	return (__acl_delete_file(path_p, ACL_TYPE_DEFAULT));
48283625Sdim}
49283625Sdim
50283625Sdimint
51283625Sdimacl_delete_def_link_np(const char *path_p)
52283625Sdim{
53283625Sdim
54327952Sdim	return (__acl_delete_link(path_p, ACL_TYPE_DEFAULT));
55283625Sdim}
56283625Sdim
57327952Sdimint
58327952Sdimacl_delete_file_np(const char *path_p, acl_type_t type)
59283625Sdim{
60283625Sdim
61283625Sdim	type = _acl_type_unold(type);
62283625Sdim	return (__acl_delete_file(path_p, type));
63283625Sdim}
64283625Sdim
65283625Sdimint
66327952Sdimacl_delete_link_np(const char *path_p, acl_type_t type)
67283625Sdim{
68283625Sdim
69283625Sdim	type = _acl_type_unold(type);
70283625Sdim	return (__acl_delete_link(path_p, type));
71283625Sdim}
72283625Sdim
73283625Sdimint
74283625Sdimacl_delete_fd_np(int filedes, acl_type_t type)
75283625Sdim{
76283625Sdim
77327952Sdim	type = _acl_type_unold(type);
78283625Sdim	return (___acl_delete_fd(filedes, type));
79283625Sdim}
80283625Sdim