From 682dca8fd09fd2fec335dc98f2cd4279c56f65b2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 3 Jul 2008 00:47:22 -0400 Subject: Don't allow LC_COLLATE to reorder the .etckeeper file. Closes: #489057 --- pre-commit.d/30store-metadata | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pre-commit.d') diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata index bed2d89..243e019 100755 --- a/pre-commit.d/30store-metadata +++ b/pre-commit.d/30store-metadata @@ -1,7 +1,6 @@ #!/bin/sh set -e - # Filters out UNKNOWN users and groups, prints a warning on stderr. filter_unknown() { CMD=$1 @@ -15,7 +14,6 @@ filter_unknown() { done } - generate_metadata() { # This function generates the script commands to fix any files # that aren't owner=root, group=root, or mode=0644 or 0755. @@ -25,6 +23,10 @@ generate_metadata() { # but we want find to ignore the VCS files themselves. NOVCS='. -wholename ./.git -prune -o -wholename ./.bzr -prune -o -wholename ./.hg -prune -o' + # Keep the sort order the same at all times. + LC_COLLATE=C + export LC_COLLATE + if [ "$VCS" = git ] || [ "$VCS" = hg ]; then # These version control systems do not track directories, # so empty directories must be stored specially. @@ -52,7 +54,6 @@ generate_metadata() { # Maybe check for getfattr/setfattr and use them if they're available? } - if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then if [ -f .metadata ]; then # remove obsolete .metadata file -- cgit v1.2.3