cifs.upcall: require a uid= or creduid= parm
authorJeff Layton <jlayton@samba.org>
Mon, 26 Jul 2010 17:00:44 +0000 (13:00 -0400)
committerJeff Layton <jlayton@samba.org>
Mon, 26 Jul 2010 17:00:44 +0000 (13:00 -0400)
Even though all known kernels send the uid= parm to userspace,
cifs.upcall doesn't technically require it. It should though. If one
wasn't sent for some reason, then the setuid wouldn't occur. Error out
if there is no uid= or creduid= parm.

Signed-off-by: Jeff Layton <jlayton@samba.org>
cifs.upcall.c

index 1f4341d1217bccff94890c87e6386ef8986ce48c..8f7850ae512d2b51701bcae3e76d0e9ac9b1d429 100644 (file)
@@ -707,6 +707,11 @@ int main(const int argc, char *const argv[])
                        goto out;
                }
                ccname = find_krb5_cc(CIFS_DEFAULT_KRB5_DIR, arg.uid);
+       } else {
+               /* no uid= or creduid= parm -- something is wrong */
+               syslog(LOG_ERR, "No uid= or creduid= parm specified");
+               rc = 1;
+               goto out;
        }
 
        host = arg.hostname;