summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog8
-rw-r--r--etckeeper.spec2
-rwxr-xr-xpre-commit.d/30store-metadata21
3 files changed, 15 insertions, 16 deletions
diff --git a/debian/changelog b/debian/changelog
index 4614159..44d5466 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,13 @@
etckeeper (0.58) UNRELEASED; urgency=low
+ * Changed to store all permissions of files and directories, even those
+ with standard permissions of 644 and 755. This is unfortunately necessary
+ in order to support etckeeper init on a checkout that was made with a
+ nonstandard umask, in which case the files that were expected to be
+ 644 and 755, won't be. Closes: #649701
+ Thanks to Дмитрий Матросов for reporting the bug and developing
+ a fixup script (attached to the bug) which could be used if you've
+ already encountered this problem.
* Bugfix for filenames containing single quotes.
-- Joey Hess <joeyh@debian.org> Fri, 25 Nov 2011 12:00:55 -0400
diff --git a/etckeeper.spec b/etckeeper.spec
index dcb2c4d..ea2c13a 100644
--- a/etckeeper.spec
+++ b/etckeeper.spec
@@ -1,5 +1,5 @@
Name: etckeeper
-Version: 0.57
+Version: 0.58
Release: 4%{?dist}
Summary: store /etc in git, mercurial, bzr or darcs
diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata
index aeec374..3b79e46 100755
--- a/pre-commit.d/30store-metadata
+++ b/pre-commit.d/30store-metadata
@@ -43,14 +43,16 @@ shellquote() {
}
generate_metadata() {
- # This function generates the script commands to fix any files
- # that aren't owner=root, group=root, or mode=0644 or 0755.
+ # This function generates the script commands to fix any file
+ # ownerships that aren't owner=root, group=root, as well as to
+ # store the permissions of all files (all are needed because the
+ # user may have an unusual umask).
# The script is produced on stdout. Errors go to stderr.
#
# The script can use a 'maybe' function, which only runs a command
# if the file in its last argument exists.
- # We maintain the permissions on the directory containing VCS data
+ # We want files in the directory containing VCS data
# but we want find to ignore the VCS files themselves.
#
# (Note that when using this, the find expression must end with
@@ -83,18 +85,7 @@ generate_metadata() {
# Find all files and directories that don't have root as the group
find $NOVCS \! -group $(id -g) -print | statf "maybe chgrp %G" | sort | filter_unknown 'maybe chgrp' group
- # Find all directories that aren't 0755
- find $NOVCS -type d \! -perm 0755 -print | statf "maybe chmod %a" | sort
-
- if [ "$VCS" = darcs ]; then
- # Find all files that aren't 0644 (darcs doesn't maintain
- # the executable bit).
- find $NOVCS -type f \! -perm 0644 -print | statf "maybe chmod %a" | sort
- else
- # Find all files that aren't 0644 or 0755 (we can assume the VCS will
- # maintain the executable bit).
- find $NOVCS -type f \! -perm 0644 \! -perm 0755 -print | statf "maybe chmod %a" | sort
- fi
+ find $NOVCS \( -type f -or -type d \) -print | statf "maybe chmod %a" | sort
# We don't handle xattrs.
# Maybe check for getfattr/setfattr and use them if they're available?