[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fileutils-4.1 bugfix in modechange.c
From: |
Clifford Wolf |
Subject: |
fileutils-4.1 bugfix in modechange.c |
Date: |
Wed, 27 Mar 2002 16:58:42 +0100 (CET) |
Hi,
here is a patch fixes this bug in fileutils-4.1:
dilbert:~$ chmod 770 x
dilbert:~$ chmod.broken o=u x
dilbert:~$ ls -l x
-rwxrwxr-x 1 root root 25952 Mar 27 15:06 x
the file mode should be '-rwxrwxrwx'. That's because of a typo
in lib/modechange.c:
--- fileutils-4.1/lib/modechange.c.orig Wed Mar 27 15:22:14 2002
+++ fileutils-4.1/lib/modechange.c Wed Mar 27 15:45:19 2002
@@ -414,17 +414,17 @@
if (changes->value & S_IRWXU)
/* Copy `u' permissions onto `g' and `o'. */
value |= ((value & S_IRUSR ? S_IRGRP | S_IROTH : 0)
- | (value & S_IWUSR ? S_IWGRP | S_IROTH : 0)
+ | (value & S_IWUSR ? S_IWGRP | S_IWOTH : 0)
| (value & S_IXUSR ? S_IXGRP | S_IXOTH : 0));
else if (changes->value & S_IRWXG)
/* Copy `g' permissions onto `u' and `o'. */
value |= ((value & S_IRGRP ? S_IRUSR | S_IROTH : 0)
- | (value & S_IWGRP ? S_IWUSR | S_IROTH : 0)
+ | (value & S_IWGRP ? S_IWUSR | S_IWOTH : 0)
| (value & S_IXGRP ? S_IXUSR | S_IXOTH : 0));
else
/* Copy `o' permissions onto `u' and `g'. */
value |= ((value & S_IROTH ? S_IRUSR | S_IRGRP : 0)
- | (value & S_IWOTH ? S_IWUSR | S_IRGRP : 0)
+ | (value & S_IWOTH ? S_IWUSR | S_IWGRP : 0)
| (value & S_IXOTH ? S_IXUSR | S_IXGRP : 0));
/* In order to change only `u', `g', or `o' permissions,
yours,
- clifford
--
| Clifford Wolf ............ www.clifford.at . . . IRC: http://opirc.nu/
| ROCK Linux Workgroup ..... www.rocklinux.org . . Tel: +43-699-10063494
| NTx Consulting Group ..... www.ntx.at . . . . . Fax: +43-2235-42788-4
+------=[ Usenet Compliant Signature (RFC 2646) ]=---> www.rocklinux.net
Reality corrupted. Reboot universe? (Y/N)
- fileutils-4.1 bugfix in modechange.c,
Clifford Wolf <=