From 78e75d4f6c6bab84b4f40c5d86398c7c90b8ae36 Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 29 Aug 2003 07:31:39 +0000 Subject: Update mount helper to take synonyms for file_mode and dir_mode (fmask and dmask) (This used to be commit 89a0e97094fa85b6339f0ad0884cf55987758263) --- source3/client/mount.cifs.c | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c index 6bd8c0f008..7ab17a2b02 100755 --- a/source3/client/mount.cifs.c +++ b/source3/client/mount.cifs.c @@ -164,17 +164,36 @@ int parse_options(char * options) if (value && *value) { got_gid = 1; } - } /* else if (strnicmp(data, "file_mode", 4) == 0) { - if (value && *value) { - vol->file_mode = - simple_strtoul(value, &value, 0); + /* fmask and dmask synonyms for people used to smbfs syntax */ + } else if (strcmp(data, "file_mode") == 0 || strcmp(data, "fmask")==0) { + if (!value || !*value) { + printf ("Option '%s' requires a numerical argument\n", data); + return 1; } - } else if (strnicmp(data, "dir_mode", 3) == 0) { - if (value && *value) { - vol->dir_mode = - simple_strtoul(value, &value, 0); + + if (value[0] != '0') { + printf ("WARNING: '%s' not expressed in octal.\n", data); } - } else if (strnicmp(data, "port", 4) == 0) { + + if (strcmp (data, "fmask") == 0) { + printf ("WARNING: CIFS mount option 'fmask' is deprecated. Use 'file_mode' instead.\n"); + data = "file_mode"; + } + } else if (strcmp(data, "dir_mode") == 0 || strcmp(data, "dmask")==0) { + if (!value || !*value) { + printf ("Option '%s' requires a numerical argument\n", data); + return 1; + } + + if (value[0] != '0') { + printf ("WARNING: '%s' not expressed in octal.\n", data); + } + + if (strcmp (data, "dmask") == 0) { + printf ("WARNING: CIFS mount option 'dmask' is deprecated. Use 'dir_mode' instead.\n"); + data = "dir_mode"; + } + } /* else if (strnicmp(data, "port", 4) == 0) { if (value && *value) { vol->port = simple_strtoul(value, &value, 0); -- cgit