Bug 696951

Summary: mount option uid doesn't work with krb5
Product: Red Hat Enterprise Linux 6 Reporter: Jian Li <jiali>
Component: cifs-utilsAssignee: Jeff Layton <jlayton>
Status: CLOSED ERRATA QA Contact: yanfu,wang <yanwang>
Severity: unspecified Docs Contact:
Priority: high    
Version: 6.1CC: kzhang, nmurray, steved, syeghiay, yanwang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: cifs-utils-4.8.1-2.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:07:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
patch -- fix test for strtoul failure in mount.cifs none

Description Jian Li 2011-04-15 11:39:55 UTC
Description of problem:
When work with krb5, mount with option uid fails, although mount.cifs make it with option uid.

Version-Release number of selected component (if applicable):
cifs-utils-4.8.1-1.el6.x86_64

How reproducible:
Refer to 
1. testcase /CoreOS/samba-client/Sanity/mount-with-kerberos
2. BZ 618609

Comment 2 Jeff Layton 2011-04-15 11:52:11 UTC
Created attachment 492356 [details]
patch -- fix test for strtoul failure in mount.cifs

Good catch, Jian. Thanks for the bug report.

This patch fixes it for me in cursory testing.

Comment 4 Jeff Layton 2011-04-18 14:53:33 UTC
Patch committed in cifs-utils-4.8.1-2.el6

Comment 6 yanfu,wang 2011-04-20 08:31:10 UTC
reproduced on rhel6.1 kernel 2.6.32-131.0.1.el6.x86_64 + cifs-utils-4.8.1-1.el6.x86_64:
[root@intel-s3e3144-01 krb5]# id testuser
uid=501(testuser) gid=501(testuser) groups=501(testuser)
[root@intel-s3e3144-01 krb5]# klist -k
Keytab name: WRFILE:/etc/krb5.keytab
KVNO Principal
---- --------------------------------------------------------------------------
   2 root.NAY.REDHAT.COM
   2 root.NAY.REDHAT.COM
   2 root.NAY.REDHAT.COM
   2 root.NAY.REDHAT.COM
   2 host/intel-s3e3144-01.rhts.eng.nay.redhat.com.NAY.REDHAT.COM
   2 host/intel-s3e3144-01.rhts.eng.nay.redhat.com.NAY.REDHAT.COM
   2 host/intel-s3e3144-01.rhts.eng.nay.redhat.com.NAY.REDHAT.COM
   2 host/intel-s3e3144-01.rhts.eng.nay.redhat.com.NAY.REDHAT.COM
   2 testuser.NAY.REDHAT.COM
   2 testuser.NAY.REDHAT.COM
   2 testuser.NAY.REDHAT.COM
   2 testuser.NAY.REDHAT.COM
[root@intel-s3e3144-01 krb5]# mount -t cifs -o sec=krb5,uid=501 //intel-s3e3144-01.rhts.eng.nay.redhat.com/export /mnt/cifs
bad user name "501"

verified when update to cifs-utils-4.8.1-2.el6 and mount with uid successfully on i386 and x86_64:
[root@intel-s3e3144-01 krb5]# mount -t cifs -o sec=krb5,uid=501 //intel-s3e3144-01.rhts.eng.nay.redhat.com/export /mnt/cifs -vvv
mount: fstab path: "/etc/fstab"
mount: mtab path:  "/etc/mtab"
mount: lock path:  "/etc/mtab~"
mount: temp path:  "/etc/mtab.tmp"
mount: UID:        0
mount: eUID:       0
mount: spec:  "//intel-s3e3144-01.rhts.eng.nay.redhat.com/export"
mount: node:  "/mnt/cifs"
mount: types: "cifs"
mount: opts:  "sec=krb5,uid=501"
mount: external mount: argv[0] = "/sbin/mount.cifs"
mount: external mount: argv[1] = "//intel-s3e3144-01.rhts.eng.nay.redhat.com/export"
mount: external mount: argv[2] = "/mnt/cifs"
mount: external mount: argv[3] = "-v"
mount: external mount: argv[4] = "-o"
mount: external mount: argv[5] = "rw,sec=krb5,uid=501"
mount.cifs kernel mount options: ip=10.66.86.30,unc=\\intel-s3e3144-01.rhts.eng.nay.redhat.com\export,sec=krb5,uid=501,ver=1,user=root,pass=********
[root@intel-s3e3144-01 krb5]# cat /proc/mounts 
...
//intel-s3e3144-01.rhts.eng.nay.redhat.com/export/ /mnt/cifs cifs rw,relatime,unc=\\intel-s3e3144-01.rhts.eng.nay.redhat.com\export,username=root,uid=501,forceuid,gid=0,noforcegid,addr=10.66.86.30,posixpaths,serverino,acl,rsize=16384,wsize=57344 0 0

Comment 7 errata-xmlrpc 2011-05-19 13:07:08 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0569.html