mirror of
https://github.com/uutils/shadow.git
synced 2026-06-10 16:14:57 -07:00
meta: align Cargo.toml metadata with uutils conventions
- Fix root package edition (2021 → workspace 2024) - Use workspace inheritance for license, authors, repository, rust-version - Fix keywords: "coreutils" → "shadow-utils", add "uutils" - Add homepage, keywords, categories to workspace.package - Add workspace metadata inheritance to all 15 crate Cargo.toml files - Normalize tool descriptions to "tool ~ (shadow-rs) verb phrase" format - Add feat_common_core feature alias (groups all 14 tools) - Fix pre-existing clippy and fmt issues from edition 2024 alignment
This commit is contained in:
+11
-5
@@ -3,13 +3,15 @@
|
||||
[package]
|
||||
name = "shadow-rs"
|
||||
version = "0.0.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "Memory-safe Rust reimplementation of Linux shadow-utils"
|
||||
repository = "https://github.com/shadow-utils-rs/shadow-rs"
|
||||
readme = "README.md"
|
||||
keywords = ["coreutils", "shadow", "passwd", "useradd", "linux"]
|
||||
categories = ["command-line-utilities", "os::unix-apis"]
|
||||
keywords = ["shadow-utils", "uutils", "shadow", "passwd", "linux"]
|
||||
categories = ["command-line-utilities"]
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
@@ -37,6 +39,9 @@ rust-version = "1.94.0"
|
||||
license = "MIT"
|
||||
authors = ["shadow-rs contributors"]
|
||||
repository = "https://github.com/shadow-utils-rs/shadow-rs"
|
||||
homepage = "https://github.com/shadow-utils-rs/shadow-rs"
|
||||
keywords = ["shadow-utils", "uutils", "shadow", "passwd", "linux"]
|
||||
categories = ["command-line-utilities"]
|
||||
|
||||
[workspace.dependencies]
|
||||
# Internal crates
|
||||
@@ -109,6 +114,7 @@ feat_phase1 = ["feat_passwd", "feat_pwck"]
|
||||
feat_phase2 = ["feat_useradd", "feat_userdel", "feat_usermod", "feat_chpasswd", "feat_chage"]
|
||||
feat_phase3 = ["feat_groupadd", "feat_groupdel", "feat_groupmod", "feat_grpck", "feat_chfn", "feat_chsh", "feat_newgrp"]
|
||||
feat_common = ["feat_phase1", "feat_phase2"]
|
||||
feat_common_core = ["feat_phase1", "feat_phase2", "feat_phase3"]
|
||||
|
||||
# PAM authentication (requires libpam-dev)
|
||||
pam = ["passwd/pam"]
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
//! Supported shells: bash, zsh, fish, elvish, powershell
|
||||
|
||||
use clap::{Arg, ArgAction, Command};
|
||||
use clap_complete::generate;
|
||||
use clap_complete::Shell;
|
||||
use clap_complete::generate;
|
||||
use std::io;
|
||||
|
||||
fn get_tool_app(name: &str) -> Option<Command> {
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "Core library for shadow-rs: parsers, atomic file ops, locking, PAM integration"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "shadow-core ~ (shadow-rs) parsers, atomic file ops, locking, PAM"
|
||||
|
||||
[lib]
|
||||
path = "src/lib.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "chage command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "chage ~ (shadow-rs) change user password aging"
|
||||
|
||||
[lib]
|
||||
path = "src/chage.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "chfn command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "chfn ~ (shadow-rs) change user finger information"
|
||||
|
||||
[lib]
|
||||
path = "src/chfn.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "chpasswd command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "chpasswd ~ (shadow-rs) update passwords in batch"
|
||||
|
||||
[lib]
|
||||
path = "src/chpasswd.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "chsh command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "chsh ~ (shadow-rs) change user login shell"
|
||||
|
||||
[lib]
|
||||
path = "src/chsh.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "groupadd command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "groupadd ~ (shadow-rs) create a new group"
|
||||
|
||||
[lib]
|
||||
path = "src/groupadd.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "groupdel command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "groupdel ~ (shadow-rs) delete a group"
|
||||
|
||||
[lib]
|
||||
path = "src/groupdel.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "groupmod command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "groupmod ~ (shadow-rs) modify a group"
|
||||
|
||||
[lib]
|
||||
path = "src/groupmod.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "grpck command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "grpck ~ (shadow-rs) verify integrity of group files"
|
||||
|
||||
[lib]
|
||||
path = "src/grpck.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "newgrp command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "newgrp ~ (shadow-rs) change effective group ID"
|
||||
|
||||
[lib]
|
||||
path = "src/newgrp.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "passwd command — change user password (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "passwd ~ (shadow-rs) change user password"
|
||||
|
||||
[lib]
|
||||
path = "src/passwd.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "pwck command — verify integrity of password files (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "pwck ~ (shadow-rs) verify integrity of password files"
|
||||
|
||||
[lib]
|
||||
path = "src/pwck.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "useradd command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "useradd ~ (shadow-rs) create a new user"
|
||||
|
||||
[lib]
|
||||
path = "src/useradd.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "userdel command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "userdel ~ (shadow-rs) delete a user account"
|
||||
|
||||
[lib]
|
||||
path = "src/userdel.rs"
|
||||
|
||||
@@ -5,7 +5,11 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
description = "usermod command (shadow-rs)"
|
||||
homepage.workspace = true
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "usermod ~ (shadow-rs) modify a user account"
|
||||
|
||||
[lib]
|
||||
path = "src/usermod.rs"
|
||||
|
||||
@@ -428,15 +428,15 @@ fn test_gnu_compat_status_output() {
|
||||
|
||||
// Verify our format matches by parsing a shadow entry and formatting it
|
||||
let shadow_path = std::path::Path::new("/etc/shadow");
|
||||
if let Ok(entries) = shadow_core::shadow::read_shadow_file(shadow_path) {
|
||||
if let Some(entry) = entries.iter().find(|e| e.name == "root") {
|
||||
let our_status = entry.status_char();
|
||||
assert_eq!(
|
||||
our_status, gnu_fields[1],
|
||||
"status char mismatch: ours={our_status}, GNU={}",
|
||||
gnu_fields[1]
|
||||
);
|
||||
}
|
||||
if let Ok(entries) = shadow_core::shadow::read_shadow_file(shadow_path)
|
||||
&& let Some(entry) = entries.iter().find(|e| e.name == "root")
|
||||
{
|
||||
let our_status = entry.status_char();
|
||||
assert_eq!(
|
||||
our_status, gnu_fields[1],
|
||||
"status char mismatch: ours={our_status}, GNU={}",
|
||||
gnu_fields[1]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user