diff options
Diffstat (limited to 'cifs.upcall.c')
-rw-r--r-- | cifs.upcall.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cifs.upcall.c b/cifs.upcall.c index 0c89d7c..e0d3724 100644 --- a/cifs.upcall.c +++ b/cifs.upcall.c @@ -1038,11 +1038,19 @@ int main(const int argc, char *const argv[]) } /* + * We can't reasonably do this for root. When mounting a DFS share, + * for instance we can end up with creds being overridden, but the env + * variable left intact. + */ + if (uid == 0) + env_probe = false; + + /* * Must do this before setuid, as we need elevated capabilities to * look at the environ file. */ env_cachename = - get_cachename_from_process_env(env_probe ? arg.pid : 0); + get_cachename_from_process_env(env_probe ? arg.pid : 0); rc = setuid(uid); if (rc == -1) { |