/* Mount options which take uid or gid */
fsparam_uid("backupuid", Opt_backupuid),
fsparam_gid("backupgid", Opt_backupgid),
fsparam_uid("uid", Opt_uid),
fsparam_uid("cruid", Opt_cruid),
fsparam_gid("gid", Opt_gid),
switch (match_token(value, cifs_smb_version_tokens, args)) { #ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY case Smb_1: if (disable_legacy_dialects) {
cifs_errorf(fc, "mount with legacy dialect disabled\n"); return1;
} if (is_smb3) {
cifs_errorf(fc, "vers=1.0 (cifs) not permitted when mounting with smb3\n"); return1;
}
cifs_errorf(fc, "Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers\n");
ctx->ops = &smb1_operations;
ctx->vals = &smb1_values; break; case Smb_20: if (disable_legacy_dialects) {
cifs_errorf(fc, "mount with legacy dialect disabled\n"); return1;
} if (is_smb3) {
cifs_errorf(fc, "vers=2.0 not permitted when mounting with smb3\n"); return1;
}
ctx->ops = &smb20_operations;
ctx->vals = &smb20_values; break; #else case Smb_1:
cifs_errorf(fc, "vers=1.0 (cifs) mount not permitted when legacy dialects disabled\n"); return1; case Smb_20:
cifs_errorf(fc, "vers=2.0 mount not permitted when legacy dialects disabled\n"); return1; #endif/* CIFS_ALLOW_INSECURE_LEGACY */ case Smb_21:
ctx->ops = &smb21_operations;
ctx->vals = &smb21_values; break; case Smb_30:
ctx->ops = &smb30_operations;
ctx->vals = &smb30_values; break; case Smb_302:
ctx->ops = &smb30_operations; /* currently identical with 3.0 */
ctx->vals = &smb302_values; break; case Smb_311:
ctx->ops = &smb311_operations;
ctx->vals = &smb311_values; break; case Smb_3any:
ctx->ops = &smb30_operations; /* currently identical with 3.0 */
ctx->vals = &smb3any_values; break; case Smb_default:
ctx->ops = &smb30_operations;
ctx->vals = &smbdefault_values; break; default:
cifs_errorf(fc, "Unknown vers= option specified: %s\n", value); return1;
} return0;
}
int smb3_parse_opt(constchar *options, constchar *key, char **val)
{ int rc = -ENOENT; char *opts, *orig, *p;
orig = opts = kstrdup(options, GFP_KERNEL); if (!opts) return -ENOMEM;
ret = security_sb_eat_lsm_opts(options, &fc->security); if (ret) return ret;
/* BB Need to add support for sep= here TBD */ while ((key = strsep(&options, ",")) != NULL) {
size_t len; char *value;
if (*key == 0) break;
/* Check if following character is the deliminator If yes, *wehaveencounteredadoubledeliminatorresettheNULL *charactertothedeliminator
*/ while (options && options[0] == ',') {
len = strlen(key);
strcpy(key + len, options);
options = strchr(options, ','); if (options)
*options++ = 0;
}
len = 0;
value = strchr(key, '='); if (value) { if (value == key) continue;
*value++ = 0;
len = strlen(value);
}
ret = vfs_parse_fs_string(fc, key, value, len); if (ret < 0) break;
}
if (ctx->rdma && ctx->vals->protocol_id < SMB30_PROT_ID) {
cifs_errorf(fc, "SMB Direct requires Version >=3.0\n"); return -EOPNOTSUPP;
}
#ifndef CONFIG_KEYS /* Muliuser mounts require CONFIG_KEYS support */ if (ctx->multiuser) {
cifs_errorf(fc, "Multiuser mounts require kernels with CONFIG_KEYS enabled\n"); return -1;
} #endif
if (ctx->got_version == false)
pr_warn_once("No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3.1.1 (or even SMB3 or SMB2.1) specify vers=1.0 on mount.\n");
if (!ctx->UNC) {
cifs_errorf(fc, "CIFS mount error: No usable UNC path provided in device string!\n"); return -1;
}
/* make sure UNC has a share name */ if (strlen(ctx->UNC) < 3 || !strchr(ctx->UNC + 3, '\\')) {
cifs_errorf(fc, "Malformed UNC. Unable to find share name.\n"); return -ENOENT;
}
if (!ctx->got_ip) { int len; constchar *slash;
/* No ip= option specified? Try to get it from UNC */ /* Use the address part of the UNC. */
slash = strchr(&ctx->UNC[2], '\\');
len = slash - &ctx->UNC[2]; if (!cifs_convert_address((struct sockaddr *)&ctx->dstaddr,
&ctx->UNC[2], len)) {
pr_err("Unable to determine destination address\n"); return -EHOSTUNREACH;
}
}
/* set the port that we got earlier */
cifs_set_port((struct sockaddr *)&ctx->dstaddr, ctx->port);
if (ctx->uid_specified && !ctx->forceuid_specified) {
ctx->override_uid = 1;
pr_notice("enabling forceuid mount option implicitly because uid= option is specified\n");
}
if (ctx->gid_specified && !ctx->forcegid_specified) {
ctx->override_gid = 1;
pr_notice("enabling forcegid mount option implicitly because gid= option is specified\n");
}
if (ctx->override_uid && !ctx->uid_specified) {
ctx->override_uid = 0;
pr_notice("ignoring forceuid mount option specified with no uid= option\n");
}
if (ctx->override_gid && !ctx->gid_specified) {
ctx->override_gid = 0;
pr_notice("ignoring forcegid mount option specified with no gid= option\n");
}
/* if rsize or wsize not passed in on remount, use previous values */
ctx->rsize = rsize ? CIFS_ALIGN_RSIZE(fc, rsize) : cifs_sb->ctx->rsize;
ctx->wsize = wsize ? CIFS_ALIGN_WSIZE(fc, wsize) : cifs_sb->ctx->wsize;
if (!skip_parsing) {
opt = fs_parse(fc, smb3_fs_parameters, param, &result); if (opt < 0) return ctx->sloppy ? 1 : opt;
}
switch (opt) { case Opt_compress: if (!IS_ENABLED(CONFIG_CIFS_COMPRESSION)) {
cifs_errorf(fc, "CONFIG_CIFS_COMPRESSION kernel config option is unset\n"); goto cifs_parse_mount_err;
}
ctx->compress = true;
cifs_dbg(VFS, "SMB3 compression support is experimental\n"); break; case Opt_nodfs:
ctx->nodfs = 1; break; case Opt_hard: if (result.negated) { if (ctx->retry == 1)
cifs_dbg(VFS, "conflicting hard vs. soft mount options\n");
ctx->retry = 0;
} else
ctx->retry = 1; break; case Opt_soft: if (result.negated)
ctx->retry = 1; else { if (ctx->retry == 1)
cifs_dbg(VFS, "conflicting hard vs soft mount options\n");
ctx->retry = 0;
} break; case Opt_mapposix: if (result.negated)
ctx->remap = false; else {
ctx->remap = true;
ctx->sfu_remap = false; /* disable SFU mapping */
} break; case Opt_mapchars: if (result.negated)
ctx->sfu_remap = false; else {
ctx->sfu_remap = true;
ctx->remap = false; /* disable SFM (mapposix) mapping */
} break; case Opt_user_xattr: if (result.negated)
ctx->no_xattr = 1; else
ctx->no_xattr = 0; break; case Opt_forceuid: if (result.negated)
ctx->override_uid = 0; else
ctx->override_uid = 1;
ctx->forceuid_specified = true; break; case Opt_forcegid: if (result.negated)
ctx->override_gid = 0; else
ctx->override_gid = 1;
ctx->forcegid_specified = true; break; case Opt_perm: if (result.negated)
ctx->noperm = 1; else
ctx->noperm = 0; break; case Opt_dynperm: if (result.negated)
ctx->dynperm = 0; else
ctx->dynperm = 1; break; case Opt_sfu: if (result.negated)
ctx->sfu_emul = 0; else
ctx->sfu_emul = 1; break; case Opt_noblocksend:
ctx->noblocksnd = 1; break; case Opt_noautotune:
ctx->noautotune = 1; break; case Opt_nolease:
ctx->no_lease = 1; break; case Opt_nosparse:
ctx->no_sparse = 1; break; case Opt_nodelete:
ctx->nodelete = 1; break; case Opt_multichannel: if (result.negated) {
ctx->multichannel = false;
ctx->max_channels = 1;
} else {
ctx->multichannel = true; /* if number of channels not specified, default to 2 */ if (ctx->max_channels < 2)
ctx->max_channels = 2;
} break; case Opt_uid:
ctx->linux_uid = result.uid;
ctx->uid_specified = true; break; case Opt_cruid:
ctx->cred_uid = result.uid;
ctx->cruid_specified = true; break; case Opt_backupuid:
ctx->backupuid = result.uid;
ctx->backupuid_specified = true; break; case Opt_backupgid:
ctx->backupgid = result.gid;
ctx->backupgid_specified = true; break; case Opt_gid:
ctx->linux_gid = result.gid;
ctx->gid_specified = true; break; case Opt_port:
ctx->port = result.uint_32; break; case Opt_file_mode:
ctx->file_mode = result.uint_32; break; case Opt_dirmode:
ctx->dir_mode = result.uint_32; break; case Opt_min_enc_offload:
ctx->min_offload = result.uint_32; break; case Opt_retrans:
ctx->retrans = result.uint_32; break; case Opt_blocksize: /* *inodeblocksizerealisticallyshouldneverneedtobe *lessthan16Korgreaterthan16Manddefaultis1MB. *Notethatsmallinodeblocksizes(e.g.64K)canlead *toverypoorperformanceofcommontoolslikecpandscp
*/ if ((result.uint_32 < CIFS_MAX_MSGSIZE) ||
(result.uint_32 > (4 * SMB3_DEFAULT_IOSIZE))) {
cifs_errorf(fc, "%s: Invalid blocksize\n",
__func__); goto cifs_parse_mount_err;
}
ctx->bsize = CIFS_ALIGN_BSIZE(fc, result.uint_32);
ctx->got_bsize = true; break; case Opt_rasize: /* *readaheadsizerealisticallyshouldneverneedtobe *lessthan1M(CIFS_DEFAULT_IOSIZE)orgreaterthan32M *(perhapsanexceptionshouldbeconsideredinthe *forthecaseofalargenumberofchannels *whenmultichannelisnegotiated)sincethatwouldlead *toplentyofparallelI/Oinflighttotheserver. *Notethatsmallerreadaheadsizeswould *hurtperformanceofcommontoolslikecpandscp *whichoftentriggersequentiali/owithreadahead
*/ if ((result.uint_32 > (8 * SMB3_DEFAULT_IOSIZE)) ||
(result.uint_32 < CIFS_DEFAULT_IOSIZE)) {
cifs_errorf(fc, "%s: Invalid rasize %d vs. %d\n",
__func__, result.uint_32, SMB3_DEFAULT_IOSIZE); goto cifs_parse_mount_err;
}
ctx->rasize = result.uint_32; break; case Opt_rsize:
ctx->rsize = CIFS_ALIGN_RSIZE(fc, result.uint_32);
ctx->got_rsize = true;
ctx->vol_rsize = ctx->rsize; break; case Opt_wsize:
ctx->wsize = CIFS_ALIGN_WSIZE(fc, result.uint_32);
ctx->got_wsize = true;
ctx->vol_wsize = ctx->wsize; break; case Opt_acregmax: if (result.uint_32 > CIFS_MAX_ACTIMEO / HZ) {
cifs_errorf(fc, "acregmax too large\n"); goto cifs_parse_mount_err;
}
ctx->acregmax = HZ * result.uint_32; break; case Opt_acdirmax: if (result.uint_32 > CIFS_MAX_ACTIMEO / HZ) {
cifs_errorf(fc, "acdirmax too large\n"); goto cifs_parse_mount_err;
}
ctx->acdirmax = HZ * result.uint_32; break; case Opt_actimeo: if (result.uint_32 > CIFS_MAX_ACTIMEO / HZ) {
cifs_errorf(fc, "timeout too large\n"); goto cifs_parse_mount_err;
} if ((ctx->acdirmax != CIFS_DEF_ACTIMEO) ||
(ctx->acregmax != CIFS_DEF_ACTIMEO)) {
cifs_errorf(fc, "actimeo ignored since acregmax or acdirmax specified\n"); break;
}
ctx->acdirmax = ctx->acregmax = HZ * result.uint_32; break; case Opt_closetimeo: if (result.uint_32 > SMB3_MAX_DCLOSETIMEO / HZ) {
cifs_errorf(fc, "closetimeo too large\n"); goto cifs_parse_mount_err;
}
ctx->closetimeo = HZ * result.uint_32; break; case Opt_echo_interval: if (result.uint_32 < SMB_ECHO_INTERVAL_MIN ||
result.uint_32 > SMB_ECHO_INTERVAL_MAX) {
cifs_errorf(fc, "echo interval is out of bounds\n"); goto cifs_parse_mount_err;
}
ctx->echo_interval = result.uint_32; break; case Opt_snapshot:
ctx->snapshot_time = result.uint_64; break; case Opt_max_credits: if (result.uint_32 < 20 || result.uint_32 > 60000) {
cifs_errorf(fc, "%s: Invalid max_credits value\n",
__func__); goto cifs_parse_mount_err;
}
ctx->max_credits = result.uint_32; break; case Opt_max_channels: if (result.uint_32 < 1 || result.uint_32 > CIFS_MAX_CHANNELS) {
cifs_errorf(fc, "%s: Invalid max_channels value, needs to be 1-%d\n",
__func__, CIFS_MAX_CHANNELS); goto cifs_parse_mount_err;
}
ctx->max_channels = result.uint_32; /* If more than one channel requested ... they want multichan */ if (result.uint_32 > 1)
ctx->multichannel = true; break; case Opt_max_cached_dirs: if (result.uint_32 < 1) {
cifs_errorf(fc, "%s: Invalid max_cached_dirs, needs to be 1 or more\n",
__func__); goto cifs_parse_mount_err;
}
ctx->max_cached_dirs = result.uint_32; break; case Opt_handletimeout:
ctx->handle_timeout = result.uint_32; if (ctx->handle_timeout > SMB3_MAX_HANDLE_TIMEOUT) {
cifs_errorf(fc, "Invalid handle cache timeout, longer than 16 minutes\n"); goto cifs_parse_mount_err;
} break; case Opt_source:
kfree(ctx->UNC);
ctx->UNC = NULL; switch (smb3_parse_devname(param->string, ctx)) { case0: break; case -ENOMEM:
cifs_errorf(fc, "Unable to allocate memory for devname\n"); goto cifs_parse_mount_err; case -EINVAL:
cifs_errorf(fc, "Malformed UNC in devname\n"); goto cifs_parse_mount_err; default:
cifs_errorf(fc, "Unknown error parsing devname\n"); goto cifs_parse_mount_err;
}
kfree(ctx->source);
ctx->source = smb3_fs_context_fullpath(ctx, '/'); if (IS_ERR(ctx->source)) {
ctx->source = NULL;
cifs_errorf(fc, "OOM when copying UNC string\n"); goto cifs_parse_mount_err;
}
kfree(fc->source);
fc->source = kstrdup(ctx->source, GFP_KERNEL); if (fc->source == NULL) {
cifs_errorf(fc, "OOM when copying UNC string\n"); goto cifs_parse_mount_err;
}
hostname = extract_hostname(ctx->UNC); if (IS_ERR(hostname)) {
cifs_errorf(fc, "Cannot extract hostname from UNC string\n"); goto cifs_parse_mount_err;
} /* last byte, type, is 0x20 for servr type */
memset(ctx->target_rfc1001_name, 0x20, RFC1001_NAME_LEN_WITH_NULL); for (i = 0; i < RFC1001_NAME_LEN && hostname[i] != 0; i++)
ctx->target_rfc1001_name[i] = toupper(hostname[i]);
kfree(hostname); break; case Opt_user:
kfree(ctx->username);
ctx->username = NULL; if (ctx->nullauth) break; if (strlen(param->string) == 0) { /* null user, ie. anonymous authentication */
ctx->nullauth = 1; break;
}
if (strnlen(param->string, CIFS_MAX_USERNAME_LEN) >
CIFS_MAX_USERNAME_LEN) {
pr_warn("username too long\n"); goto cifs_parse_mount_err;
}
ctx->username = no_free_ptr(param->string); break; case Opt_pass:
kfree_sensitive(ctx->password);
ctx->password = NULL; if (strlen(param->string) == 0) break;
ctx->password = no_free_ptr(param->string); break; case Opt_pass2:
kfree_sensitive(ctx->password2);
ctx->password2 = NULL; if (strlen(param->string) == 0) break;
ctx->password2 = no_free_ptr(param->string); break; case Opt_ip: if (strlen(param->string) == 0) {
ctx->got_ip = false; break;
} if (!cifs_convert_address((struct sockaddr *)&ctx->dstaddr,
param->string,
strlen(param->string))) {
pr_err("bad ip= option (%s)\n", param->string); goto cifs_parse_mount_err;
}
ctx->got_ip = true; break; case Opt_domain: if (strnlen(param->string, CIFS_MAX_DOMAINNAME_LEN)
== CIFS_MAX_DOMAINNAME_LEN) {
pr_warn("domain name too long\n"); goto cifs_parse_mount_err;
}
kfree(ctx->domainname);
ctx->domainname = no_free_ptr(param->string);
cifs_dbg(FYI, "Domain name set\n"); break; case Opt_srcaddr: if (!cifs_convert_address(
(struct sockaddr *)&ctx->srcaddr,
param->string, strlen(param->string))) {
pr_warn("Could not parse srcaddr: %s\n",
param->string); goto cifs_parse_mount_err;
} break; case Opt_iocharset: if (strnlen(param->string, 1024) >= 65) {
pr_warn("iocharset name too long\n"); goto cifs_parse_mount_err;
}
if (strncasecmp(param->string, "default", 7) != 0) {
kfree(ctx->iocharset);
ctx->iocharset = no_free_ptr(param->string);
} /* if iocharset not set then load_nls_default *isusedbycaller
*/
cifs_dbg(FYI, "iocharset set to %s\n", ctx->iocharset); break; case Opt_netbiosname:
memset(ctx->source_rfc1001_name, 0x20,
RFC1001_NAME_LEN); /* *FIXME:aretherecasesinwhichacommacan *bevalidinworkstationnetbiosname(and *needspecialhandling)?
*/ for (i = 0; i < RFC1001_NAME_LEN; i++) { /* don't ucase netbiosname for user */ if (param->string[i] == 0) break;
ctx->source_rfc1001_name[i] = param->string[i];
} /* The string has 16th byte zero still from *setattopofthefunction
*/ if (i == RFC1001_NAME_LEN && param->string[i] != 0)
pr_warn("netbiosname longer than 15 truncated\n"); break; case Opt_servern: /* last byte, type, is 0x20 for servr type */
memset(ctx->target_rfc1001_name, 0x20,
RFC1001_NAME_LEN_WITH_NULL); /* *BBaretherecasesinwhichacommacanbevalidinthis *workstationnetbiosname(andneedspecialhandling)?
*/
/* user or mount helper must uppercase the netbios name */ for (i = 0; i < 15; i++) { if (param->string[i] == 0) break;
ctx->target_rfc1001_name[i] = param->string[i];
}
/* The string has 16th byte zero still from set at top of function */ if (i == RFC1001_NAME_LEN && param->string[i] != 0)
pr_warn("server netbiosname longer than 15 truncated\n"); break; case Opt_nbsessinit:
ctx->rfc1001_sessinit = !result.negated;
cifs_dbg(FYI, "rfc1001_sessinit set to %d\n", ctx->rfc1001_sessinit); break; case Opt_ver: /* version of mount userspace tools, not dialect */ /* If interface changes in mount.cifs bump to new ver */ if (strncasecmp(param->string, "1", 1) == 0) { if (strlen(param->string) > 1) {
pr_warn("Bad mount helper ver=%s. Did you want SMB1 (CIFS) dialect and mean to type vers=1.0 instead?\n",
param->string); goto cifs_parse_mount_err;
} /* This is the default */ break;
} /* For all other value, error */
pr_warn("Invalid mount helper version specified\n"); goto cifs_parse_mount_err; case Opt_vers: /* protocol version (dialect) */ if (cifs_parse_smb_version(fc, param->string, ctx, is_smb3) != 0) goto cifs_parse_mount_err;
ctx->got_version = true; break; case Opt_sec: if (cifs_parse_security_flavors(fc, param->string, ctx) != 0) goto cifs_parse_mount_err; break; case Opt_upcalltarget: if (cifs_parse_upcall_target(fc, param->string, ctx) != 0) goto cifs_parse_mount_err; break; case Opt_cache: if (cifs_parse_cache_flavor(fc, param->string, ctx) != 0) goto cifs_parse_mount_err; break; case Opt_witness: #ifndef CONFIG_CIFS_SWN_UPCALL
cifs_errorf(fc, "Witness support needs CONFIG_CIFS_SWN_UPCALL config option\n"); goto cifs_parse_mount_err; #endif
ctx->witness = true;
pr_warn_once("Witness protocol support is experimental\n"); break; case Opt_unicode:
ctx->unicode = !result.negated;
cifs_dbg(FYI, "unicode set to %d\n", ctx->unicode); break; case Opt_rootfs: #ifndef CONFIG_CIFS_ROOT
cifs_dbg(VFS, "rootfs support requires CONFIG_CIFS_ROOT config option\n"); goto cifs_parse_mount_err; #endif
ctx->rootfs = true; break; case Opt_posixpaths: if (result.negated)
ctx->posix_paths = 0; else
ctx->posix_paths = 1; break; case Opt_unix: if (result.negated) { if (ctx->linux_ext == 1)
pr_warn_once("conflicting posix mount options specified\n");
ctx->linux_ext = 0;
ctx->no_linux_ext = 1;
} else { if (ctx->no_linux_ext == 1)
pr_warn_once("conflicting posix mount options specified\n");
ctx->linux_ext = 1;
ctx->no_linux_ext = 0;
ctx->nonativesocket = 1; /* POSIX mounts use NFS style reparse points */
} break; case Opt_nocase:
ctx->nocase = 1; break; case Opt_brl: if (result.negated) { /* *turnoffmandatorylockinginmode *ifremotelockingisturnedoffsincethe *localvfswilldoadvisory
*/ if (ctx->file_mode ==
(S_IALLUGO & ~(S_ISUID | S_IXGRP)))
ctx->file_mode = S_IALLUGO;
ctx->nobrl = 1;
} else
ctx->nobrl = 0; break; case Opt_handlecache: if (result.negated)
ctx->nohandlecache = 1; else
ctx->nohandlecache = 0; break; case Opt_forcemandatorylock:
ctx->mand_lock = 1; break; case Opt_setuids:
ctx->setuids = result.negated; break; case Opt_intr:
ctx->intr = !result.negated; break; case Opt_setuidfromacl:
ctx->setuidfromacl = 1; break; case Opt_strictsync:
ctx->nostrictsync = result.negated; break; case Opt_serverino:
ctx->server_ino = !result.negated; break; case Opt_rwpidforward:
ctx->rwpidforward = 1; break; case Opt_modesid:
ctx->mode_ace = 1; break; case Opt_cifsacl:
ctx->cifs_acl = !result.negated; break; case Opt_acl:
ctx->no_psx_acl = result.negated; break; case Opt_locallease:
ctx->local_lease = 1; break; case Opt_sign:
ctx->sign = true; break; case Opt_ignore_signature:
ctx->sign = true;
ctx->ignore_signature = true; break; case Opt_seal: /* we do not do the following in secFlags because seal *isapertreeconnection(mount)notapersocket *orper-smbconnectionoptionintheprotocol *vol->secFlg|=CIFSSEC_MUST_SEAL;
*/
ctx->seal = 1; break; case Opt_noac:
pr_warn("Mount option noac not supported. Instead set /proc/fs/cifs/LookupCacheEnabled to 0\n"); break; case Opt_fsc: #ifndef CONFIG_CIFS_FSCACHE
cifs_errorf(fc, "FS-Cache support needs CONFIG_CIFS_FSCACHE kernel config option set\n"); goto cifs_parse_mount_err; #endif
ctx->fsc = true; break; case Opt_mfsymlinks:
ctx->mfsymlinks = true; break; case Opt_multiuser:
ctx->multiuser = true; break; case Opt_sloppy:
ctx->sloppy = true; break; case Opt_nosharesock:
ctx->nosharesock = true; break; case Opt_persistent: if (result.negated) {
ctx->nopersistent = true; if (ctx->persistent) {
cifs_errorf(fc, "persistenthandles mount options conflict\n"); goto cifs_parse_mount_err;
}
} else {
ctx->persistent = true; if ((ctx->nopersistent) || (ctx->resilient)) {
cifs_errorf(fc, "persistenthandles mount options conflict\n"); goto cifs_parse_mount_err;
}
} break; case Opt_resilient: if (result.negated) {
ctx->resilient = false; /* already the default */
} else {
ctx->resilient = true; if (ctx->persistent) {
cifs_errorf(fc, "persistenthandles mount options conflict\n"); goto cifs_parse_mount_err;
}
} break; case Opt_tcp_nodelay: /* tcp nodelay should not usually be needed since we CORK/UNCORK the socket */ if (result.negated)
ctx->sockopt_tcp_nodelay = false; else
ctx->sockopt_tcp_nodelay = true; break; case Opt_domainauto:
ctx->domainauto = true; break; case Opt_rdma:
ctx->rdma = true; break; case Opt_reparse: if (parse_reparse_flavor(fc, param->string, ctx)) goto cifs_parse_mount_err; break; case Opt_nativesocket:
ctx->nonativesocket = result.negated; break; case Opt_symlink: if (parse_symlink_flavor(fc, param->string, ctx)) goto cifs_parse_mount_err; break; case Opt_symlinkroot: if (param->string[0] != '/') {
cifs_errorf(fc, "symlinkroot mount options must be absolute path\n"); goto cifs_parse_mount_err;
} if (strnlen(param->string, PATH_MAX) == PATH_MAX) {
cifs_errorf(fc, "symlinkroot path too long (max path length: %u)\n",
PATH_MAX - 1); goto cifs_parse_mount_err;
}
kfree(ctx->symlinkroot);
ctx->symlinkroot = param->string;
param->string = NULL; break;
} /* case Opt_ignore: - is ignored as expected ... */
if (ctx->multiuser && ctx->upcall_target == UPTARGET_MOUNT) {
cifs_errorf(fc, "multiuser mount option not supported with upcalltarget set as 'mount'\n"); goto cifs_parse_mount_err;
}
/* default to only allowing write access to owner of the mount */
ctx->dir_mode = ctx->file_mode = S_IRUGO | S_IXUGO | S_IWUSR;
/* ctx->retry default is 0 (i.e. "soft" limited retry not hard retry) */ /* default is always to request posix paths. */
ctx->posix_paths = 1; /* default to using server inode numbers where available */
ctx->server_ino = 1;
/* default is to use strict cifs caching semantics */
ctx->strict_io = true;
ctx->acregmax = CIFS_DEF_ACTIMEO;
ctx->acdirmax = CIFS_DEF_ACTIMEO;
ctx->closetimeo = SMB3_DEF_DCLOSETIMEO;
ctx->max_cached_dirs = MAX_CACHED_FIDS; /* Most clients set timeout to 0, allows server to use its default */
ctx->handle_timeout = 0; /* See MS-SMB2 spec section 2.2.14.2.12 */
/* offer SMB2.1 and later (SMB3 etc). Secure and widely accepted */
ctx->ops = &smb30_operations;
ctx->vals = &smbdefault_values;
ctx->echo_interval = SMB_ECHO_INTERVAL_DEFAULT;
/* default to no multichannel (single server connection) */
ctx->multichannel = false;
ctx->max_channels = 1;
ctx->backupuid_specified = false; /* no backup intent for a user */
ctx->backupgid_specified = false; /* no backup intent for a group */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.