summaryrefslogtreecommitdiff
path: root/src/chown-core.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-06-09 13:54:11 +0000
committerJim Meyering <jim@meyering.net>2004-06-09 13:54:11 +0000
commitd46131360a44346eb50fb0f60a16b5cd1951cc65 (patch)
tree7d17d4f5647256718c7e0c89f1f624264c97430e /src/chown-core.c
parentce487455bd749e6542f918f647ff846aa581c73c (diff)
downloadcoreutils-d46131360a44346eb50fb0f60a16b5cd1951cc65.tar.xz
(change_file_owner): Change names of parameters
old_uid and old_gid to required_uid and required_gid respectively.
Diffstat (limited to 'src/chown-core.c')
-rw-r--r--src/chown-core.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/chown-core.c b/src/chown-core.c
index 2811ff92e..7e12e438a 100644
--- a/src/chown-core.c
+++ b/src/chown-core.c
@@ -165,13 +165,14 @@ describe_change (const char *file, enum Change_status changed,
/* Change the owner and/or group of the file specified by FTS and ENT
to UID and/or GID as appropriate.
- FIXME: describe old_uid and old_gid.
+ If REQUIRED_UID is not -1, then skip files with any other user ID.
+ If REQUIRED_GID is not -1, then skip files with any other group ID.
CHOPT specifies additional options.
Return 0 if successful, -1 if errors occurred. */
static int
change_file_owner (FTS *fts, FTSENT *ent,
uid_t uid, gid_t gid,
- uid_t old_uid, gid_t old_gid,
+ uid_t required_uid, gid_t required_gid,
struct Chown_option const *chopt)
{
char const *file_full_name = ent->fts_path;
@@ -216,7 +217,7 @@ change_file_owner (FTS *fts, FTSENT *ent,
if (errors)
do_chown = false;
- else if (old_uid == (uid_t) -1 && old_gid == (gid_t) -1
+ else if (required_uid == (uid_t) -1 && required_gid == (gid_t) -1
&& chopt->verbosity == V_off && ! chopt->root_dev_ino)
do_chown = true;
else
@@ -238,8 +239,10 @@ change_file_owner (FTS *fts, FTSENT *ent,
}
do_chown = (!errors
- && (old_uid == (uid_t) -1 || old_uid == file_stats->st_uid)
- && (old_gid == (gid_t) -1 || old_gid == file_stats->st_gid));
+ && (required_uid == (uid_t) -1
+ || required_uid == file_stats->st_uid)
+ && (required_gid == (gid_t) -1
+ || required_gid == file_stats->st_gid));
}
if (do_chown && ROOT_DEV_INO_CHECK (chopt->root_dev_ino, file_stats))