|
Revision 1766, 1.1 kB
(checked in by ensc, 4 years ago)
|
vc_getfilecontext(): as noticed by daniel_hozac in IRC, this function
was horribly broken. Fixed and moved it into an own file as it is too
complex for an inline function. Documentation was added also.
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
#ifdef HAVE_CONFIG_H |
|---|
| 20 |
# include <config.h> |
|---|
| 21 |
#endif |
|---|
| 22 |
|
|---|
| 23 |
#include "vserver.h" |
|---|
| 24 |
#include <errno.h> |
|---|
| 25 |
|
|---|
| 26 |
xid_t vc_getfilecontext(char const *filename) |
|---|
| 27 |
{ |
|---|
| 28 |
xid_t res; |
|---|
| 29 |
uint32_t mask = VC_IATTR_XID; |
|---|
| 30 |
|
|---|
| 31 |
if (vc_get_iattr(filename, &res, 0,&mask)==-1) |
|---|
| 32 |
return VC_NOCTX; |
|---|
| 33 |
else if ((mask&VC_IATTR_XID) && res!=VC_NOCTX) |
|---|
| 34 |
return res; |
|---|
| 35 |
|
|---|
| 36 |
errno = 0; |
|---|
| 37 |
return VC_NOCTX; |
|---|
| 38 |
} |
|---|