Skip to content

Commit

Permalink
Merge branch 'main' into cp-parents-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jfinkels authored Sep 26, 2022
2 parents f61b123 + b43bbe9 commit f392685
Show file tree
Hide file tree
Showing 19 changed files with 363 additions and 142 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ env:

on: [push, pull_request]

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
cargo-deny:
name: Style/cargo-deny
Expand Down Expand Up @@ -532,6 +535,9 @@ jobs:
path: size-result.json

build:
permissions:
contents: write # to create GitHub release (softprops/action-gh-release)

name: Build
needs: [ min_version, deps ]
runs-on: ${{ matrix.job.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/GnuTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ name: GnuTests

on: [push, pull_request]

permissions:
contents: read

jobs:
gnu:
permissions:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions src/uu/chmod/src/chmod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::path::Path;
use uucore::display::Quotable;
use uucore::error::{ExitCode, UResult, USimpleError, UUsageError};
use uucore::fs::display_permissions_unix;
use uucore::fs::is_symlink;
use uucore::libc::mode_t;
#[cfg(not(windows))]
use uucore::mode;
Expand Down Expand Up @@ -195,7 +194,7 @@ impl Chmoder {
let filename = &filename[..];
let file = Path::new(filename);
if !file.exists() {
if is_symlink(file) {
if file.is_symlink() {
println!(
"failed to change mode of {} from 0000 (---------) to 0000 (---------)",
filename.quote()
Expand Down Expand Up @@ -237,10 +236,10 @@ impl Chmoder {

fn walk_dir(&self, file_path: &Path) -> UResult<()> {
let mut r = self.chmod_file(file_path);
if !is_symlink(file_path) && file_path.is_dir() {
if !file_path.is_symlink() && file_path.is_dir() {
for dir_entry in file_path.read_dir()? {
let path = dir_entry?.path();
if !is_symlink(&path) {
if !path.is_symlink() {
r = self.walk_dir(path.as_path());
}
}
Expand All @@ -262,7 +261,7 @@ impl Chmoder {
let fperm = match fs::metadata(file) {
Ok(meta) => meta.mode() & 0o7777,
Err(err) => {
if is_symlink(file) {
if file.is_symlink() {
if self.verbose {
println!(
"neither symbolic link {} nor referent has been changed",
Expand Down
Loading

0 comments on commit f392685

Please sign in to comment.