summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-05-16 06:43:56 +0100
committerPetr Baudis <pasky@ucw.cz>2011-05-27 01:38:30 +0200
commit54717475a5f7d0ecc25dfb0cf51d9cf43d4ff8f8 (patch)
tree4001d01da0cfba430e7d90f107390aae77bb83ce
parent7d76befe53d074de0b7a8d78a64a89c57908ec44 (diff)
downloadglibc-54717475a5f7d0ecc25dfb0cf51d9cf43d4ff8f8.tar.gz
Remove shortcut for call of chown
The UID might differ, too. Just call chown unconditionally. (cherry picked from commit f3799213a3ee8265ba47fad33d9cff71d97ab0d4)
-rw-r--r--ChangeLog5
-rw-r--r--login/programs/pt_chown.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 884b21e766..0609c9183a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-16 Ulrich Drepper <drepper@gmail.com>
+
+ [BZ #11697]
+ * login/programs/pt_chown.c (do_pt_chown): Always call chown.
+
2011-05-14 Ulrich Drepper <drepper@gmail.com>
[BZ #12083]
diff --git a/login/programs/pt_chown.c b/login/programs/pt_chown.c
index 4c36f2ceac..9aa34e7cef 100644
--- a/login/programs/pt_chown.c
+++ b/login/programs/pt_chown.c
@@ -64,7 +64,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "1999");
+"), "2011");
}
static char *
@@ -123,7 +123,7 @@ do_pt_chown (void)
/* Set the owner to the real user ID, and the group to that special
group ID. */
- if (st.st_gid != gid && chown (pty, getuid (), gid) < 0)
+ if (chown (pty, getuid (), gid) < 0)
return FAIL_EACCES;
/* Set the permission mode to readable and writable by the owner,