Re: ReFS support in Cygwin?

2023-08-18 Thread Brian Inglis via Cygwin

On 2023-08-18 07:11, Martin Wege via Cygwin wrote:

is ReFS supported in Cygwin? If so, what does Cygwin /bin/mount print
- "ntfs" or "refs"?


$ more /proc/filesystems
vfat
exfat
ntfs
refs
nodev   smbfs
nodev   nfs
nodev   netapp
iso9660
udf
nodev   csc-cache
nodev   unixfs
nodev   mvfs
nodev   cifs
nodev   nwfs
nodev   ncfsd
nodev   afs
nodev   prlfs

--
Take care. Thanks, Brian Inglis  Calgary, Alberta, Canada

La perfection est atteinte   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry

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


para cygwin@cygwin.com

2023-08-18 Thread Jasmim via Cygwin



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


Re: MYSQL cygwin database connection requests root password

2023-08-18 Thread bzs--- via Cygwin


On August 18, 2023 at 22:14 cygwin@cygwin.com (HECTOR MENDEZ via Cygwin) wrote:
 >  
 > Hi there,
 >  I tried with an empty password and "root" word a password but no luck, so 
 > far.
 > Thank youEl miércoles, 16 de agosto de 2023, 22:56:12 GMT-6, 
 > rapp...@dds.nl  escribió:  

MySQL's 'root' account and the system root account have little
relationship other than they share the same four characters in the
same order.

There are instructions in the online MySQL manual on how to recover
the MySQL root password, no doubt others have summarized, try your
favorite search engine.

But it basically amounts to:

1. Stop the MySQL server

2. Start it with a command line flag which says don't use passwords

3. Login as root via the MySQL client, it won't ask for a password

4. Set a password for that root account using the usual MySQL SET
PASSWORD command

5. Logout of the client

6. Stop the MySQL server

7. Start the MySQL the normal way, without the flag to not use
passwords

8. You are done

Here's a link to the MySQL 8.0 instructions;

  https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html

-- 
-Barry Shein

Software Tool & Die| b...@theworld.com | http://www.TheWorld.com
Purveyors to the Trade | Voice: +1 617-STD-WRLD   | 800-THE-WRLD
The World: Since 1989  | A Public Information Utility | *oo*

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


Re: MYSQL cygwin database connection requests root password

2023-08-18 Thread HECTOR MENDEZ via Cygwin
 
Hi there,
 I tried with an empty password and "root" word a password but no luck, so far.
Thank youEl miércoles, 16 de agosto de 2023, 22:56:12 GMT-6, rapp...@dds.nl 
 escribió:  
 
 > Hi everyone I saw that in order to connect MYSQL database on cygwin, this 
 > statement must be executed:
> mysql -u root -p -h 127.0.0.1
> However, as far as I know, there's no root user on cygwin.
> How can I get that requested password?

Isn't "root" a MySQL username? If I recall correctly its default
password is either empty or "root".
  

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


Re: Test for Windows Administrator permissions from Cygwin terminal|script?

2023-08-18 Thread Doug Henderson via Cygwin
On Thu, Aug 17, 2023 at 8:02 PM Martin Wege via Cygwin
 wrote:
> How can I find out whether the current Cygwin terminal has
> Administrator rights? I want to safeguard our admin scripts with a
> simple test and bail out with an error if someone wants to do admin
> stuff (say: regtool) without admin privileges.

I use this bash function:

# isadmin - is shell a regular user or admin user
function isadmin()
{
$(cygpath -u 'C:\Windows\System32\net.exe') session > /dev/null 2>&1
if [ $? -eq 0 ]; then echo "admin"
else echo "user"; fi
}

I imagine any other Windows app that needs admin permissions would work.

I use this to change the color of the prompt ($PS1) for the admin user to red.

HTH
Doug

-- 
Doug Henderson, Calgary, Alberta, Canada - from gmail.com

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


Re: mkfifo: cannot set permissions of 'x.fifo': Not a directory

2023-08-18 Thread Martin Wege via Cygwin
On Fri, Aug 18, 2023 at 10:34 AM Corinna Vinschen
 wrote:
>
> On Aug 18 06:02, Martin Wege via Cygwin wrote:
> > On Mon, Aug 7, 2023 at 4:42 PM Martin Wege  wrote:
> > >
> > > Hello,
> > >
> > > We get a weird mkfifo failure in Cygwin on NTFS:
> > >
> > > /usr/bin/mkfifo -m 600 x.fifo
> > > mkfifo: cannot set permissions of 'x.fifo': Not a directory
> > >
> > > Is there a known workaround? So far named fifos cannot be created somehow.
> >
> > This is fixed for NTFS, but still broken for Windows builtin NFS v3 client:
>
> It was actually never supposed to work on NFS.  Cygwin FIFOs are
> created as symlinks of the type Windows shortcut with the R/O attribute
> set.  Those are only generated on NTFS and FAT filesystems.  NFS symlinks
> are generated using special magic.  NFS doesn't support DOS attributes.

So what would be a way to fix this for users with NFS mounted
projects, data or home dirs?

Thanks,
Martin

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


ReFS support in Cygwin?

2023-08-18 Thread Martin Wege via Cygwin
Hello,

is ReFS supported in Cygwin? If so, what does Cygwin /bin/mount print
- "ntfs" or "refs"?

Thanks,
Martin

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


Cygwin pathconf() query filesystem kernel data? Re: How does Cygwin detect MSFT NFSv3 file system? Re: Weird (path) problems with cygwin test release 3.5.0-0.384.g9939aa7d0945.x86_64 ...

2023-08-18 Thread Martin Wege via Cygwin
On Fri, Aug 18, 2023 at 10:44 AM Corinna Vinschen via Cygwin
 wrote:
>
> On Aug 17 20:49, Martin Wege via Cygwin wrote:
> > On Mon, Aug 14, 2023 at 10:56 PM Corinna Vinschen via Cygwin
> >  wrote:
> > > and the result is the same.  Note that Cygwin supports MSFT NFSv3 but
> > > not CITI NFSv4.1 internally.  No gurantee that Cygwin always does what
> > > is necessary for that other NFS.
> >
> > 1. How does Cygwin detect whether something is a MSFT NFSv3, or not?
> > Cygwin /bin/mount lists the CITI NFSv4.1 as 'nfs', so there *IS*
> > something which detects that?
>
> The filesystem name returned by NtQueryVolumeInformationFile is "NFS".
> If any other NFS returns the same filesystem name, it will be treated
> just like MSFT NFSv3.
>
> > 2. Are Cygwin soft link handing depend on MSFT NFSv3 or not, i.e. does
> > the Cygwin soft link code behave differently for MSFT NFSv3 file
> > systems?
>
> Yes.  NFS doesn't support symlink creation and symlink reading via
> the usual functions, because Windows symlinks are created as reparse
> points.  NFS doesn't support reparse points.  So the developers of
> the MSFT NFS client had to invent their own way to create and
> read NFS symlinks:
>
> https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/path.cc;hb=HEAD#l1719
>
> https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/path.cc;hb=HEAD#l2750
>
> > 3. Does Cygwin implement the pathconf() api?
>
> Yes.  Surprisingly, you can check this yourself by just calling the
> function and trying to compile your code.

Apologies, how do we say in German? "Ich sollte meine Frage konkretisieren:"

Does the Cygwin implementation of pathconf() support query data of the
underlying filesystem based on data from the kernel, as UNIX does? So
pathconf() returns different values for NTFS, ReFS, or Windows builtin
NFSv3?

I am asking, because as far as I know the Linux implementation is not
a syscall, and instead glibc guesses values based on builtin static
data, and whatever fstatfs() has to offer. Compared to that UNIX
(Solaris, AIX, HPUX, ...) have pathconf() as a syscall, and actually
ask the filesystem itself.

Thanks,
Martin

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


Re: Cygwin console: Different default background color when terminal runs as Admin?

2023-08-18 Thread Christian Franke via Cygwin

Corinna Vinschen via Cygwin wrote:

On Aug 18 11:51, Martin Wege via Cygwin wrote:

On Fri, Aug 18, 2023 at 7:27 AM Jonathon Merz via Cygwin
 wrote:

On Thu, Aug 17, 2023 at 7:13 PM Martin Wege via Cygwin 
wrote:


Just an idea: Could the default background color of the Cygwin console
be changed from black to grey (or RED) if the terminal has been
started with Administrator rights?


Assuming that:
1. The Administrators group is called "Administrators"
2. There aren't any non-administrative groups with "Administrators" in the
name
3. You're using mintty for your terminal

You can run the following in bash or zsh with the desired RGB values:

if [[ `id -Gn` == *Administrators* ]]
then
 echo -ne "\e]11;#FFBBEE\a";
fi


Looking at the output of /usr/bin/id -a was my first guess too. But
this fails quickly because the names are localized. Seriously MS runs
the Windows group names through the l10n wringer!! So what works on
Windows for Germany will surely fail for Windows for Japan. Thus I am
looking for a more portable solution.

Maybe the numeric group ids are more 'portable' across the Windows
versions for different countries?

Admin group is always Windows SID 1-5-32-544 and gid 544 in Cygwin,
unless somebody overloads the gid values via an /etc/group file.

If you want to be really sure, you have to check every numeric gid
returned by `id -G' if it resolves to SID 1-5-32-544.  You can do
this with the getent(1) tool.


Fortunately getent allows multiple keys, so this works:

case "$(getent group $(id -G))" in
  *:S-1-5-32-544:*) echo admin ;;
esac

Unfortunately this may be is slow in domains due to unneeded AD 
requests. Unlike mkgroup, getent output cannot be restricted to local 
groups (and the '-s SERVICE' option is apparently a no-op).


--
Regards,
Christian


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


Re: Persistent and same Cygwin session for Windows login and ssh login?

2023-08-18 Thread Corinna Vinschen via Cygwin
On Aug 18 12:23, Thomas Wolff via Cygwin wrote:
> 
> 
> Am 18.08.2023 um 10:47 schrieb Corinna Vinschen via Cygwin:
> > On Aug 17 19:30, Cedric Blancher via Cygwin wrote:
> > > Good evening!
> > > 
> > > How can I get a Cygwin session for one Windows login, and get the same
> > > Cygwin session when I log into the same Windows machine via ssh?
> > You can't.  Windows isolates sessions from each other.
> Not quite sure what you mean by session. Maybe you want to multiplex a
> session among terminals (and thus initial logins) with 'tmux' or 'screen'.

I was talking about Windows terminal server sessions, as they show up in
the Windows user token.  I'm not aware that the Cygwin DLL is concerned
with tty session handling apart from keeping track of ptys in use, but
there's a good chance I'm missing something.


Corinna

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


Re: Cygwin console: Different default background color when terminal runs as Admin?

2023-08-18 Thread Corinna Vinschen via Cygwin
On Aug 18 11:51, Martin Wege via Cygwin wrote:
> On Fri, Aug 18, 2023 at 7:27 AM Jonathon Merz via Cygwin
>  wrote:
> >
> > On Thu, Aug 17, 2023 at 7:13 PM Martin Wege via Cygwin 
> > wrote:
> >
> > > Just an idea: Could the default background color of the Cygwin console
> > > be changed from black to grey (or RED) if the terminal has been
> > > started with Administrator rights?
> > >
> >
> > Assuming that:
> > 1. The Administrators group is called "Administrators"
> > 2. There aren't any non-administrative groups with "Administrators" in the
> > name
> > 3. You're using mintty for your terminal
> >
> > You can run the following in bash or zsh with the desired RGB values:
> >
> > if [[ `id -Gn` == *Administrators* ]]
> > then
> > echo -ne "\e]11;#FFBBEE\a";
> > fi
> >
> 
> Looking at the output of /usr/bin/id -a was my first guess too. But
> this fails quickly because the names are localized. Seriously MS runs
> the Windows group names through the l10n wringer!! So what works on
> Windows for Germany will surely fail for Windows for Japan. Thus I am
> looking for a more portable solution.
> 
> Maybe the numeric group ids are more 'portable' across the Windows
> versions for different countries?

Admin group is always Windows SID 1-5-32-544 and gid 544 in Cygwin,
unless somebody overloads the gid values via an /etc/group file.

If you want to be really sure, you have to check every numeric gid
returned by `id -G' if it resolves to SID 1-5-32-544.  You can do
this with the getent(1) tool.


Corinna

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


Re: Cygwin console: Different default background color when terminal runs as Admin?

2023-08-18 Thread Thomas Wolff via Cygwin



Am 18.08.2023 um 10:11 schrieb Christian Franke via Cygwin:

Jonathon Merz via Cygwin wrote:
On Thu, Aug 17, 2023 at 7:13 PM Martin Wege via Cygwin 


wrote:


Just an idea: Could the default background color of the Cygwin console
be changed from black to grey (or RED) if the terminal has been
started with Administrator rights?


Assuming that:
1. The Administrators group is called "Administrators"
2. There aren't any non-administrative groups with "Administrators" 
in the

name
3. You're using mintty for your terminal

You can run the following in bash or zsh with the desired RGB values:

if [[ `id -Gn` == *Administrators* ]]
then
 echo -ne "\e]11;#FFBBEE\a";
fi


A alternative that should work with any shell, does not rely on 
(unfortunately localized) group names and only assumes that the 
Administrators group S-1-5-32-544 isn't remapped by /etc/group:


case " $(/usr/bin/id -G) " in
  *\ 544\ *) printf '\e]11;#80\a' ;;
esac

or like this
case " `id -G` " in
*" 544 "*|*" 0 "*)    echo admin;;
esac
Note the embedding spaces in the case expression.
I'm adding the 0 for a profile portable with Linux.
You could also use
    if id -G | grep -qE '\<(544|0)\>'
at the cost of an additional process creation.
In earlier Windows versions, you could also check for group 547 which 
was some kind of half-admin user.


Thomas



Or use a check of actual access rights:

if [ -r /proc/registry/HKEY_LOCAL_MACHINE/SAM/SAM ]; then ...; fi


I use this in .bashrc to add "(root)" to the default mintty title and 
set '#' as root prompt:


case " $(/usr/bin/id -G) " in
  *\ 544\ *) PS1=${PS1/\\e]0;\\w/\\e]0;\\w (root)}; PS1=${PS1/\\\$ /\# 
} ;;

esac




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


Re: Persistent and same Cygwin session for Windows login and ssh login?

2023-08-18 Thread Thomas Wolff via Cygwin




Am 18.08.2023 um 10:47 schrieb Corinna Vinschen via Cygwin:

On Aug 17 19:30, Cedric Blancher via Cygwin wrote:

Good evening!

How can I get a Cygwin session for one Windows login, and get the same
Cygwin session when I log into the same Windows machine via ssh?

You can't.  Windows isolates sessions from each other.
Not quite sure what you mean by session. Maybe you want to multiplex a 
session among terminals (and thus initial logins) with 'tmux' or 'screen'.


Thomas


Also, where does Cygwin store session information?

Nowhere, really.  Sessions are a Windows thing.  We only keep a bit of
transient stuff in various shared memory regions.


Corinna




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


Re: Cygwin console: Different default background color when terminal runs as Admin?

2023-08-18 Thread Martin Wege via Cygwin
On Fri, Aug 18, 2023 at 7:27 AM Jonathon Merz via Cygwin
 wrote:
>
> On Thu, Aug 17, 2023 at 7:13 PM Martin Wege via Cygwin 
> wrote:
>
> > Just an idea: Could the default background color of the Cygwin console
> > be changed from black to grey (or RED) if the terminal has been
> > started with Administrator rights?
> >
>
> Assuming that:
> 1. The Administrators group is called "Administrators"
> 2. There aren't any non-administrative groups with "Administrators" in the
> name
> 3. You're using mintty for your terminal
>
> You can run the following in bash or zsh with the desired RGB values:
>
> if [[ `id -Gn` == *Administrators* ]]
> then
> echo -ne "\e]11;#FFBBEE\a";
> fi
>

Looking at the output of /usr/bin/id -a was my first guess too. But
this fails quickly because the names are localized. Seriously MS runs
the Windows group names through the l10n wringer!! So what works on
Windows for Germany will surely fail for Windows for Japan. Thus I am
looking for a more portable solution.

Maybe the numeric group ids are more 'portable' across the Windows
versions for different countries?

Thanks,
Martin

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


Re: Test for Windows Administrator permissions from Cygwin terminal|script?

2023-08-18 Thread Mark Geisert via Cygwin

Mark Geisert via Cygwin wrote:

Backwoods BC via Cygwin wrote:

[...]

I don't know if this is the official method, but it works for me:

# Shell Options
# Elevated privilege windows have $SESSIONNAME set
if [ "$SESSIONNAME" == "" ] ;then
   printf -v adminPmt '[\u2022Admin\u2022] '
else
   export adminPmt=""
fi


I see the opposite on my machine.  Admin window has empty $SESSIONNAME, non-Admin 
window has "Console".


Feh, I mentally reversed the 'if' clauses.  I see the same $SESSIONNAME behavior 
on my machine.  Sorry for the noise.


..mark

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


Re: Test for Windows Administrator permissions from Cygwin terminal|script?

2023-08-18 Thread Mark Geisert via Cygwin

Backwoods BC via Cygwin wrote:

On Thu, Aug 17, 2023 at 7:01 PM Martin Wege via Cygwin
 wrote:

How can I find out whether the current Cygwin terminal has
Administrator rights? I want to safeguard our admin scripts with a
simple test and bail out with an error if someone wants to do admin
stuff (say: regtool) without admin privileges.

Thanks,
Martin


I don't know if this is the official method, but it works for me:

# Shell Options
# Elevated privilege windows have $SESSIONNAME set
if [ "$SESSIONNAME" == "" ] ;then
   printf -v adminPmt '[\u2022Admin\u2022] '
else
   export adminPmt=""
fi


I see the opposite on my machine.  Admin window has empty $SESSIONNAME, non-Admin 
window has "Console".


What I do locally is check the output of the 'id' command.  If group 
544(Administrators) is present, that's a window with Admin rights.  Inside .bashrc 
I have a simple grep test on the output of 'id' to set PS1 (shell prompt) 
appropriately.


..mark

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


Re: Cygwin openssh AllowGroups

2023-08-18 Thread Corinna Vinschen via Cygwin
On Aug 17 21:11, Dale Lobb via Cygwin wrote:
>   Is there a known issue in Cygwin's implementation of openssh in the
>   AllowGroups clause of sshd_config?  I cannot get it to work.

It should work, just as AllowUsers.  Maybe you should run clinet and/or
server with debugging on, to see what it does.


Corinna

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


Re: Persistent and same Cygwin session for Windows login and ssh login?

2023-08-18 Thread Corinna Vinschen via Cygwin
On Aug 17 19:30, Cedric Blancher via Cygwin wrote:
> Good evening!
> 
> How can I get a Cygwin session for one Windows login, and get the same
> Cygwin session when I log into the same Windows machine via ssh?

You can't.  Windows isolates sessions from each other.

> Also, where does Cygwin store session information?

Nowhere, really.  Sessions are a Windows thing.  We only keep a bit of
transient stuff in various shared memory regions.


Corinna

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


Re: How does Cygwin detect MSFT NFSv3 file system? Re: Weird (path) problems with cygwin test release 3.5.0-0.384.g9939aa7d0945.x86_64 ...

2023-08-18 Thread Corinna Vinschen via Cygwin
On Aug 17 20:49, Martin Wege via Cygwin wrote:
> On Mon, Aug 14, 2023 at 10:56 PM Corinna Vinschen via Cygwin
>  wrote:
> > and the result is the same.  Note that Cygwin supports MSFT NFSv3 but
> > not CITI NFSv4.1 internally.  No gurantee that Cygwin always does what
> > is necessary for that other NFS.
> 
> 1. How does Cygwin detect whether something is a MSFT NFSv3, or not?
> Cygwin /bin/mount lists the CITI NFSv4.1 as 'nfs', so there *IS*
> something which detects that?

The filesystem name returned by NtQueryVolumeInformationFile is "NFS".
If any other NFS returns the same filesystem name, it will be treated
just like MSFT NFSv3.

> 2. Are Cygwin soft link handing depend on MSFT NFSv3 or not, i.e. does
> the Cygwin soft link code behave differently for MSFT NFSv3 file
> systems?

Yes.  NFS doesn't support symlink creation and symlink reading via
the usual functions, because Windows symlinks are created as reparse
points.  NFS doesn't support reparse points.  So the developers of
the MSFT NFS client had to invent their own way to create and
read NFS symlinks:

https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/path.cc;hb=HEAD#l1719

https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/path.cc;hb=HEAD#l2750

> 3. Does Cygwin implement the pathconf() api?

Yes.  Surprisingly, you can check this yourself by just calling the
function and trying to compile your code.


Corinna

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


Re: mkfifo: cannot set permissions of 'x.fifo': Not a directory

2023-08-18 Thread Corinna Vinschen via Cygwin
On Aug 18 06:02, Martin Wege via Cygwin wrote:
> On Mon, Aug 7, 2023 at 4:42 PM Martin Wege  wrote:
> >
> > Hello,
> >
> > We get a weird mkfifo failure in Cygwin on NTFS:
> >
> > /usr/bin/mkfifo -m 600 x.fifo
> > mkfifo: cannot set permissions of 'x.fifo': Not a directory
> >
> > Is there a known workaround? So far named fifos cannot be created somehow.
> 
> This is fixed for NTFS, but still broken for Windows builtin NFS v3 client:

It was actually never supposed to work on NFS.  Cygwin FIFOs are
created as symlinks of the type Windows shortcut with the R/O attribute
set.  Those are only generated on NTFS and FAT filesystems.  NFS symlinks
are generated using special magic.  NFS doesn't support DOS attributes.

Corinna

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


Re: Cygwin console: Different default background color when terminal runs as Admin?

2023-08-18 Thread Christian Franke via Cygwin

Jonathon Merz via Cygwin wrote:

On Thu, Aug 17, 2023 at 7:13 PM Martin Wege via Cygwin 
wrote:


Just an idea: Could the default background color of the Cygwin console
be changed from black to grey (or RED) if the terminal has been
started with Administrator rights?


Assuming that:
1. The Administrators group is called "Administrators"
2. There aren't any non-administrative groups with "Administrators" in the
name
3. You're using mintty for your terminal

You can run the following in bash or zsh with the desired RGB values:

if [[ `id -Gn` == *Administrators* ]]
then
 echo -ne "\e]11;#FFBBEE\a";
fi


A alternative that should work with any shell, does not rely on 
(unfortunately localized) group names and only assumes that the 
Administrators group S-1-5-32-544 isn't remapped by /etc/group:


case " $(/usr/bin/id -G) " in
  *\ 544\ *) printf '\e]11;#80\a' ;;
esac

Or use a check of actual access rights:

if [ -r /proc/registry/HKEY_LOCAL_MACHINE/SAM/SAM ]; then ...; fi


I use this in .bashrc to add "(root)" to the default mintty title and 
set '#' as root prompt:


case " $(/usr/bin/id -G) " in
  *\ 544\ *) PS1=${PS1/\\e]0;\\w/\\e]0;\\w (root)}; PS1=${PS1/\\\$ /\# } ;;
esac

--
Regards
Christian


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