1 | /* |
---|
2 | * Copyright (c) 2008 BBN Technologies Corp. All rights reserved. |
---|
3 | * |
---|
4 | * Redistribution and use in source and binary forms, with or without |
---|
5 | * modification, are permitted provided that the following conditions |
---|
6 | * are met: |
---|
7 | * 1. Redistributions of source code must retain the above copyright |
---|
8 | * notice, this list of conditions and the following disclaimer. |
---|
9 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
10 | * notice, this list of conditions and the following disclaimer in the |
---|
11 | * documentation and/or other materials provided with the distribution. |
---|
12 | * 3. Neither the name of BBN Technologies nor the names of its contributors |
---|
13 | * may be used to endorse or promote products derived from this software |
---|
14 | * without specific prior written permission. |
---|
15 | * |
---|
16 | * THIS SOFTWARE IS PROVIDED BY BBN TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' |
---|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL BBN TECHNOLOGIES OR CONTRIBUTORS BE |
---|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
26 | * POSSIBILITY OF SUCH DAMAGE. |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef SVNSTSW_FSO_IS_CHANGEABLE_H |
---|
30 | #define SVNSTSW_FSO_IS_CHANGEABLE_H |
---|
31 | |
---|
32 | #ifdef __cplusplus |
---|
33 | extern "C" { |
---|
34 | #endif |
---|
35 | |
---|
36 | /** |
---|
37 | * @ingroup libsvnstswpub |
---|
38 | * |
---|
39 | * @brief Tests if the file or directory referred to by @a path is |
---|
40 | * changeable. |
---|
41 | * |
---|
42 | * A file or directory is considered changeable if it can be directly |
---|
43 | * modified or if any component of the path can be renamed. If any |
---|
44 | * component of the path refers to a symbolic link, the target is also |
---|
45 | * tested. Permissions are tested against the real user and group |
---|
46 | * IDs, not the effective IDs. |
---|
47 | * |
---|
48 | * This function is designed to help determine whether a file is safe |
---|
49 | * to exec from a setuid/setgid binary. If this function returns |
---|
50 | * true, the user may be able to start a shell as the effective user. |
---|
51 | * |
---|
52 | * This function is thread-safe if the user's C POSIX library is |
---|
53 | * thread-safe. |
---|
54 | * |
---|
55 | * Defined in @p svnstsw/fso_is_changeable.h which is included in @p |
---|
56 | * svnstsw/svnstsw.h |
---|
57 | * |
---|
58 | * @param path Null-terminated string containing the path to the file |
---|
59 | * or directory to test. |
---|
60 | * |
---|
61 | * @return On success, returns 1 if the user (real user and group IDs) |
---|
62 | * can change the file or directory referred to by @a path, or 0 if |
---|
63 | * the file or directory can not be changed. On error, returns 1 and |
---|
64 | * sets @a errno. Error conditions and @a errno values are described |
---|
65 | * in the specifications for stat(), access(), snprintf(), lstat(), |
---|
66 | * readlink(), and getcwd(). |
---|
67 | */ |
---|
68 | _Bool svnstsw_fso_is_changeable(const char* path); |
---|
69 | |
---|
70 | #ifdef __cplusplus |
---|
71 | } |
---|
72 | #endif |
---|
73 | |
---|
74 | #endif |
---|