diff options
author | Shyam Prasad N <sprasad@microsoft.com> | 2020-09-16 00:18:44 -0700 |
---|---|---|
committer | Pavel Shilovsky <pshilov@microsoft.com> | 2020-12-16 15:51:27 -0800 |
commit | 1a1507654c5f4367c27a11dfdbcfea42110c670c (patch) | |
tree | cd30cd33ad9b99d6cd870816fa4a8d0862c1b4b0 /cifskey.c | |
parent | 7156c6eca0fcf3d4a2fd2f8677b2622475c5c46e (diff) | |
download | cifs-utils-1a1507654c5f4367c27a11dfdbcfea42110c670c.tar.gz cifs-utils-1a1507654c5f4367c27a11dfdbcfea42110c670c.tar.bz2 cifs-utils-1a1507654c5f4367c27a11dfdbcfea42110c670c.zip |
mount.cifs: use SUDO_UID env variable for cruid
In the current mount.cifs logic, when sudo is used for mount,
uid=0, so the mount command searches for cruid=0 unless explicitly
specified by the user. The user may already have cred cache populated
but mount.cifs would end up searching cred cache for uid=0.
mount.cifs can avoid this confusion by reading the cruid from SUDO_UID
environment variable. If it is set to non-zero, we can make cruid=$SUDO_UID.
However, to maintain backward compatibility, keeping this as a fallback option.
If mount fails with ENOKEY, then retry with this option.
To enable this fallback, I had to make a few minor changes in the flow.
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Diffstat (limited to 'cifskey.c')
0 files changed, 0 insertions, 0 deletions