auto-import changelog data from which-2.13-3.src.rpm

Wed Feb 27 2002 Than Ngo <than@redhat.com> 2.13-3
- use access instead stat in AFS environment (bug #60353)
Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild
Wed Dec 05 2001 Florian La Roche <Florian.LaRoche@redhat.de>
- update to 2.13
This commit is contained in:
cvsdist 2004-09-09 14:18:06 +00:00
parent ed2bb58782
commit b267895a41
4 changed files with 111 additions and 2 deletions

View File

@ -1 +1 @@
which-2.12.tar.gz which-2.13.tar.gz

View File

@ -1 +1 @@
8955df4fe35e29378a5eda31a61de39e which-2.12.tar.gz ab5a2b929b87c7917887e70f0204bce5 which-2.13.tar.gz

107
which-2.13-afs.patch Normal file
View File

@ -0,0 +1,107 @@
--- which-2.13/bash.c.orig Tue Feb 26 23:39:42 2002
+++ which-2.13/bash.c Wed Feb 27 00:02:36 2002
@@ -33,7 +33,6 @@
*/
#define HAVE_GETGROUPS
#undef SHELL
-#undef AFS
#undef NOGROUP
/*
@@ -146,51 +145,52 @@
if (S_ISDIR (finfo.st_mode))
return (FS_EXISTS);
-#if defined (AFS)
- /* We have to use access(2) to determine access because AFS does not
- support Unix file system semantics. This may produce wrong
- answers for non-AFS files when ruid != euid. I hate AFS. */
- if (access (name, X_OK) == 0)
- return (FS_EXISTS | FS_EXECABLE);
- else
- return (FS_EXISTS);
-#else /* !AFS */
-
- /* Find out if the file is actually executable. By definition, the
- only other criteria is that the file has an execute bit set that
- we can use. */
- if (user_id == -1)
- user_id = geteuid (); /* CHANGED: bash uses: current_user.euid; */
-
- /* Root only requires execute permission for any of owner, group or
- others to be able to exec a file. */
- if (user_id == 0)
+ if (getenv("AFS")) {
+ /* We have to use access(2) to determine access because AFS does not
+ support Unix file system semantics. This may produce wrong
+ answers for non-AFS files when ruid != euid. I hate AFS. */
+ if (access (name, X_OK) == 0)
+ return (FS_EXISTS | FS_EXECABLE);
+ else
+ return (FS_EXISTS);
+ }
+ else /* !AFS */
{
- int bits;
-
- bits = (u_mode_bits (finfo.st_mode) |
- g_mode_bits (finfo.st_mode) |
- o_mode_bits (finfo.st_mode));
-
- if (X_BIT (bits))
- return (FS_EXISTS | FS_EXECABLE);
- }
-
- /* If we are the owner of the file, the owner execute bit applies. */
- if (user_id == finfo.st_uid && X_BIT (u_mode_bits (finfo.st_mode)))
- return (FS_EXISTS | FS_EXECABLE);
-
- /* If we are in the owning group, the group permissions apply. */
- if (group_member (finfo.st_gid) && X_BIT (g_mode_bits (finfo.st_mode)))
- return (FS_EXISTS | FS_EXECABLE);
-
- /* If `others' have execute permission to the file, then so do we,
- since we are also `others'. */
- if (X_BIT (o_mode_bits (finfo.st_mode)))
- return (FS_EXISTS | FS_EXECABLE);
- else
- return (FS_EXISTS);
-#endif /* !AFS */
+ /* Find out if the file is actually executable. By definition, the
+ only other criteria is that the file has an execute bit set that
+ we can use. */
+ if (user_id == -1)
+ user_id = geteuid (); /* CHANGED: bash uses: current_user.euid; */
+
+ /* Root only requires execute permission for any of owner, group or
+ others to be able to exec a file. */
+ if (user_id == 0)
+ {
+ int bits;
+
+ bits = (u_mode_bits (finfo.st_mode) |
+ g_mode_bits (finfo.st_mode) |
+ o_mode_bits (finfo.st_mode));
+
+ if (X_BIT (bits))
+ return (FS_EXISTS | FS_EXECABLE);
+ }
+
+ /* If we are the owner of the file, the owner execute bit applies. */
+ if (user_id == finfo.st_uid && X_BIT (u_mode_bits (finfo.st_mode)))
+ return (FS_EXISTS | FS_EXECABLE);
+
+ /* If we are in the owning group, the group permissions apply. */
+ if (group_member (finfo.st_gid) && X_BIT (g_mode_bits (finfo.st_mode)))
+ return (FS_EXISTS | FS_EXECABLE);
+
+ /* If `others' have execute permission to the file, then so do we,
+ since we are also `others'. */
+ if (X_BIT (o_mode_bits (finfo.st_mode)))
+ return (FS_EXISTS | FS_EXECABLE);
+ else
+ return (FS_EXISTS);
+ } /* !AFS */
}
/* Return 1 if STRING is an absolute program name; it is absolute if it

View File

@ -1,2 +1,4 @@
# Initialization script for bash and sh # Initialization script for bash and sh
# export AFS, if you are in AFS environment
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'