You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.stderr_is("chgrp: it is dangerous to operate recursively on '/'\nchgrp: use --no-preserve-root to override this failsafe\n");
145
+
.stderr_is("chgrp: it is dangerous to operate recursively on './/test_chgrp_symlink2root/..//..//../../' (same as '/')\nchgrp: use --no-preserve-root to override this failsafe\n");
128
146
129
147
let(at,mut ucmd) = at_and_ucmd!();
130
148
at.symlink_file("/","__root__");
131
149
ucmd.arg("--preserve-root")
132
150
.arg("-R")
133
151
.arg("bin").arg("__root__/.")
134
152
.fails()
135
-
.stderr_is("chgrp: it is dangerous to operate recursively on '/'\nchgrp: use --no-preserve-root to override this failsafe\n");
153
+
.stderr_is("chgrp: it is dangerous to operate recursively on '__root__/.' (same as '/')\nchgrp: use --no-preserve-root to override this failsafe\n");
154
+
}
155
+
156
+
#[test]
157
+
fntest_preserve_root_symlink_cwd_root(){
158
+
new_ucmd!()
159
+
.current_dir("/")
160
+
.arg("--preserve-root")
161
+
.arg("-R")
162
+
.arg("bin").arg(".")
163
+
.fails()
164
+
.stderr_is("chgrp: it is dangerous to operate recursively on '.' (same as '/')\nchgrp: use --no-preserve-root to override this failsafe\n");
165
+
new_ucmd!()
166
+
.current_dir("/")
167
+
.arg("--preserve-root")
168
+
.arg("-R")
169
+
.arg("bin").arg("/.")
170
+
.fails()
171
+
.stderr_is("chgrp: it is dangerous to operate recursively on '/.' (same as '/')\nchgrp: use --no-preserve-root to override this failsafe\n");
172
+
new_ucmd!()
173
+
.current_dir("/")
174
+
.arg("--preserve-root")
175
+
.arg("-R")
176
+
.arg("bin").arg("..")
177
+
.fails()
178
+
.stderr_is("chgrp: it is dangerous to operate recursively on '..' (same as '/')\nchgrp: use --no-preserve-root to override this failsafe\n");
179
+
new_ucmd!()
180
+
.current_dir("/")
181
+
.arg("--preserve-root")
182
+
.arg("-R")
183
+
.arg("bin").arg("/..")
184
+
.fails()
185
+
.stderr_is("chgrp: it is dangerous to operate recursively on '/..' (same as '/')\nchgrp: use --no-preserve-root to override this failsafe\n");
186
+
new_ucmd!()
187
+
.current_dir("/")
188
+
.arg("--preserve-root")
189
+
.arg("-R")
190
+
.arg("bin")
191
+
.arg("...")
192
+
.fails()
193
+
.stderr_is("chgrp: cannot access '...': No such file or directory\n");
0 commit comments