| 1 |
/* Query, remove, or restore a Solaris privilege. |
| 2 |
|
| 3 |
Copyright (C) 2009-2025 Free Software Foundation, Inc. |
| 4 |
|
| 5 |
This program is free software: you can redistribute it and/or modify |
| 6 |
it under the terms of the GNU General Public License as published by |
| 7 |
the Free Software Foundation, either version 3 of the License, or |
| 8 |
(at your option) any later version. |
| 9 |
|
| 10 |
This program is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
GNU General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU General Public License |
| 16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
Written by David Bartley. */ |
| 19 |
|
| 20 |
/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, HAVE_PRIV_H, |
| 21 |
HAVE_GETPPRIV. */ |
| 22 |
#if !_GL_CONFIG_H_INCLUDED |
| 23 |
#error "Please include config.h first." |
| 24 |
#endif |
| 25 |
|
| 26 |
_GL_INLINE_HEADER_BEGIN |
| 27 |
#ifndef PRIV_SET_INLINE |
| 28 |
# define PRIV_SET_INLINE _GL_INLINE |
| 29 |
#endif |
| 30 |
|
| 31 |
#if HAVE_GETPPRIV && HAVE_PRIV_H |
| 32 |
|
| 33 |
# include <priv.h> |
| 34 |
|
| 35 |
# ifdef __cplusplus |
| 36 |
extern "C" { |
| 37 |
# endif |
| 38 |
|
| 39 |
|
| 40 |
int priv_set_ismember (const char *priv); |
| 41 |
int priv_set_remove (const char *priv); |
| 42 |
int priv_set_restore (const char *priv); |
| 43 |
|
| 44 |
PRIV_SET_INLINE int |
| 45 |
priv_set_remove_linkdir (void) |
| 46 |
{ |
| 47 |
return priv_set_remove (PRIV_SYS_LINKDIR); |
| 48 |
} |
| 49 |
|
| 50 |
PRIV_SET_INLINE int |
| 51 |
priv_set_restore_linkdir (void) |
| 52 |
{ |
| 53 |
return priv_set_restore (PRIV_SYS_LINKDIR); |
| 54 |
} |
| 55 |
|
| 56 |
#else |
| 57 |
|
| 58 |
PRIV_SET_INLINE int |
| 59 |
priv_set_remove_linkdir (void) |
| 60 |
{ |
| 61 |
return -1; |
| 62 |
} |
| 63 |
|
| 64 |
PRIV_SET_INLINE int |
| 65 |
priv_set_restore_linkdir (void) |
| 66 |
{ |
| 67 |
return -1; |
| 68 |
} |
| 69 |
|
| 70 |
|
| 71 |
# ifdef __cplusplus |
| 72 |
} |
| 73 |
# endif |
| 74 |
|
| 75 |
#endif |
| 76 |
|
| 77 |
_GL_INLINE_HEADER_END |