File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
test-framework/sudo-compliance-tests/src/sudoedit Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ pub fn run_edit(edit_opts: SudoEditOptions) -> Result<(), Error> {
35
35
& context. target_group ,
36
36
) {
37
37
Ok ( file) => opened_files. push ( ( path, file) ) ,
38
- Err ( error) if error. raw_os_error ( ) == Some ( 40 ) => {
38
+ // ErrorKind::FilesystemLoop was only stabilized in 1.83
39
+ Err ( error) if error. raw_os_error ( ) == Some ( libc:: ELOOP ) => {
39
40
user_error ! ( "{arg}: editing symbolic links is not permitted" )
40
41
}
41
42
Err ( error) => user_error ! ( "error opening {arg}: {error}" ) ,
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ fn cannot_edit_writable_paths() {
20
20
. arg ( file)
21
21
. output ( & env) ;
22
22
23
+ output. assert_exit_code ( 1 ) ;
24
+
23
25
if sudo_test:: is_original_sudo ( ) {
24
26
if file != "/tmp/bar/foo.sh" {
25
27
assert_contains ! (
@@ -36,14 +38,13 @@ fn cannot_edit_writable_paths() {
36
38
"cannot open a file in a path writable by the user"
37
39
) ;
38
40
}
39
- output. assert_exit_code ( 1 ) ;
40
41
}
41
42
}
42
43
43
44
#[ test]
44
45
fn can_edit_writable_paths_as_root ( ) {
45
46
// note: we already have tests that sudoedit "works" so we are skipping
46
- // the content check here--- the point here is that sudoedit does not stop
47
+ // the content check here: the point here is that sudoedit does not stop
47
48
// the user.
48
49
49
50
let env = Env ( SUDOERS_ALL_ALL_NOPASSWD )
@@ -123,7 +124,7 @@ fn cannot_edit_files_target_user_cannot_access() {
123
124
#[ test]
124
125
fn can_edit_files_target_user_or_group_can_access ( ) {
125
126
// note: we already have tests that sudoedit "works" so we are skipping
126
- // the content check here--- the point here is that sudoedit does not stop
127
+ // the content check here: the point here is that sudoedit does not stop
127
128
// the user.
128
129
129
130
let file = "/test.txt" ;
You can’t perform that action at this time.
0 commit comments