From a53129d4b7a60b1fc29173accb5da5b74d2d16ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20H=C3=A4rdeman?= <david@hardeman.nu>
Date: Sun, 20 May 2007 11:36:53 +0200
Subject: Fix chmod so that it actually works

---
 metastore.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/metastore.c b/metastore.c
index 733727d..4408cda 100644
--- a/metastore.c
+++ b/metastore.c
@@ -152,8 +152,8 @@ compare_fix(struct metaentry *real, struct metaentry *stored, int cmp)
 
 	if (cmp & DIFF_MODE) {
 		msg(MSG_NORMAL, "%s:\tchanging mode from 0%o to 0%o\n",
-		    real->path, real->mode, stored->mode);
-		if (chmod(real->path, real->mode))
+		    real->path, real->mode & 07777, stored->mode & 07777);
+		if (chmod(real->path, stored->mode & 07777))
 			msg(MSG_DEBUG, "\tchmod failed: %s\n", strerror(errno));
 	}
 
-- 
cgit v1.2.1