cifs.upcall: don't do env scraping when uid is 0
authorJeff Layton <jlayton@samba.org>
Thu, 23 Feb 2017 21:50:43 +0000 (16:50 -0500)
committerJeff Layton <jlayton@samba.org>
Fri, 24 Feb 2017 14:18:12 +0000 (09:18 -0500)
commit9eaa21ed37126d1bfcb998b4c8f6115ac77e9b5f
treecb465828f9b7812e4471b698e1ccf4f7083aa1a1
parent2dcecd21262513a0866c321643fc33d3d0135915
cifs.upcall: don't do env scraping when uid is 0

Setuid programs triggering upcalls could trick the program here. Also,
the d_automount method is done with credentials overridden so if you
can end up with mismatched creds and env vars due to that as well.

It's a hack, but the only recourse I can see is to avoid doing this
when the uid is 0. That means we can't rely on finding root credcaches
in alternate locations using $KRB5CCNAME, but I think that's the best
we can do.

Reported-and-Tested-by: Chad William Seys <cwseys@physics.wisc.edu>
Signed-off-by: Jeff Layton <jlayton@samba.org>
cifs.upcall.8.in
cifs.upcall.c