From 94ef6c3adf5a69dca00ffd6b77b77acb1e9ec914 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 8 May 2013 11:51:48 -0400 Subject: When a file is owned by a uid or a gid with no corresponding user or group, put a numeric chown into .etckeeper. Previously, a broken chown was outputted. --- debian/changelog | 3 +++ pre-commit.d/30store-metadata | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2f9e9e4..1d0e070 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ etckeeper (1.2) UNRELEASED; urgency=low * Call type -p in a more compatable way. + * When a file is owned by a uid or a gid with no corresponding user or + group, put a numeric chown into .etckeeper. Previously, a broken + chown was outputted. -- Joey Hess Mon, 06 May 2013 11:26:29 -0400 diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata index 455429a..d445db1 100755 --- a/pre-commit.d/30store-metadata +++ b/pre-commit.d/30store-metadata @@ -81,14 +81,16 @@ generate_metadata() { if (exists $uidcache{$want}) { return $uidcache{$want}; } - return $uidcache{$want}=scalar getpwuid($want); + my $name=scalar getpwuid($want); + return $uidcache{$want}=defined $name ? $name : $want; } sub gidname { my $want=shift; if (exists $gidcache{$want}) { return $gidcache{$want}; } - return $gidcache{$want}=scalar getgrgid($want); + my $name=scalar getgrgid($want); + return $gidcache{$want}=defined $name ? $name : $want; } chomp; my @stat=stat($_); -- cgit v1.2.3