Index: client/smbmount.c =================================================================== --- client/smbmount.c (revision 2076) +++ client/smbmount.c (working copy) @@ -43,6 +43,10 @@ static int smb_port = 0; static BOOL got_user; static BOOL got_pass; +static BOOL use_uid = 0; +static BOOL use_gid = 0; +static BOOL use_fmask = 0; +static BOOL use_dmask = 0; static uid_t mount_uid; static gid_t mount_gid; static int mount_ro; @@ -470,22 +474,22 @@ if (mount_ro) { args[i++] = "-r"; } - if (mount_uid) { + if (use_uid) { slprintf(tmp, sizeof(tmp)-1, "%d", mount_uid); args[i++] = "-u"; args[i++] = smb_xstrdup(tmp); } - if (mount_gid) { + if (use_gid) { slprintf(tmp, sizeof(tmp)-1, "%d", mount_gid); args[i++] = "-g"; args[i++] = smb_xstrdup(tmp); } - if (mount_fmask) { + if (use_fmask) { slprintf(tmp, sizeof(tmp)-1, "0%o", mount_fmask); args[i++] = "-f"; args[i++] = smb_xstrdup(tmp); } - if (mount_dmask) { + if (use_dmask) { slprintf(tmp, sizeof(tmp)-1, "0%o", mount_dmask); args[i++] = "-d"; args[i++] = smb_xstrdup(tmp); @@ -783,14 +787,18 @@ pstrcpy(my_netbios_name,opteq+1); } else if(!strcmp(opts, "uid")) { mount_uid = nametouid(opteq+1); + use_uid++; } else if(!strcmp(opts, "gid")) { mount_gid = nametogid(opteq+1); + use_gid++; } else if(!strcmp(opts, "port")) { smb_port = val; } else if(!strcmp(opts, "fmask")) { mount_fmask = strtol(opteq+1, NULL, 8); + use_fmask++; } else if(!strcmp(opts, "dmask")) { mount_dmask = strtol(opteq+1, NULL, 8); + use_dmask++; } else if(!strcmp(opts, "debug")) { DEBUGLEVEL = val; } else if(!strcmp(opts, "ip")) {