chown command not found!

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

chown command not found!

amit tandial
Hi Everybody,
In which package, I can get chown.exe?

Thanks
-tandial

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Tor Lillqvist
> In which package, I can get chown.exe?

Hopefully not in any, because a "port" of chown to Windows would be
mostly meaningless, as the file protection mechanism in Windows is not
at all like POSIX's owner, group and rwxrwxrwx. Sure, also Windows has
the concept of a file "owner", but it doesn't have the same semantics
as in the POSIX model. In Windows one typically manipulates the file's
ACL to change how it is protected from or accessible to specific users
and/or groups.

(Sure, Cygwin has chown, and Cygwin's protection mechanism tries very
hard to mimic POSIX semantics, in a somewhat hacky fashion that
doesn't interoperate nicely with native Windows programs, and it
might even seem to work sensibly from Cygwin programs (only). But as
you are asking on the MinGW list, you presumably are not interested in
the Cygwin world anyway.)

Instead of asking for chown you should explain what is it the end
result you want to achiveve, for which you think you need chown?

Would cacls.exe (comes with Windows) (or its successor icacls.exe) be
what you are looking for?

Note that their command-like arguments are not like those of chown or
chmod at all, but require some getting used to. Icacls has a /setowner
option, but it doesn't seem possible to use it to change ownership as
easily and arbitrarily as on POSIX, it probably is not what you want
either. There is also takeown.exe.

--tml

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Erwin Waterlander
In reply to this post by amit tandial
Op 11/13/2009 05:43 AM, amit tandial schreef:
> Hi Everybody,
> In which package, I can get chown.exe?
The GnuWin32 project has a port of chown in their coreutils package.
See http://gnuwin32.sourceforge.net/packages/coreutils.htm

Erwin Waterlander


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Charles Wilson-2
In reply to this post by amit tandial
amit tandial wrote:
> In which package, I can get chown.exe?
>
It's not part of the "standard" MSYS installation, but the coreutils
package updates often contain a version of chown.  In the new
modularized scheme, the standard
   coreutils-5.97-2-msys-1.0.11-bin.tar.lzma
package, which contains the "standard" tools, does NOT include chown,
but the extra add-on package
   coreutils-5.97-2-msys-1.0.11-ext.tar.lzma
does.

However, as Tor pointed out, this is an MSYS implementation (that is, a
"cygwin"-style implementation). Its interaction with "native" tools
is...not guaranteed to be what you expect, which is WHY it is not
included in the standard MSYS installation.

--
Chuck

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Tor Lillqvist
In reply to this post by Erwin Waterlander
> The GnuWin32 project has a port of chown in their coreutils package.
> See http://gnuwin32.sourceforge.net/packages/coreutils.htm

Sure. Did you actually try it? Please take a look into how they
implement  chown.

Assuming it's the __chown() in io/chown.c from their libgw32c 0.4 that
eventually gets called, it looks like this:

/* Change the owner and group of FILE.  */
int
__chown (file, owner, group)
     const char *file;
     uid_t owner;
     gid_t group;
{
  if (file == NULL)
    {
      __set_errno (EINVAL);
      return -1;
    }

//  __set_errno (ENOSYS);
  return 0;
}

Do you notice the complete lack of code to actually do anything...?

--tml

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Tor Lillqvist
And let me add that if one would want to implement (not "port") a
chown command for Windows (i.e. "native" Windows, not Cygwin or MSYS),
it is not possible to write a POSIX-style funtion with uid_t and gid_t
owner and group parameters to actually do it, as Windows doesn't have
integer uids and gids.

Instead one would need to look up the SIDs corresponding to the user
(and perhaps group) names mentioned on the command line, get the
security descriptor of the file, change the owner (and perhaps primary
group) SIDs in that, and set the file's security descriptor. Something
like that. Check MSDN for details, start browsing from SetFileSecurity
or SetNamedSecurityInfo for instance.

--tml

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Tor Lillqvist
> Instead one would need to look up the SIDs corresponding to the user
> (and perhaps group) names mentioned on the command line, get the
> security descriptor of the file, change the owner (and perhaps primary
> group) SIDs in that,  ...

As can be expected, somebody already has done that.

The first hit when googling for keywords "chown windows" is
http://wwwthep.physik.uni-mainz.de/~frink/chown/readme.html with the
source code in http://wwwthep.physik.uni-mainz.de/~frink/chown.zip .
The chown.c source code does roughly what I indicated in my previous
mesage.

Note that the code is from 1998, though, so it probably uses some
obsolete API and needs modifications to work nicely in modern Active
Directory environments and whatnot. The basic principles should still
be the same as in NT 4, though.

--tml

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Erwin Waterlander
In reply to this post by Tor Lillqvist
Op 11/13/2009 01:51 PM, Tor Lillqvist schreef:
>
> Do you notice the complete lack of code to actually do anything...?
>
>  

I don't expect it to do anything useful. Sometimes it can be handy to
have a 'dummy' chown, so that scripts an makefiles don't break because
chown is lacking.

Erwin



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Tuomo Latto
Erwin Waterlander wrote:
> Op 11/13/2009 01:51 PM, Tor Lillqvist schreef:
>> Do you notice the complete lack of code to actually do anything...?
>
> I don't expect it to do anything useful. Sometimes it can be handy to
> have a 'dummy' chown, so that scripts an makefiles don't break because
> chown is lacking.

Here:
cat > chown <<END
#!/bin/sh
END


--
Tuomo

... Press any key to continue or any other key to quit


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Keith Marshall
On Friday 13 November 2009 17:13:57 Tuomo Latto wrote:
> > I don't expect it to do anything useful. Sometimes it can be
> > handy to have a 'dummy' chown, so that scripts an makefiles
> > don't break because chown is lacking.
>
> Here:
> cat > chown <<END
> #!/bin/sh
> END

Or even just:
  echo '#!/bin/sh' > /bin/chown

(putting it in /bin ensures that it is available, no matter what your
current working directory).

--

Regards,
Keith.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Keith Marshall
In reply to this post by Charles Wilson-2
On Friday 13 November 2009 12:49:03 Charles Wilson wrote:

> the standard
>    coreutils-5.97-2-msys-1.0.11-bin.tar.lzma
> package, which contains the "standard" tools, does NOT include
> chown, but the extra add-on package
>    coreutils-5.97-2-msys-1.0.11-ext.tar.lzma
> does.
>
> However, as Tor pointed out, this is an MSYS implementation (that
> is, a "cygwin"-style implementation). Its interaction with
> "native" tools is...not guaranteed to be what you expect, which is
> WHY it is not included in the standard MSYS installation.

Indeed, irrespective of its interaction with *other* tools, it may
not even do what you expect in its own right.  Does it actually do
anything at all?

--

Regards,
Keith.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Roumen Petrov
In reply to this post by Erwin Waterlander
Erwin Waterlander wrote:

> Op 11/13/2009 01:51 PM, Tor Lillqvist schreef:
>> Do you notice the complete lack of code to actually do anything...?
>>
>>  
>
> I don't expect it to do anything useful. Sometimes it can be handy to
> have a 'dummy' chown, so that scripts an makefiles don't break because
> chown is lacking.
>
> Erwin

The script is buggy as in cross-environment we cannot check for commands
(1) available on host/target platform (even to same os !!!! but
different architecture).

I think that you has to contact authors and to ask to update script with
more cross-platform suitable check for functions/commands.

(1) I understand the blocking issue is command not function.

Roumen

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Charles Wilson-2
In reply to this post by Keith Marshall
Keith Marshall wrote:

> Indeed, irrespective of its interaction with *other* tools, it may
> not even do what you expect in its own right.  Does it actually do
> anything at all?

Nope. Looks like it is a no-op, here, as well.  I checked by using an
Administrator account to "chown" a file using msys-chown.exe -- and then
checking the result using cygwin's 'getfacl', as well as various flavors
of 'ls'.

However, if msys-chown is a nop, then it's due to MSYS's internal
implementation, not coreutils. Coreutils' chown source code is the same
as on any other platform; it hasn't been modified for msys. I'm sorry I
neglected to check the MSYS code itself before responding to this
thread; I only looked at coreutils' chown.exe source code.

--
Chuck







------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Tor Lillqvist
In reply to this post by Tor Lillqvist
> The first hit when googling for keywords "chown windows" is
> http://wwwthep.physik.uni-mainz.de/~frink/chown/readme.html with the
> source code in http://wwwthep.physik.uni-mainz.de/~frink/chown.zip .

And it indeed seems to work. Only when run with administrator
privileges, though, as setting the file owner requires enabling
privileges like Take Ownership. So very unlike POSIX, but what else
could one expect?

(Note that for instance the MSYS ls does *not* show the real owners of files.)

I can't really recommend that the original poster use this program,
though, before knowing what his actual use case is. Amit, can you tell
us in what context you need, or think you need, a chown command on
Windows?

--tml

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: chown command not found!

Earnie Boyd
In reply to this post by Charles Wilson-2
Quoting Charles Wilson <[hidden email]>:

> However, if msys-chown is a nop, then it's due to MSYS's internal
> implementation, not coreutils. Coreutils' chown source code is the same
> as on any other platform; it hasn't been modified for msys. I'm sorry I
> neglected to check the MSYS code itself before responding to this
> thread; I only looked at coreutils' chown.exe source code.

It's been too long for me to remember clearly but I may have modified  
it to return a ENOSYS which would be the reason for the no-op.

--
Earnie




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users