bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: --from option for chown doesn't work


From: Jim Meyering
Subject: Re: --from option for chown doesn't work
Date: 07 May 2001 22:18:43 +0200
User-agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.0.103

"Andrew Pham" <address@hidden> wrote:
| Hi ,
|
| I found that chown --from=CURRENT_OWNER:CURRENT_GROUP does not work.  It
| gave back a success status but did not actually change a file's user and/or
| group.    I had tried this on RedHat 7.0 and SuSe 7.1.

Thanks for the report!

I'll have to add a root-only test for this.
Here's a fix:

Index: chown.c
===================================================================
RCS file: /fetish/fileutils/src/chown.c,v
retrieving revision 1.95
diff -u -p -r1.95 chown.c
--- chown.c     2001/02/17 14:23:43     1.95
+++ chown.c     2001/05/07 20:16:40
@@ -173,11 +173,11 @@ main (int argc, char **argv)
        case FROM_OPTION:
          {
            char *u_dummy, *g_dummy;
-           const char *e = parse_user_spec (argv[optind],
+           const char *e = parse_user_spec (optarg,
                                             &old_uid, &old_gid,
                                             &u_dummy, &g_dummy);
            if (e)
-             error (1, 0, "%s: %s", quote (argv[optind]), e);
+             error (1, 0, "%s: %s", quote (optarg), e);
            break;
          }
        case 'R':



reply via email to

[Prev in Thread] Current Thread [Next in Thread]