diff options
author | Gerald Carter <jerry@samba.org> | 2005-02-04 00:25:33 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2005-02-04 00:25:33 +0000 |
commit | 79a9f9da10b5918fdcf67dae699d50741fe35563 (patch) | |
tree | cef7b991f0721132e9f2b88f9f6688a1e731a633 /source/client | |
parent | a46bff40fffc06d12819336cc250dd4b1d8a965b (diff) | |
download | samba-79a9f9da10b5918fdcf67dae699d50741fe35563.tar.gz samba-79a9f9da10b5918fdcf67dae699d50741fe35563.tar.xz samba-79a9f9da10b5918fdcf67dae699d50741fe35563.zip |
r5207: patches from Jay Fenlason @ RedHat (scooped from their Fedora packages)
Diffstat (limited to 'source/client')
-rw-r--r-- | source/client/smbmnt.c | 4 | ||||
-rw-r--r-- | source/client/smbumount.c | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/source/client/smbmnt.c b/source/client/smbmnt.c index 753a31c3139..06dd3e5c023 100644 --- a/source/client/smbmnt.c +++ b/source/client/smbmnt.c @@ -162,7 +162,7 @@ do_mount(char *share_name, unsigned int flags, struct smb_mount_data *data) slprintf(opts, sizeof(opts)-1, "version=7,uid=%d,gid=%d,file_mode=0%o,dir_mode=0%o,%s", - data->uid, data->gid, data->file_mode, data->dir_mode,options); + mount_uid, mount_gid, data->file_mode, data->dir_mode,options); if (mount(share_name, ".", "smbfs", flags, data1) == 0) return 0; return mount(share_name, ".", "smbfs", flags, data2); @@ -225,7 +225,7 @@ do_mount(char *share_name, unsigned int flags, struct smb_mount_data *data) return -1; } - data.uid = mount_uid; + data.uid = mount_uid; // truncates to 16-bits here!!! data.gid = mount_gid; data.file_mode = (S_IRWXU|S_IRWXG|S_IRWXO) & mount_fmask; data.dir_mode = (S_IRWXU|S_IRWXG|S_IRWXO) & mount_dmask; diff --git a/source/client/smbumount.c b/source/client/smbumount.c index 9ea3083a6f9..29a7b5dafc1 100644 --- a/source/client/smbumount.c +++ b/source/client/smbumount.c @@ -39,7 +39,7 @@ umount_ok(const char *mount_point) /* we set O_NOFOLLOW to prevent users playing games with symlinks to umount filesystems they don't own */ int fid = open(mount_point, O_RDONLY|O_NOFOLLOW, 0); - __kernel_uid_t mount_uid; + __kernel_uid32_t mount_uid; if (fid == -1) { fprintf(stderr, "Could not open %s: %s\n", @@ -47,10 +47,14 @@ umount_ok(const char *mount_point) return -1; } - if (ioctl(fid, SMB_IOC_GETMOUNTUID, &mount_uid) != 0) { - fprintf(stderr, "%s probably not smb-filesystem\n", - mount_point); - return -1; + if (ioctl(fid, SMB_IOC_GETMOUNTUID32, &mount_uid) != 0) { + __kernel_uid_t mount_uid16; + if (ioctl(fid, SMB_IOC_GETMOUNTUID, &mount_uid16) != 0) { + fprintf(stderr, "%s probably not smb-filesystem\n", + mount_point); + return -1; + } + mount_uid = mount_uid16; } if ((getuid() != 0) |