Multiple problems (probably) starting up new installation

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

Multiple problems (probably) starting up new installation

Michael Enright
I have a few files that I want to compile and run in a new Windows 10 setup.
I setup cygwin64 and copied the files to a subdirectory of my home directory.
I noticed that my prompt indicated that my home directory was
"/home/Mike Enright". I decided that in the long run that would be
bad.
So I followed a tip from Stack Overflow [1]to use /etc/passwd to fix
this. Apparently the idea is to map the Windows SID to my desired user
name "menright" instead of "\"Mike Enright\"".
And also rename the created home directory accordingly.
So now I have /home/menright and some files under there and
/etc/password contains a line that maps an SID to menright.

Due to a problem out of scope of this list Eclipse launches notepad
when I want to edit CMakeLists.txt. Then Notepad says "You do not have
permission to open this file"

I noticed "ls -l CMakeLists.txt" gets:
----rwx---+ 1 menright Mike Enright     0 Oct 21 15:02 CMakeLists.txt
It's really odd that the user permissions are zero.

So I want notepad to have permission to open this file on my behalf.
Oddly I made a file called "me" with touch and I was able to edit that
with notepad.

I would also ask any advice. I fear that this permissions issue is due
to some underlying issue that I need to nip in the bud before I get
too much work done.

I think I'd also like to have my personal group "Mike Enright" renamed
to "menright" just to be sane.

[1] https://stackoverflow.com/questions/19613654/rename-change-cygwin-username

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Multiple problems (probably) starting up new installation

Andrey Repin
Greetings, Michael Enright!

> I have a few files that I want to compile and run in a new Windows 10 setup.
> I setup cygwin64 and copied the files to a subdirectory of my home directory.
> I noticed that my prompt indicated that my home directory was
> "/home/Mike Enright". I decided that in the long run that would be
> bad.
> So I followed a tip from Stack Overflow [1]to use /etc/passwd to fix
> this. Apparently the idea is to map the Windows SID to my desired user
> name "menright"

I would actually suggest renaming the system user, if possible.

> instead of "\"Mike Enright\"".
> And also rename the created home directory accordingly.
> So now I have /home/menright and some files under there and
> /etc/password contains a line that maps an SID to menright.

> Due to a problem out of scope of this list Eclipse launches notepad
> when I want to edit CMakeLists.txt. Then Notepad says "You do not have
> permission to open this file"

> I noticed "ls -l CMakeLists.txt" gets:
> ----rwx---+ 1 menright Mike Enright     0 Oct 21 15:02 CMakeLists.txt
> It's really odd that the user permissions are zero.

the "+" says that there's extended ACL present. So, nothing odd.

> So I want notepad to have permission to open this file on my behalf.
> Oddly I made a file called "me" with touch and I was able to edit that
> with notepad.

> I would also ask any advice. I fear that this permissions issue is due
> to some underlying issue that I need to nip in the bud before I get
> too much work done.

If you plan to mix Cygwin and system $HOME directories, make sure you mount
them with "noacl" flag in Cygwin.
Then permissions management will be deferred to Windows.

> I think I'd also like to have my personal group "Mike Enright" renamed
> to "menright" just to be sane.

> [1] https://stackoverflow.com/questions/19613654/rename-change-cygwin-username

As any system administrator would tell you, user names with spaces, so is with
non-ASCII characters, are bad for system health.


--
With best regards,
Andrey Repin
Monday, October 22, 2018 1:34:18

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Multiple problems (probably) starting up new installation

Michael Enright
On Sun, Oct 21, 2018 at 3:50 PM Andrey Repin  wrote:
>
> I would actually suggest renaming the system user, if possible.

All my previous setups used a silly name like "Mike" that was not
linked to a Microsoft account but still chosen automatically, or my
preferred username "menright" if I noticed the chance to set the name
myself during initial Windows setup. These setups don't seem to have
been as difficult to get started with.

It seems like everyone who faces this (based on more extensive
searching starting from your suggestion to rename the account) ends up
creating a local account with a well-chosen name.  The data have to be
transferred from one account to the other if there is anything to
transfer. The advantages, if there are any, of a link to a Microsoft
account apparently can be achieved by linking the local account to the
desired Microsoft account  after the local account is set up. I don't
see anything about actually renaming the account.

This seems like a good place to start:
https://superuser.com/questions/1129165/how-to-rename-a-user-account-that-is-already-linked-to-a-microsoft-account

>
> > ----rwx---+ 1 menright Mike Enright     0 Oct 21 15:02 CMakeLists.txt
>
> the "+" says that there's extended ACL present. So, nothing odd.
>

The Windows view of this set of permissions (070 plus whatever is in
the rest of the ACL) seems to be that Windows programs can't do very
much with this file. So it's odd from that POV and I wonder if that
was caused by my renaming the "Cygwin account". Using cacls I see the
Windows username in some of the entries and I don't see the cygwin
username in any. I know that I can get a workable ACL with chmod but I
can see that executables built by the compiler are not executable,
either by name from cygwin bash or by double click from Windows
Explorer. This is the first few lines from cacls:
$ cacls moneymaker
C:\cygwin64\home\menright\moneymaker NULL SID:(DENY)(special access:)
                                              READ_CONTROL
                                              FILE_READ_EA
                                              FILE_WRITE_EA
                                              FILE_EXECUTE
                                              FILE_DELETE_CHILD

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Multiple problems (probably) starting up new installation

Andrey Repin
Greetings, Michael Enright!

>>
>> > ----rwx---+ 1 menright Mike Enright     0 Oct 21 15:02 CMakeLists.txt
>>
>> the "+" says that there's extended ACL present. So, nothing odd.
>>

> The Windows view of this set of permissions (070 plus whatever is in
> the rest of the ACL)

This is NOT "windows" view, this is Cygwin view.
For ACL, check getfacl <file>.

> seems to be that Windows programs can't do very
> much with this file.

See my previous note about setting noacl flag to increase interoperability
with native programs.

> So it's odd from that POV and I wonder if that was caused by my renaming the
> "Cygwin account".

I'm not clear on how exactly renaming was done, so can't comment.

> Using cacls I see the
> Windows username in some of the entries and I don't see the cygwin
> username in any. I know that I can get a workable ACL with chmod but I
> can see that executables built by the compiler are not executable,
> either by name from cygwin bash or by double click from Windows
> Explorer. This is the first few lines from cacls:
> $ cacls moneymaker
> C:\cygwin64\home\menright\moneymaker NULL SID:(DENY)(special access:)
>                                               READ_CONTROL
>                                               FILE_READ_EA
>                                               FILE_WRITE_EA
>                                               FILE_EXECUTE
>                                               FILE_DELETE_CHILD

This is normal (documented) behavior for less-than-trivial permission setups.
However, without a full dump of cacls it's hard to judge correctness of the
ACL on a given file.


--
With best regards,
Andrey Repin
Monday, October 22, 2018 14:58:59

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Multiple problems (probably) starting up new installation

cyg Simple
In reply to this post by Michael Enright
On 10/21/2018 6:24 PM, Michael Enright wrote:

> I have a few files that I want to compile and run in a new Windows 10 setup.
> I setup cygwin64 and copied the files to a subdirectory of my home directory.
> I noticed that my prompt indicated that my home directory was
> "/home/Mike Enright". I decided that in the long run that would be
> bad.
> So I followed a tip from Stack Overflow [1]to use /etc/passwd to fix
> this. Apparently the idea is to map the Windows SID to my desired user
> name "menright" instead of "\"Mike Enright\"".
> And also rename the created home directory accordingly.
> So now I have /home/menright and some files under there and
> /etc/password contains a line that maps an SID to menright.
>

Rather than using /etc/passwd just create another account as menright
and install Cygwin in the global user space.  I have 3 accounts on my
system and use three files to login to one or the other one.  Advantage
is that you can separate different projects based on user.

<file name="/usr/local/bin/start">
#! /bin/bash
cmd /c start `cygpath -w -- "${@//&/^&}"`
</file>

<file name="/usr/local/bin/sudosu">
#! /bin/sh
start sudosu.bat $1
</file>

<file name="/usr/local/bin/sudosu.bat">
c:\windows\system32\runas /user:%1  "c:\opt\cygwin64\bin\mintty.exe -e
/usr/bin/bash -il"
exit
</file>

<example>
sudosu menright
sudosu '"Mike Enright"'
</example>

HTH
--
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple