diff options
author | Gerald Carter <jerry@samba.org> | 2005-02-04 00:25:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:55:33 -0500 |
commit | 44be949f28774cae4e79704c1c8f5d624f2bd46c (patch) | |
tree | 63b8c3ebd08132ecdf555d4e8687726a923afecb /source3/client/smbumount.c | |
parent | 8f87dcdcdab52efb0ef907ede71c0920a25b0d7b (diff) | |
download | samba-44be949f28774cae4e79704c1c8f5d624f2bd46c.tar.gz samba-44be949f28774cae4e79704c1c8f5d624f2bd46c.tar.xz samba-44be949f28774cae4e79704c1c8f5d624f2bd46c.zip |
r5207: patches from Jay Fenlason @ RedHat (scooped from their Fedora packages)
(This used to be commit 9019a8436162d3606f6b8584701b0832cf5a7439)
Diffstat (limited to 'source3/client/smbumount.c')
-rw-r--r-- | source3/client/smbumount.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/client/smbumount.c b/source3/client/smbumount.c index 9ea3083a6f9..29a7b5dafc1 100644 --- a/source3/client/smbumount.c +++ b/source3/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) |