[linux-cifs-client] [PATCH] cifs: send real uid of initiating process to upcall instead of mount uid

Steve French smfrench at gmail.com
Mon Aug 3 12:41:03 MDT 2009


Wouldn't it give more flexibility to the upcall program if we sent both or
changed the name (and be less confusing) e.g. to "mount_uid" or something
else distinct

On Mon, Aug 3, 2009 at 1:34 PM, Jeff Layton <jlayton at redhat.com> wrote:

> The ownership of files on the mount has no direct relationship to the
> credentials used to do the mount. Instead of sending the uid
> corresponding to the owner of files on the mount, instead send the real
> uid of the process that initiated the upcall.
>
> Usually this will be the real uid of the process running /bin/mount.
> Eventually however, we want to be able to establish new sessions for
> users that walk into a cifs mount. For that we need the real uid of
> those users.
>
> Signed-off-by: Jeff Layton <jlayton at redhat.com>
> ---
>  fs/cifs/cifs_spnego.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c
> index 8ec7736..1d0d8fc 100644
> --- a/fs/cifs/cifs_spnego.c
> +++ b/fs/cifs/cifs_spnego.c
> @@ -140,7 +140,7 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
>                goto out;
>
>        dp = description + strlen(description);
> -       sprintf(dp, ";uid=0x%x", sesInfo->linux_uid);
> +       sprintf(dp, ";uid=0x%x", current_uid());
>
>        dp = description + strlen(description);
>        sprintf(dp, ";user=%s", sesInfo->userName);
> --
> 1.6.0.6
>
>


-- 
Thanks,

Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/linux-cifs-client/attachments/20090803/62f4d64d/attachment.html>


More information about the linux-cifs-client mailing list