~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/se-selinux.in.h

  • Committer: Colin Watson
  • Date: 2013-10-30 15:48:33 UTC
  • mfrom: (8.3.5 sid)
  • Revision ID: cjwatson@canonical.com-20131030154833-xdt6e1yfffqom1c4
merge from Debian 8.21-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Replacement <selinux/selinux.h> for platforms that lack it.
2
 
   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
2
   Copyright (C) 2008-2013 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software: you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
31
31
#  include <sys/types.h>
32
32
#  include <errno.h>
33
33
 
 
34
_GL_INLINE_HEADER_BEGIN
 
35
#  ifndef SE_SELINUX_INLINE
 
36
#   define SE_SELINUX_INLINE _GL_INLINE
 
37
#  endif
 
38
 
34
39
/* The definition of _GL_UNUSED_PARAMETER is copied here.  */
35
40
 
36
41
#  if !GNULIB_defined_security_types
39
44
#   define security_context_t char*
40
45
#   define is_selinux_enabled() 0
41
46
 
42
 
static inline int getcon (security_context_t *con _GL_UNUSED_PARAMETER)
43
 
  { errno = ENOTSUP; return -1; }
44
 
static inline void freecon (security_context_t con _GL_UNUSED_PARAMETER) {}
45
 
 
46
 
 
47
 
static inline int getfscreatecon (security_context_t *con _GL_UNUSED_PARAMETER)
48
 
  { errno = ENOTSUP; return -1; }
49
 
static inline int setfscreatecon (security_context_t con _GL_UNUSED_PARAMETER)
50
 
  { errno = ENOTSUP; return -1; }
51
 
static inline int matchpathcon (char const *file _GL_UNUSED_PARAMETER,
52
 
                                mode_t m _GL_UNUSED_PARAMETER,
53
 
                                security_context_t *con _GL_UNUSED_PARAMETER)
54
 
  { errno = ENOTSUP; return -1; }
55
 
static inline int getfilecon (char const *file _GL_UNUSED_PARAMETER,
56
 
                              security_context_t *con _GL_UNUSED_PARAMETER)
57
 
  { errno = ENOTSUP; return -1; }
58
 
static inline int lgetfilecon (char const *file _GL_UNUSED_PARAMETER,
59
 
                               security_context_t *con _GL_UNUSED_PARAMETER)
60
 
  { errno = ENOTSUP; return -1; }
61
 
static inline int fgetfilecon (int fd,
62
 
                               security_context_t *con _GL_UNUSED_PARAMETER)
63
 
  { errno = ENOTSUP; return -1; }
64
 
static inline int setfilecon (char const *file _GL_UNUSED_PARAMETER,
65
 
                              security_context_t con _GL_UNUSED_PARAMETER)
66
 
  { errno = ENOTSUP; return -1; }
67
 
static inline int lsetfilecon (char const *file _GL_UNUSED_PARAMETER,
68
 
                               security_context_t con _GL_UNUSED_PARAMETER)
69
 
  { errno = ENOTSUP; return -1; }
70
 
static inline int fsetfilecon (int fd _GL_UNUSED_PARAMETER,
71
 
                               security_context_t con _GL_UNUSED_PARAMETER)
72
 
  { errno = ENOTSUP; return -1; }
73
 
 
74
 
static inline int security_check_context
75
 
    (security_context_t con _GL_UNUSED_PARAMETER)
76
 
  { errno = ENOTSUP; return -1; }
77
 
static inline int security_check_context_raw
78
 
    (security_context_t con _GL_UNUSED_PARAMETER)
79
 
  { errno = ENOTSUP; return -1; }
80
 
static inline int setexeccon (security_context_t con _GL_UNUSED_PARAMETER)
81
 
  { errno = ENOTSUP; return -1; }
82
 
static inline int security_compute_create
83
 
    (security_context_t scon _GL_UNUSED_PARAMETER,
84
 
     security_context_t tcon _GL_UNUSED_PARAMETER,
85
 
     security_class_t tclass _GL_UNUSED_PARAMETER,
86
 
     security_context_t *newcon _GL_UNUSED_PARAMETER)
87
 
  { errno = ENOTSUP; return -1; }
88
 
static inline int matchpathcon_init_prefix
89
 
    (char const *path _GL_UNUSED_PARAMETER,
90
 
     char const *prefix _GL_UNUSED_PARAMETER)
 
47
SE_SELINUX_INLINE int
 
48
getcon (security_context_t *con _GL_UNUSED_PARAMETER)
 
49
  { errno = ENOTSUP; return -1; }
 
50
SE_SELINUX_INLINE void
 
51
freecon (security_context_t con _GL_UNUSED_PARAMETER) {}
 
52
 
 
53
SE_SELINUX_INLINE int
 
54
getfscreatecon (security_context_t *con _GL_UNUSED_PARAMETER)
 
55
  { errno = ENOTSUP; return -1; }
 
56
SE_SELINUX_INLINE int
 
57
setfscreatecon (security_context_t con _GL_UNUSED_PARAMETER)
 
58
  { errno = ENOTSUP; return -1; }
 
59
SE_SELINUX_INLINE int
 
60
matchpathcon (char const *file _GL_UNUSED_PARAMETER,
 
61
              mode_t m _GL_UNUSED_PARAMETER,
 
62
  security_context_t *con _GL_UNUSED_PARAMETER)
 
63
  { errno = ENOTSUP; return -1; }
 
64
SE_SELINUX_INLINE int
 
65
getfilecon (char const *file _GL_UNUSED_PARAMETER,
 
66
            security_context_t *con _GL_UNUSED_PARAMETER)
 
67
  { errno = ENOTSUP; return -1; }
 
68
SE_SELINUX_INLINE int
 
69
lgetfilecon (char const *file _GL_UNUSED_PARAMETER,
 
70
             security_context_t *con _GL_UNUSED_PARAMETER)
 
71
  { errno = ENOTSUP; return -1; }
 
72
SE_SELINUX_INLINE int
 
73
fgetfilecon (int fd, security_context_t *con _GL_UNUSED_PARAMETER)
 
74
  { errno = ENOTSUP; return -1; }
 
75
SE_SELINUX_INLINE int
 
76
setfilecon (char const *file _GL_UNUSED_PARAMETER,
 
77
            security_context_t con _GL_UNUSED_PARAMETER)
 
78
  { errno = ENOTSUP; return -1; }
 
79
SE_SELINUX_INLINE int
 
80
lsetfilecon (char const *file _GL_UNUSED_PARAMETER,
 
81
             security_context_t con _GL_UNUSED_PARAMETER)
 
82
  { errno = ENOTSUP; return -1; }
 
83
SE_SELINUX_INLINE int
 
84
fsetfilecon (int fd _GL_UNUSED_PARAMETER,
 
85
             security_context_t con _GL_UNUSED_PARAMETER)
 
86
  { errno = ENOTSUP; return -1; }
 
87
 
 
88
SE_SELINUX_INLINE int
 
89
security_check_context (security_context_t con _GL_UNUSED_PARAMETER)
 
90
  { errno = ENOTSUP; return -1; }
 
91
SE_SELINUX_INLINE int
 
92
security_check_context_raw (security_context_t con _GL_UNUSED_PARAMETER)
 
93
  { errno = ENOTSUP; return -1; }
 
94
SE_SELINUX_INLINE int
 
95
setexeccon (security_context_t con _GL_UNUSED_PARAMETER)
 
96
  { errno = ENOTSUP; return -1; }
 
97
SE_SELINUX_INLINE int
 
98
security_compute_create (security_context_t scon _GL_UNUSED_PARAMETER,
 
99
                         security_context_t tcon _GL_UNUSED_PARAMETER,
 
100
                         security_class_t tclass _GL_UNUSED_PARAMETER,
 
101
                         security_context_t *newcon _GL_UNUSED_PARAMETER)
 
102
  { errno = ENOTSUP; return -1; }
 
103
SE_SELINUX_INLINE int
 
104
matchpathcon_init_prefix (char const *path _GL_UNUSED_PARAMETER,
 
105
                          char const *prefix _GL_UNUSED_PARAMETER)
91
106
  { errno = ENOTSUP; return -1; }
92
107
 
93
108
#   define GNULIB_defined_security_types 1
94
109
#  endif
95
110
 
 
111
_GL_INLINE_HEADER_BEGIN
 
112
 
96
113
# endif
97
114
#endif /* _@GUARD_PREFIX@_SELINUX_SELINUX_H */