summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/client/smbmnt.c4
-rw-r--r--source3/client/smbumount.c14
-rw-r--r--source3/libads/ldap.c2
-rw-r--r--source3/nsswitch/pam_winbind.c4
-rw-r--r--source3/nsswitch/winbindd_ads.c3
5 files changed, 16 insertions, 11 deletions
diff --git a/source3/client/smbmnt.c b/source3/client/smbmnt.c
index 753a31c313..06dd3e5c02 100644
--- a/source3/client/smbmnt.c
+++ b/source3/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/source3/client/smbumount.c b/source3/client/smbumount.c
index 9ea3083a6f..29a7b5dafc 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)
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 494bd930e4..c9bba72524 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -2526,7 +2526,7 @@ ADS_STATUS ads_workgroup_name(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *
int i;
void *res;
const char *attrs[] = {"servicePrincipalName", NULL};
- int num_principals;
+ size_t num_principals;
(*workgroup) = NULL;
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index bfd8dd45ee..ffe82b0bd2 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -4,7 +4,7 @@
Copyright Tim Potter <tpot@samba.org> 2000
Copyright Andrew Bartlett <abartlet@samba.org> 2002
- largely based on pam_userdb by Christian Gafton <gafton@redhat.com>
+ largely based on pam_userdb by Cristian Gafton <gafton@redhat.com>
also contains large slabs of code from pam_unix by Elliot Lee <sopwith@redhat.com>
(see copyright below for full details)
*/
@@ -696,7 +696,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
lctrl = ctrl;
if (on(WINBIND_USE_AUTHTOK_ARG, lctrl)) {
- ctrl = WINBIND_USE_FIRST_PASS_ARG | lctrl;
+ lctrl |= WINBIND_USE_FIRST_PASS_ARG;
}
retry = 0;
retval = PAM_AUTHTOK_ERR;
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 335e21adcb..88a7d3ed3b 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/nsswitch/winbindd_ads.c
@@ -651,7 +651,8 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
char *sidstr;
char **members;
- int i, num_members;
+ int i;
+ size_t num_members;
fstring sid_string;
BOOL more_values;
const char **attrs;