mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
chmod: pad all file modes to 4 digits
This commit is contained in:
@@ -323,7 +323,7 @@ impl Chmoder {
|
||||
}
|
||||
if self.verbose {
|
||||
show_error!(
|
||||
"failed to change mode of file '{}' from {:o} ({}) to {:o} ({})",
|
||||
"failed to change mode of file '{}' from {:04o} ({}) to {:04o} ({})",
|
||||
file.display(),
|
||||
fperm,
|
||||
display_permissions_unix(fperm as mode_t, false),
|
||||
@@ -335,7 +335,7 @@ impl Chmoder {
|
||||
} else {
|
||||
if self.verbose || self.changes {
|
||||
show_error!(
|
||||
"mode of '{}' changed from {:o} ({}) to {:o} ({})",
|
||||
"mode of '{}' changed from {:04o} ({}) to {:04o} ({})",
|
||||
file.display(),
|
||||
fperm,
|
||||
display_permissions_unix(fperm as mode_t, false),
|
||||
|
||||
@@ -330,8 +330,8 @@ fn test_chmod_recursive() {
|
||||
.arg("a")
|
||||
.arg("z")
|
||||
.succeeds()
|
||||
.stderr_contains(&"to 333 (-wx-wx-wx)")
|
||||
.stderr_contains(&"to 222 (-w--w--w-)");
|
||||
.stderr_contains(&"to 0333 (-wx-wx-wx)")
|
||||
.stderr_contains(&"to 0222 (-w--w--w-)");
|
||||
|
||||
assert_eq!(at.metadata("z/y").permissions().mode(), 0o100222);
|
||||
assert_eq!(at.metadata("a/a").permissions().mode(), 0o100222);
|
||||
|
||||
Reference in New Issue
Block a user