diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-08 11:51:48 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-08 11:51:48 -0400 |
commit | 94ef6c3adf5a69dca00ffd6b77b77acb1e9ec914 (patch) | |
tree | d3cc7891541fd252a1b9ede50080752095989ff1 | |
parent | 114e3ed40a7ddb3a6a5613aef6b9309dcba1df8c (diff) |
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.
-rw-r--r-- | debian/changelog | 3 | ||||
-rwxr-xr-x | 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 <joeyh@debian.org> 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($_); |