RFC: 1.7.33 problem with user's home directory

Andrey Repin anrdaemon@yandex.ru
Fri Nov 28 17:04:00 GMT 2014


Greetings, Corinna Vinschen!

>> >> The meaning of the schemata depend on the setting:
>> >> 
>> >>   db_home:
>> >> 
>> >>     windows         AD and SAM: Utilizes the setting of the homeDrive or
>> >>                   homeDirectory attributes, or their SAM "Home folder"
>> >>                   counterparts.  The Windows path is converted to a
>> >>                   POSIX path.
>> 
>> > I'm not really happy with this.  It requires to write some value to the
>> > homeDrive/homeDirectory attributes, because it doesn't fall back to the
>> > Windows default values.
>> 
>> > So, another question is this:  Shall "db_home: windows" fall back
>> > to the default Windows home dir if homeDrive/homeDirectory are empty?
>> 
>> Yes, if you mean it.
>> I mean, if you intend to use the same directory OS using for user's home
>> directory, you gotta use something that resembles the OS behavior.

> Good point.  It's just a bit lengthy to implement.

I can imagine.

>> >>   db_shell:
>> >> 
>> >>     windows         Ignored.  Do you want CMD instead?
>> 
>> > Would be interesting for symmetry only, I guess...
>> 
>> With bogus quoting rules of CMD? It would just not work straight, I'm
>> afraid. May be better with PS, but I'm not familiar with it, and I don't know
>> anyone, who's familiar or even considering it's use as a shell interpreter.

> Lots of people do.  You won't believe in how many scenarios the
> users use Cygwin tools from CMD.

I trust you. For I'm one of those people, is not for any other reason.
However, I know exactly what I'm doing, and what to expect from it all.

> If we implement the above, we
> would just have to add a cmd wrapper script in /bin to make sure
> $PATH is set correctly and to make sure CMD starts up in $HOME,
> something along the lines of:

>   $ cat /bin/cmd
>   #!/bin/dash
>   PATH=/bin:$PATH
>   cd $HOME
>   # Don't rely on COMSPEC!
>   cmd=$(cygpath -ua "${SYSTEMROOT}\\System32\\CMD.EXE")
>   exec "${cmd}"

I hope you don't expect it to work inside mintty. Cygwin tools may function
properly in this case, but the shell itself - I have my doubts. And other
native tools would certainly have issues with encoding, if not with any output
at all.
Said that, it would need to be a simple .cmd file, so that it'd run in native
console.
Something like

@ECHO OFF
PATH=%~dp0;%PATH%
START "" /B "%SystemRoot%\System32\cmd.exe" /K
EXIT


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 28.11.2014, <18:17>

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



More information about the Cygwin mailing list