summaryrefslogtreecommitdiff
path: root/source4/param/share_classic.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-07-04 04:15:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:59:03 -0500
commitb540bc85ff8140424e9e925aa73f1f1cacfbd64a (patch)
treee3dddae8f6f3324ba7de903eb32d6e70f43c5501 /source4/param/share_classic.c
parent80ae1c2a2aeace891d24390f2f639a3c3d18739a (diff)
downloadsamba-b540bc85ff8140424e9e925aa73f1f1cacfbd64a.tar.gz
r23696: added the create mask and related share permissions options to Samba4,
using the new share_int_option() code from Simo speaking of which, this is the first time I've looked closely at the share_classic.c code. It is absolutely and completely braindead and broken. Whatever drugs Simo was on at the time, he better not try to cross a border with them on him! Problems with it: - if you actually set a value, it gets ignored, and the defvalue gets used instead ('ret' is never returned). If you don't set a value, then defvalue gets returned too. Sound useful? - it means we now have to list parameters in source/param/ in lots and lots of places, all of which have to match exactly. code like this is supposed to reduce the likelyhood of errors, not increase it! - code which has a long line of if() statements with strcmp() should cause your fingers to burn on the keyboard when you type it in. That's what structure lists are for. Strangely enough, we have all the info in loadparm.c in a structure list, but instead it gets replicated in share_classic.c in this strange if() strcmp() form expect some changes to this code shortly. I'll need a calming cup of tea first though :-) (This used to be commit 19a9fc2f444efc0894b06a249daf73ed555b61e2)
Diffstat (limited to 'source4/param/share_classic.c')
-rw-r--r--source4/param/share_classic.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/source4/param/share_classic.c b/source4/param/share_classic.c
index 794a21c5bf7..0a6e23287cf 100644
--- a/source4/param/share_classic.c
+++ b/source4/param/share_classic.c
@@ -90,6 +90,9 @@ static const char *sclassic_string_option(struct share_config *scfg, const char
return lp_fstype(s->snum);
}
+ DEBUG(0,("request for unknown share string option '%s'\n",
+ opt_name));
+
return defval;
}
@@ -117,19 +120,33 @@ int sclassic_int_option(struct share_config *scfg, const char *opt_name, int def
}
if (strcmp(opt_name, SHARE_CSC_POLICY) == 0) {
- ret = lp_csc_policy(s->snum);
- if (ret == -1) {
- return defval;
- }
+ return lp_csc_policy(s->snum);
}
if (strcmp(opt_name, SHARE_MAX_CONNECTIONS) == 0) {
- ret = lp_max_connections(s->snum);
- if (ret == -1) {
- return defval;
- }
+ return lp_max_connections(s->snum);
+ }
+
+ if (strcmp(opt_name, SHARE_CREATE_MASK) == 0) {
+ return lp_create_mask(s->snum);
+ }
+
+ if (strcmp(opt_name, SHARE_DIR_MASK) == 0) {
+ return lp_dir_mask(s->snum);
}
+ if (strcmp(opt_name, SHARE_FORCE_DIR_MODE) == 0) {
+ return lp_force_dir_mode(s->snum);
+ }
+
+ if (strcmp(opt_name, SHARE_FORCE_CREATE_MODE) == 0) {
+ return lp_force_create_mode(s->snum);
+ }
+
+
+ DEBUG(0,("request for unknown share int option '%s'\n",
+ opt_name));
+
return defval;
}
@@ -193,6 +210,9 @@ BOOL sclassic_bool_option(struct share_config *scfg, const char *opt_name, BOOL
return lp_ci_filesystem(s->snum);
}
+ DEBUG(0,("request for unknown share bool option '%s'\n",
+ opt_name));
+
return defval;
}
@@ -228,6 +248,9 @@ const char **sclassic_string_list_option(TALLOC_CTX *mem_ctx, struct share_confi
return lp_ntvfs_handler(s->snum);
}
+ DEBUG(0,("request for unknown share list option '%s'\n",
+ opt_name));
+
return NULL;
}