* Display a message when the owner is not changed.
* Display a message when the current user/group doesn't match those specified in the `--from` args.
* print messages to stdout
* Show the message "ownership of 'foo' retained as 'bar'" for every path entry when `chown -v -R --from=`
* fix chown tests: test stdout and not stderr
* factorize duplicate code in a function
* Display a message when the owner is not changed.
* Display a message when the current user/group doesn't match those specified in the `--from` args.
* print messages to stdout
* Show the message "ownership of 'foo' retained as 'bar'" for every path entry when `chown -v -R --from=`
* fix chown tests: test stdout and not stderr
* factorize duplicate code in a function
* display the retained ownership details according to the destination ownership.
* print the message "failed to change ownership of" when we try to change a non existing file.
* replace the 4-tuple returned by parse_gid_uid_and_filter by GidUidOwnerFilter struct.
* chain the test in one expression.
* chown: remove unused var "result" in test
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Rust nightly recently [started] issuing the following warning when
compiling coreutils:
[started]: https://github.com/rust-lang/rust/pull/109944
```
warning: getting the inner pointer of a temporary `CString`
--> src/uucore/src/lib/features/entries.rs:324:67
|
324 | let data = $fnam(CString::new(k).unwrap().as_ptr());
| ------------------------ ^^^^^^ this pointer will be invalid
| |
| this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
...
340 | f!(getpwnam, getpwuid, uid_t, Passwd);
| ------------------------------------- in this macro invocation
|
= note: pointers do not have a lifetime; when calling `as_ptr` the `CString` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
= help: for more information, see https://doc.rust-lang.org/reference/destructors.html
= note: `#[warn(temporary_cstring_as_ptr)]` on by default
= note: this warning originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)
```
There doesn't seem to be an actual problem in this case, as the pointer is
only used within the statement.