|
Lines 334-340
static void parse_opt(const char *opt, int *mask, char *extra_opts, int len)
Link Here
|
| 334 |
* standard options (indicated by MS_ bits), and output parameter |
334 |
* standard options (indicated by MS_ bits), and output parameter |
| 335 |
* "@extra_opts" gets all the filesystem-specific options. |
335 |
* "@extra_opts" gets all the filesystem-specific options. |
| 336 |
*/ |
336 |
*/ |
| 337 |
static void parse_opts(const char *options, int *flags, char **extra_opts) |
337 |
static void parse_opts(const char *options, int *flags, char **extra_opts, |
|
|
338 |
int *lock) |
| 338 |
{ |
339 |
{ |
| 339 |
if (options != NULL) { |
340 |
if (options != NULL) { |
| 340 |
char *opts = xstrdup(options); |
341 |
char *opts = xstrdup(options); |
|
Lines 358-363
static void parse_opts(const char *options, int *flags, char **extra_opts)
Link Here
|
| 358 |
/* end of option item or last item */ |
359 |
/* end of option item or last item */ |
| 359 |
if (*p == '\0' || *(p + 1) == '\0') { |
360 |
if (*p == '\0' || *(p + 1) == '\0') { |
| 360 |
parse_opt(opt, flags, *extra_opts, len); |
361 |
parse_opt(opt, flags, *extra_opts, len); |
|
|
362 |
if (strcmp(opt, "lock") == 0) |
| 363 |
*lock = 1; |
| 364 |
if (strcmp(opt, "nolock") == 0) |
| 365 |
*lock = 0; |
| 361 |
opt = NULL; |
366 |
opt = NULL; |
| 362 |
} |
367 |
} |
| 363 |
} |
368 |
} |
|
Lines 421-426
int main(int argc, char *argv[])
Link Here
|
| 421 |
char *spec, *mount_point, *fs_type = "nfs"; |
426 |
char *spec, *mount_point, *fs_type = "nfs"; |
| 422 |
char *extra_opts = NULL, *mount_opts = NULL; |
427 |
char *extra_opts = NULL, *mount_opts = NULL; |
| 423 |
uid_t uid = getuid(); |
428 |
uid_t uid = getuid(); |
|
|
429 |
int lock = 1; |
| 424 |
|
430 |
|
| 425 |
progname = basename(argv[0]); |
431 |
progname = basename(argv[0]); |
| 426 |
|
432 |
|
|
Lines 531-537
int main(int argc, char *argv[])
Link Here
|
| 531 |
goto out; |
537 |
goto out; |
| 532 |
} |
538 |
} |
| 533 |
|
539 |
|
| 534 |
parse_opts(mount_opts, &flags, &extra_opts); |
540 |
parse_opts(mount_opts, &flags, &extra_opts, &lock); |
| 535 |
|
541 |
|
| 536 |
if (uid != 0) { |
542 |
if (uid != 0) { |
| 537 |
if (!(flags & (MS_USERS|MS_USER))) { |
543 |
if (!(flags & (MS_USERS|MS_USER))) { |
|
Lines 546-551
int main(int argc, char *argv[])
Link Here
|
| 546 |
goto out; |
552 |
goto out; |
| 547 |
} |
553 |
} |
| 548 |
|
554 |
|
|
|
555 |
if (!fake && lock) { |
| 556 |
if (!start_statd()) { |
| 557 |
nfs_error(_("%s: rpc.statd is not running but is " |
| 558 |
"required for remote locking.\n" |
| 559 |
" Either use '-o nolock' to keep " |
| 560 |
"locks local, or start statd."), |
| 561 |
progname); |
| 562 |
mnt_err = EX_FAIL; |
| 563 |
goto out; |
| 564 |
} |
| 565 |
} |
| 566 |
|
| 549 |
mnt_err = try_mount(spec, mount_point, flags, fs_type, &extra_opts, |
567 |
mnt_err = try_mount(spec, mount_point, flags, fs_type, &extra_opts, |
| 550 |
mount_opts, fake, nomtab, FOREGROUND); |
568 |
mount_opts, fake, nomtab, FOREGROUND); |
| 551 |
if (mnt_err == EX_BG) { |
569 |
if (mnt_err == EX_BG) { |