Discussion:
[Mingw-users] How do I change username and/or home directory?
Walter Belhaven
2006-03-16 19:19:01 UTC
Permalink
Hi,

My Windows XP username is my full name ("First Last") and, therefore,
so apparently is my MinGW username. As a result, my username and my
home directory both have a space in them, causing certain Makefiles and
other stuff to fail.

Is there a way to change my username and/or home directory in MinGW? I
searched the archives but didn't see the answer.

I do see how to do it in cygwin, but I don't see the equivalent of
/etc/passwd in MinGW. I do see C:/msys/1.0/etc/profile which contains
these fateful lines:

# Set up USER's home directory
if [ -z "$HOME" ]; then
HOME="/home/$LOGNAME"
fi

Can I just edit this to say something like "HOME="/home/foo" without
breaking everything? I'm the only user on this system, so I don't care
if this "breaks" for someone else. I do care if it breaks for me
though. :) I'd rather not change my Windows username if at all
possible.

Thanks,
WB

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Keith MARSHALL
2006-03-17 08:52:06 UTC
Permalink
Post by Walter Belhaven
Is there a way to change my username and/or home directory in
MinGW? I searched the archives but didn't see the answer.
I do see how to do it in cygwin, but I don't see the equivalent
of /etc/passwd in MinGW. I do see C:/msys/1.0/etc/profile which
# Set up USER's home directory
if [ -z "$HOME" ]; then
HOME="/home/$LOGNAME"
fi
So if you define HOME before MSYS starts, say by adding a user
environment variable via Windoze Control Panel, then the value you
define there will persist -- this code only sets HOME if it hasn't
been previously defined.
Post by Walter Belhaven
Can I just edit this to say something like "HOME="/home/foo"
without breaking everything?
We don't recommend customising /etc/profile, simply because if you
subsequently upgrade your MSYS installation, then your customised
settings will be overridden. User customisations are best defined
in $HOME/.profile, which isn't overwritten during an upgrade, but
of course, HOME needs to be defined *before* $HOME/.profile can
be invoked.
Post by Walter Belhaven
I'm the only user on this system, so I don't care if this "breaks"
for someone else. I do care if it breaks for me though. :) I'd
rather not change my Windows username if at all possible.
Neither changing the definition of HOME, nor even of LOGNAME, should
break anything. Be aware though, that your Windoze user name will
persist in the text returned by the `id' command, and in any commits
you make to a local CVS -- I wish I knew how to change that, without
resorting to Cygwin for *my* local CVS commits.

Regards,
Keith.
Earnie Boyd
2006-03-17 13:02:04 UTC
Permalink
Post by Keith MARSHALL
Post by Walter Belhaven
I'm the only user on this system, so I don't care if this "breaks"
for someone else. I do care if it breaks for me though. :) I'd
rather not change my Windows username if at all possible.
Neither changing the definition of HOME, nor even of LOGNAME, should
break anything. Be aware though, that your Windoze user name will
persist in the text returned by the `id' command, and in any commits
you make to a local CVS -- I wish I knew how to change that, without
resorting to Cygwin for *my* local CVS commits.
Of course the developer of MSYS uses a logon with a single word. :)
Perhaps we should modify MSYS to substitute the spaces in a windows
user name to an underscore.

Earnie Boyd

http://shop.siebunlimited.com
Keith MARSHALL
2006-03-17 13:48:08 UTC
Permalink
Post by Earnie Boyd
Post by Keith MARSHALL
Neither changing the definition of HOME, nor even of LOGNAME, should
break anything. Be aware though, that your Windoze user name will
persist in the text returned by the `id' command, and in any commits
you make to a local CVS -- I wish I knew how to change that, without
resorting to Cygwin for *my* local CVS commits.
Of course the developer of MSYS uses a logon with a single word. :)
Perhaps we should modify MSYS to substitute the spaces in a windows
user name to an underscore.
Perhaps. But spaces in the user name aren't my problem.

I work for a large multinational corporation, with a centrally managed
IT department. All users of IT resources log in to a single Windoze
domain. The gnomes who administer that domain seem to labour under
the crass and misinformed notion that it is more cracker resistant to
issue each user with a user name comprising a four letter site acronym,
and a four digit number, than to use anything that is even remotely
related to the user's actual name.

Right. So my Windoze user name is, for example `wxyz0099'. I have
a CVS managed project, with a repository shared within the corporate
network domain. I check in updates using using the MSYS CVS client
tools, and all the log entries show that the changes were made by
`wxyz0099'. No one, outside of the central IT admin group, has any
way of knowing who really made those changes, and of course central
IT has no interest whatsoever in the engineering projects on which
I am likely to work, and will not divulge to my colleagues who
`wxyz0099' actually is.

So, I switch to Cygwin. My Windoze user name is still `wxyz0099',
but now I can use /etc/passwd to map that to something which my
engineering colleagues can recognise as belonging to me, and when
I use Cygwin's CVS client tools to commit my updates, the logs show
this alternative user name; so now, everyone who needs to know can
easily identify me as the author of my commits. Just a shame that
I can't get a similar workaround, for the corporate bullshit, to
work in MSYS.

Regards,
Keith.
Earnie Boyd
2006-03-17 15:43:11 UTC
Permalink
Post by Keith MARSHALL
So, I switch to Cygwin. My Windoze user name is still `wxyz0099',
but now I can use /etc/passwd to map that to something which my
engineering colleagues can recognise as belonging to me, and when
I use Cygwin's CVS client tools to commit my updates, the logs show
this alternative user name; so now, everyone who needs to know can
easily identify me as the author of my commits. Just a shame that
I can't get a similar workaround, for the corporate bullshit, to
work in MSYS.
So really you need a translation of the users id to the user name. I
haven't looked but for this I might would take a look at the CVSROOT
modules to do the translation. IIRC you can include translation of a
user id to another alias.

Earnie Boyd

http://shop.siebunlimited.com

Loading...