Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

$HOME and short pathname

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> SFU / Interix - Getting Started >> $HOME and short pathname Page: [1]
Login
Message << Older Topic   Newer Topic >>
$HOME and short pathname - Oct. 26, '05, 6:19:12 PM   
bpr1996

 

Posts: 4
Joined: Oct. 25, '05,
Status: offline
I'm just getting started with this and, when installing Bash, got all the warnings about the $HOME path having spaces, etc. Is there a place in the start up config files I can just replace the "Documents and Settings" malarkey with the short name DOCUME~1? Wouldn't that solve the problem?

Thanks for any help.
Brian
Post #: 1
RE: $HOME and short pathname - Oct. 26, '05, 10:46:22 PM   
markfunk

 

Posts: 673
Joined: Mar. 31, '03,
Status: offline
You can set the HOME environment variable in the registry.
ControlPanel->System->Advanced->EnvironmentVariables->User variables
but setting this the "short-name" doesn't help.
Something, somewhere (probably POSIX.EXE) changes it back to the long form
before the shell starts up.

(in reply to bpr1996)
Post #: 2
RE: $HOME and short pathname - Oct. 27, '05, 11:28:30 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
The correct way is to get your home directory properly set in the user database.
Right now there is no setting in the user database for you so the Interix API's return the
standard Unix default of "/". So the HOME environment variable gets left to it's Win32
setting which is the '"Documents and Settings" malarkey'.

There is a FAQ (entry 3.09) for setting the home directory.

I have the installer giving this warning message because many applications don't deal with spaces in the a path
(particularly scripts).

(in reply to markfunk)
Post #: 3
RE: $HOME and short pathname - Oct. 27, '05, 9:32:17 PM   
bpr1996

 

Posts: 4
Joined: Oct. 25, '05,
Status: offline
Thanks, guys. I'm running locally, outside of a domain, so this is what I did: set the Home folder for my user account to connect to an UNC path to \\MachineName\C$\DOCUME~1\Username via a new drive letter (using the Local Path option in the account Profiles wouldn't allow an UNC, just a physical path...) and, inside Interix, the HOME var is now /dev/fs/Z (no spaces!).

Installs of Tools Warehouse now go smoothly, with no warnings. Thanks again.

Brian

(in reply to Rodney)
Post #: 4
RE: $HOME and short pathname - Nov. 8, '05, 1:01:22 PM   
ShadowBottle

 

Posts: 5
Joined: Apr. 21, '04,
Status: offline
quote:

ORIGINAL: Rodney

The correct way is to get your home directory properly set in the user database.
Right now there is no setting in the user database for you so the Interix API's return the
standard Unix default of "/". So the HOME environment variable gets left to it's Win32
setting which is the '"Documents and Settings" malarkey'.

There is a FAQ (entry 3.09) for setting the home directory.

I have the installer giving this warning message because many applications don't deal with spaces in the a path
(particularly scripts).

Can you help me out here.. I'm using XP Pro.. and can't seem to get to the Active Directory to assign the home I can get to the normal Administrative Tools>>Computer Management>>System Tools>>Local Users and Groups Users and then go to the user and I see what bpr1996 is talking about about but no matter what I type in local path be it \\localmachinename\C$\Documen~1\username\ or "C:\Documents and Settings\Username\" it keeps saying that it's invalid.
I didn't have this problem in previous installs of SFU 3.5 and all I want is sshd really. I don't remember ever seeing those errors about the spaces before but the last time I installed was right after the release of 3.5.
Can anyone help me with this?
Thanks,
ShadowBottle

Edit: The active directory thing.. I dont know if thats a server class product only or what.. I dont seem to remember it being so.. but help links to it and when I try to open it through the link in windows help it says that it cant find the application... so... yeah.

< Message edited by ShadowBottle -- Nov. 8, '05, 1:02:32 PM >

(in reply to Rodney)
Post #: 5
RE: $HOME and short pathname - Nov. 8, '05, 1:30:23 PM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
As an aside: Active Directory (AD) is a server product. It's for managing the
users/groups in a domain. For a standalone machine you can use the Computer
Management GUI.

The tool your setting this with is a Win32 thing. So it "should" accept Win32 path syntax.
It must be refusing for some other reason which may be something completely different from the error message.
Check that the account you are using to set the home directory is in the Administrators group.

(in reply to ShadowBottle)
Post #: 6
RE: $HOME and short pathname - Nov. 8, '05, 2:12:03 PM   
ShadowBottle

 

Posts: 5
Joined: Apr. 21, '04,
Status: offline
quote:

ORIGINAL: Rodney

As an aside: Active Directory (AD) is a server product. It's for managing the
users/groups in a domain. For a standalone machine you can use the Computer
Management GUI.

The tool your setting this with is a Win32 thing. So it "should" accept Win32 path syntax.
It must be refusing for some other reason which may be something completely different from the error message.
Check that the account you are using to set the home directory is in the Administrators group.

it is indeed (edit: It's definately an administrative account, one from which I've installed SFU and used the tools warehouse stuffs to setup an ssh server in the past). UNC is the preferred way of doing this though right? if the username is frank could you give me an example of how I would write a path to docs and settings/frank?
it -should- be:
\\machinename\C$\"Documents and Settings"\frank\ or "C:\Documents and Settings\frank\" right?
I've dealt with SFU since 3.0 and I don't remember having all these issues. ARgh!
Thank you all for your help!
ShadowBottle

< Message edited by ShadowBottle -- Nov. 8, '05, 2:16:27 PM >

(in reply to Rodney)
Post #: 7
RE: $HOME and short pathname - Nov. 11, '05, 1:10:52 PM   
vbaranov

 

Posts: 15
Joined: Oct. 26, '05,
Status: offline
Another solution is to create a soft link.

1. Create a home directory for all users:
mkdir /home

2. Create a soft link:
ln -s "/dev/fs/C/Documents and Settings/<username>" /home/<username>

3. Create a ".profile" file under
C:/Documents and Settings/<username>
with the following content:
export HOME=/home/<username>
Substitute <username> with a real user ID.

Another way - in case you have to manage a number of users - is to add 4 new lines at the bottom of
/etc/profile
as follows (ensure "/home" directory already exists!):
if [ ! -d /home/~${USERNAME} ]; then
ln -s "/dev/fs/C/Documents and Settings/~${USERNAME}" /home/~${USERNAME}
fi
export HOME=/home/${USERNAME}

That's it.
Regards.

(in reply to ShadowBottle)
Post #: 8
RE: $HOME and short pathname - Dec. 1, '05, 2:52:24 AM   
breiter

 

Posts: 346
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
Another other options is to change the location that Windows uses for profiles from the "C:\Documents and Settings\ malarky" to something without spaces. It used to default to C:\WINNT\Profiles before Windows 2000, which while having no spaces, is kind of bad for managing permissions. That was just about the equivalent of placing your home directories in /bin/home on UNIX.

The best way to do this is by using an unattend.txt settings file with the winnt.exe setup program when you installed Windows in the first place. Sysprep.exe, I think, allows you to do this, too.

The key parameter to have in your unattend.txt is this:
[GuiUNattended]
ProfilesDir = C:\Profiles

It doesn't have to be the C:\ volume, either. (On a terminal server, or other system that might load a lot of profiles, you would really want to consider having the profiles directory on another volume than the system partition so that they cannot fill up the volume and halt the server.) In any case, you'll end up with something like this:
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

cmd> dir C:\
 Volume in drive C has no label.
 Volume Serial Number is F8E5-DA38

 Directory of C:\

05/30/2005  12:35 PM                98 AUTOEXEC.BAT
04/26/2005  06:24 PM                 0 CONFIG.SYS
05/03/2005  05:13 PM                 0 console.txt
09/09/2005  12:17 PM    <DIR>          Inetpub
10/28/2005  09:50 PM    <DIR>          mssql-db
05/09/2005  02:55 PM    <DIR>          oracle
05/03/2005  09:53 AM    <DIR>          Profiles
11/23/2005  08:09 AM    <DIR>          Program Files
05/03/2005  07:00 AM    <JUNCTION>     Programs
11/23/2005  08:01 AM    <DIR>          SFU
11/23/2005  11:33 AM    <DIR>          Symbols
11/23/2005  06:55 AM    <DIR>          temp
11/30/2005  08:29 PM    <DIR>          WINDOWS
04/26/2005  06:24 PM    <DIR>          wmpub
               3 File(s)             98 bytes
              11 Dir(s)  25,796,886,528 bytes free


Now there is a C:\Profiles instead of "C:\Documents and Settings". That comes out to "/dev/fs/C/Profiles" in the Interix view of the file system.

If you're not afraid of a little Registry diving, you can also move the user profile directory to another location after Windows is installed. The gist is that you must change the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\ProfilesDirectory key to the new directory. And then you have to *fix* all of the existing profiles in the registry and move the files around. Of course you cannot move the profile you are logged in with, so you need at least two Administrator-level accounts to pull this off. It is definitely doable, if you are careful.

http://support.microsoft.com/kb/314843/

< Message edited by breiter -- Dec. 1, '05, 3:28:23 AM >

(in reply to vbaranov)
Post #: 9
RE: $HOME and short pathname - Dec. 4, '05, 5:01:17 AM   
jon493

 

Posts: 56
Joined: Oct. 14, '05,
Status: offline
You could do this the Windows way,as many have suggested, or you could do it the UNIX way.

First, don't modify the /etc/profile. There is a notice to that effect in the file's header. Read it. Modify /etc/profile.lcl instead.

vbaranov's solution is good, and you could try this on similar lines:

1. Create a global readable /home directory with symlinks pointing off to individual users' home directories. Eg: /home/jane_j --> /dev/fs/C/Documents and Settings/Jane J. User

2. Assign the proper privileges (with chmod) for the various users' symlinks.

3. For each user, create a user-specific environment variable INTERIX35_HOME (or similar) which contains the home path for that user in UNIX format. Eg: /home/jane_j

4. Add these two lines towards the end of /etc/profile.lcl
export HOME=$INTERIX35_HOME
cd

This will always change the current directory to the user's real home directory on login.

5. WARNING: Using UNIX style home directories pointing to your Windows home directory can have unpleasant side-effects.

  • If you directly use a Interix format HOME environment variable, any Win32 programs using it will fail (notably XEmacs for Windows, GTK+ toolkit, etc.). So you should use the INTERIX35_HOME method
  • The Interix file permissions are substantially different from Windows file permissions. Although Interix maps the UNIX style permissions to Win32 ACL's quite well, they are not completely compatible; so you should be careful if you want to mix'n'match them.
  • File system inconsistency can be apparent due to case insensivity of Windows Explorer. Unless you have an Interix-based File Manager, files whose names differ only in case will cause problems with Explorer. Also, other Win32 programs may also get confused. If you think no-one ever uses such files -- believe me -- they do! Some experience in porting UNIX based scientific applications will quickly expose the extent to which some packages rely on same-name-but-different-case filenames. And we all love symlinks don't we? That's one of the reasons we love Interix. They don't work with Explorer or any other Win32 program.
  • Interix, and in general UNIX command environments can be extremely dangerous to your files. Commands like rm and mv (the command for moving files, unfortunately also the command for renaming files) can clear out whole directories in a jiffy. If you are used to the safer MSDOS command environment, you are better off not using your real home directory for Interix. You could well use a pseudo-home directory for Interix. After all, you can always copy/symlink any vital files there. This will also prevent your configuration files from being messed up (eg: GTK+ .gtkrc files if you use GIMP on Windows and chemtool on Interix for one example).


< Message edited by jon493 -- Dec. 4, '05, 5:08:29 AM >

(in reply to breiter)
Post #: 10
RE: $HOME and short pathname - Jun. 29, '06, 4:51:23 PM   
sdettrick

 

Posts: 1
Joined: Jun. 29, '06,
Status: offline
Hi,

thanks for the instructions. But can you be more explicit, in particular steps 2 and 3?

2. what are the "proper priveleges"? chmod +wx ?

3. how do you create an environment variable, e.g. INTERIX35_HOME, in Windows? Is it somewhere in "Computer Management"? If so, where/how? (By the way I read the FAQ 3.09, but I need more info as I'm a unix user, not a Windows user.)

Any help appreciated.

Thanks,
Sean

< Message edited by sdettrick -- Jun. 29, '06, 5:27:15 PM >

(in reply to jon493)
Post #: 11
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> SFU / Interix - Getting Started >> $HOME and short pathname Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.078