Browse Source

libdpkg: Use ~S_IFMT instead of hardcoded 07777 literal in chmod() call

Guillem Jover 11 years ago
parent
commit
c5b1985591
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/dpkg/file.c

+ 1 - 1
lib/dpkg/file.c

@@ -57,7 +57,7 @@ file_copy_perms(const char *src, const char *dst)
 		ohshite(_("unable to change ownership of target file '%.250s'"),
 		        dst);
 
-	if (chmod(dst, (stab.st_mode & 07777)) == -1)
+	if (chmod(dst, (stab.st_mode & ~S_IFMT)) == -1)
 		ohshite(_("unable to set mode of target file '%.250s'"), dst);
 }