Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit 21ed136

Browse files
authored
Merge pull request #2 from ratmice/master
Avoid a doc alias attribute error when using the `[doc(alias(...))]` syntax instead of the `[doc(alias = ...)]` syntax.
2 parents a1fce3a + 9f1833f commit 21ed136

File tree

7 files changed

+152
-152
lines changed

7 files changed

+152
-152
lines changed

src/avc/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl AccessVectorCache {
4242
/// set of options as the previous, still in scope, one.
4343
///
4444
/// See: `avc_open()`.
45-
#[doc(alias("avc_open"))]
45+
#[doc(alias="avc_open")]
4646
pub fn initialize(options: &[(c_int, *const c_void)]) -> Result<RCSRef<Self>> {
4747
let mut options: Vec<selinux_sys::selinux_opt> = options
4848
.iter()
@@ -101,7 +101,7 @@ impl AccessVectorCache {
101101
/// cached access decisions.
102102
///
103103
/// See: `avc_reset()`.
104-
#[doc(alias("avc_reset"))]
104+
#[doc(alias="avc_reset")]
105105
pub fn reset(&self) -> Result<()> {
106106
ret_val_to_result("avc_reset()", unsafe { selinux_sys::avc_reset() })
107107
}
@@ -110,7 +110,7 @@ impl AccessVectorCache {
110110
/// cache, but do not flush any cached access decisions.
111111
///
112112
/// See: `avc_cleanup()`.
113-
#[doc(alias("avc_cleanup"))]
113+
#[doc(alias="avc_cleanup")]
114114
pub fn clean_up(&self) {
115115
unsafe { selinux_sys::avc_cleanup() }
116116
}
@@ -119,7 +119,7 @@ impl AccessVectorCache {
119119
/// specified by `security_identifier_name`.
120120
///
121121
/// See: `avc_get_initial_sid()`.
122-
#[doc(alias("avc_get_initial_sid"))]
122+
#[doc(alias="avc_get_initial_sid")]
123123
pub fn kernel_initial_security_id<'t>(
124124
&'t self,
125125
security_id_name: &str,
@@ -141,7 +141,7 @@ impl AccessVectorCache {
141141
/// Return a security context for the given security identifier.
142142
///
143143
/// See: `avc_sid_to_context()`.
144-
#[doc(alias("avc_sid_to_context"))]
144+
#[doc(alias="avc_sid_to_context")]
145145
pub fn security_context_from_security_id<'t>(
146146
&'t self,
147147
mut security_id: SecurityID,
@@ -163,7 +163,7 @@ impl AccessVectorCache {
163163
/// Return a security identifier for the given security context.
164164
///
165165
/// See: `avc_context_to_sid()`.
166-
#[doc(alias("avc_context_to_sid"))]
166+
#[doc(alias="avc_context_to_sid")]
167167
pub fn security_id_from_security_context<'t>(
168168
&'t self,
169169
context: SecurityContext,

src/call_back/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ pub trait CallBack {
1111
/// Get the current call back function, if one has been set.
1212
///
1313
/// See: `selinux_get_callback()`.
14-
#[doc(alias("selinux_get_callback"))]
14+
#[doc(alias="selinux_get_callback")]
1515
fn get_call_back() -> Option<Self::CallBackType>;
1616

1717
/// Set or clear the call back function.
1818
///
1919
/// See: `selinux_set_callback()`.
20-
#[doc(alias("selinux_set_callback"))]
20+
#[doc(alias="selinux_set_callback")]
2121
fn set_call_back(call_back: Option<Self::CallBackType>);
2222
}
2323

src/context_restore/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ where
148148
/// Set a labeling handle for relabeling.
149149
///
150150
/// See: `selinux_restorecon_set_sehandle()`.
151-
#[doc(alias("selinux_restorecon_set_sehandle"))]
151+
#[doc(alias="selinux_restorecon_set_sehandle")]
152152
pub fn with_labeler(labeler: &'l mut Labeler<T>) -> Self {
153153
Self {
154154
labeler: Some(labeler),
@@ -164,7 +164,7 @@ where
164164
/// Set an alternate root path for relabeling.
165165
///
166166
/// See: `selinux_restorecon_set_alt_rootpath()`.
167-
#[doc(alias("selinux_restorecon_set_alt_rootpath"))]
167+
#[doc(alias="selinux_restorecon_set_alt_rootpath")]
168168
pub fn set_alternative_root_path(&mut self, path: impl AsRef<Path>) -> Result<()> {
169169
let c_path = os_str_to_c_string(path.as_ref().as_os_str())?;
170170
let r = unsafe { selinux_sys::selinux_restorecon_set_alt_rootpath(c_path.as_ptr()) };
@@ -174,7 +174,7 @@ where
174174
/// Add to the list of directories to be excluded from relabeling.
175175
///
176176
/// See: `selinux_restorecon_set_exclude_list()`.
177-
#[doc(alias("selinux_restorecon_set_exclude_list"))]
177+
#[doc(alias="selinux_restorecon_set_exclude_list")]
178178
pub fn add_exclude_list<P>(
179179
&mut self,
180180
exclusion_patterns: impl IntoIterator<Item = P>,
@@ -203,7 +203,7 @@ where
203203
/// Restore file(s) default SELinux security contexts.
204204
///
205205
/// See: `selinux_restorecon()`.
206-
#[doc(alias("selinux_restorecon"))]
206+
#[doc(alias="selinux_restorecon")]
207207
pub fn restore_context_of_file_system_entry(
208208
self,
209209
path: impl AsRef<Path>,
@@ -222,7 +222,7 @@ where
222222
/// `selinux_restorecon()`, `setfiles()` or `restorecon()`.
223223
///
224224
/// See: `selinux_restorecon_xattr()`.
225-
#[doc(alias("selinux_restorecon_xattr"))]
225+
#[doc(alias="selinux_restorecon_xattr")]
226226
pub fn manage_security_sehash_xattr_entries(
227227
dir_path: impl AsRef<Path>,
228228
flags: XAttrFlags,

src/label/mod.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl<T: BackEnd> Labeler<T> {
4848
/// Initialize a labeling handle to be used for lookup operations.
4949
///
5050
/// See: `selabel_open()`.
51-
#[doc(alias("selabel_open"))]
51+
#[doc(alias="selabel_open")]
5252
pub fn new(options: &[(c_int, *const c_void)], raw_format: bool) -> Result<Self> {
5353
use std::convert::TryInto;
5454

@@ -81,7 +81,7 @@ impl<T: BackEnd> Labeler<T> {
8181
/// Obtain SELinux security context from a string label.
8282
///
8383
/// See: `selabel_lookup()`.
84-
#[doc(alias("selabel_lookup"))]
84+
#[doc(alias="selabel_lookup")]
8585
pub fn look_up(&self, key: &CStr, key_type: c_int) -> Result<SecurityContext> {
8686
let (proc, proc_name): (unsafe extern "C" fn(_, _, _, _) -> _, _) = if self.is_raw {
8787
(selinux_sys::selabel_lookup_raw, "selabel_lookup_raw()")
@@ -98,7 +98,7 @@ impl<T: BackEnd> Labeler<T> {
9898
/// Return digest of spec files and list of files used.
9999
///
100100
/// See: `selabel_digest()`.
101-
#[doc(alias("selabel_digest"))]
101+
#[doc(alias="selabel_digest")]
102102
pub fn digest(&'_ self) -> Result<Digest<'_>> {
103103
let mut digest_ptr: *mut u8 = ptr::null_mut();
104104
let mut digest_size = 0;
@@ -129,7 +129,7 @@ impl<T: BackEnd> Labeler<T> {
129129
/// Print SELinux labeling statistics.
130130
///
131131
/// See: `selabel_stats()`.
132-
#[doc(alias("selabel_stats"))]
132+
#[doc(alias="selabel_stats")]
133133
pub fn log_statistics(&self) {
134134
unsafe { selinux_sys::selabel_stats(self.pointer.as_ptr()) }
135135
}
@@ -147,7 +147,7 @@ impl<T: BackEnd> PartialOrd<Labeler<T>> for Labeler<T> {
147147
/// Compare this instance to another one.
148148
///
149149
/// See: `selabel_cmp()`.
150-
#[doc(alias("selabel_cmp"))]
150+
#[doc(alias="selabel_cmp")]
151151
fn partial_cmp(&self, other: &Labeler<T>) -> Option<cmp::Ordering> {
152152
let r = unsafe { selinux_sys::selabel_cmp(self.pointer.as_ptr(), other.pointer.as_ptr()) };
153153
match r {
@@ -169,7 +169,7 @@ impl Labeler<back_end::File> {
169169
/// Return [`Labeler`] with default parameters for `selinux_restorecon()`.
170170
///
171171
/// See: `selinux_restorecon_default_handle()`.
172-
#[doc(alias("selinux_restorecon_default_handle"))]
172+
#[doc(alias="selinux_restorecon_default_handle")]
173173
pub fn restorecon_default(raw_format: bool) -> Result<Self> {
174174
let pointer = unsafe { selinux_sys::selinux_restorecon_default_handle() };
175175
ptr::NonNull::new(pointer)
@@ -185,7 +185,7 @@ impl Labeler<back_end::File> {
185185
/// Obtain SELinux security context from a path.
186186
///
187187
/// See: `selabel_lookup()`.
188-
#[doc(alias("selabel_lookup"))]
188+
#[doc(alias="selabel_lookup")]
189189
pub fn look_up_by_path(
190190
&self,
191191
path: impl AsRef<Path>,
@@ -208,7 +208,7 @@ impl Labeler<back_end::File> {
208208
/// Obtain a best match SELinux security context.
209209
///
210210
/// See: `selabel_lookup_best_match()`.
211-
#[doc(alias("selabel_lookup_best_match"))]
211+
#[doc(alias="selabel_lookup_best_match")]
212212
pub fn look_up_best_match_by_path(
213213
&self,
214214
path: impl AsRef<Path>,
@@ -263,7 +263,7 @@ impl Labeler<back_end::File> {
263263
/// Determine whether a direct or partial match is possible on a file path.
264264
///
265265
/// See: `selabel_partial_match()`.
266-
#[doc(alias("selabel_partial_match"))]
266+
#[doc(alias="selabel_partial_match")]
267267
pub fn partial_match_by_path(&self, path: impl AsRef<Path>) -> Result<bool> {
268268
let c_path = os_str_to_c_string(path.as_ref().as_os_str())?;
269269
Ok(unsafe { selinux_sys::selabel_partial_match(self.pointer.as_ptr(), c_path.as_ptr()) })
@@ -273,7 +273,7 @@ impl Labeler<back_end::File> {
273273
/// to the supplied path.
274274
///
275275
/// See: `selabel_get_digests_all_partial_matches()`.
276-
#[doc(alias("selabel_get_digests_all_partial_matches"))]
276+
#[doc(alias="selabel_get_digests_all_partial_matches")]
277277
pub fn get_digests_all_partial_matches_by_path(
278278
&self,
279279
path: impl AsRef<Path>,

0 commit comments

Comments
 (0)