summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-12-18 14:23:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:53 -0500
commit0a585102d656b267af723a5bdd258e83f532c3a6 (patch)
tree80c1fbdb731b7c04437f63c323252805dfab0a3d /source3
parent46dee7219da466e292c865fa7e24bc8634197875 (diff)
downloadsamba-0a585102d656b267af723a5bdd258e83f532c3a6.tar.gz
samba-0a585102d656b267af723a5bdd258e83f532c3a6.tar.bz2
samba-0a585102d656b267af723a5bdd258e83f532c3a6.zip
r12312: Reformatting and a trivial change: is_share_read_only_for_user only uses
conn->service, so there's no point in passing down the whole conn struct. Volker (This used to be commit 39041297c771795efaa4292bc6e8020c1a047f32)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/uid.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index d1ecaf6625..458eb3a2c8 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -81,45 +81,53 @@ BOOL change_to_guest(void)
Readonly share for this user ?
****************************************************************************/
-static BOOL is_share_read_only_for_user(connection_struct *conn, user_struct *vuser)
+static BOOL is_share_read_only_for_user(int snum, user_struct *vuser)
{
char **list;
- const char *service = lp_servicename(conn->service);
- BOOL read_only_ret = lp_readonly(conn->service);
+ const char *service = lp_servicename(snum);
+ BOOL read_only_ret = lp_readonly(snum);
if (!service)
return read_only_ret;
- str_list_copy(&list, lp_readlist(conn->service));
+ str_list_copy(&list, lp_readlist(snum));
if (list) {
if (!str_list_sub_basic(list, vuser->user.smb_name) ) {
- DEBUG(0, ("is_share_read_only_for_user: ERROR: read list substitution failed\n"));
+ DEBUG(0, ("is_share_read_only_for_user: ERROR: read "
+ "list substitution failed\n"));
}
if (!str_list_substitute(list, "%S", service)) {
- DEBUG(0, ("is_share_read_only_for_user: ERROR: read list service substitution failed\n"));
+ DEBUG(0, ("is_share_read_only_for_user: ERROR: read "
+ "list service substitution failed\n"));
}
- if (user_in_list(vuser->user.unix_name, (const char **)list, vuser->groups, vuser->n_groups)) {
+ if (user_in_list(vuser->user.unix_name, (const char **)list,
+ vuser->groups, vuser->n_groups)) {
read_only_ret = True;
}
str_list_free(&list);
}
- str_list_copy(&list, lp_writelist(conn->service));
+ str_list_copy(&list, lp_writelist(snum));
if (list) {
if (!str_list_sub_basic(list, vuser->user.smb_name) ) {
- DEBUG(0, ("is_share_read_only_for_user: ERROR: write list substitution failed\n"));
+ DEBUG(0, ("is_share_read_only_for_user: ERROR: write "
+ "list substitution failed\n"));
}
if (!str_list_substitute(list, "%S", service)) {
- DEBUG(0, ("is_share_read_only_for_user: ERROR: write list service substitution failed\n"));
+ DEBUG(0, ("is_share_read_only_for_user: ERROR: write "
+ "list service substitution failed\n"));
}
- if (user_in_list(vuser->user.unix_name, (const char **)list, vuser->groups, vuser->n_groups)) {
+ if (user_in_list(vuser->user.unix_name, (const char **)list,
+ vuser->groups, vuser->n_groups)) {
read_only_ret = False;
}
str_list_free(&list);
}
- DEBUG(10,("is_share_read_only_for_user: share %s is %s for unix user %s\n",
- service, read_only_ret ? "read-only" : "read-write", vuser->user.unix_name ));
+ DEBUG(10,("is_share_read_only_for_user: share %s is %s for unix user "
+ "%s\n", service,
+ read_only_ret ? "read-only" : "read-write",
+ vuser->user.unix_name ));
return read_only_ret;
}
@@ -146,7 +154,7 @@ static BOOL check_user_ok(connection_struct *conn, user_struct *vuser,int snum)
if (!user_ok(vuser->user.unix_name,snum, vuser->groups, vuser->n_groups))
return(False);
- readonly_share = is_share_read_only_for_user(conn, vuser);
+ readonly_share = is_share_read_only_for_user(conn->service, vuser);
if (!readonly_share &&
!share_access_check(conn, snum, vuser, FILE_WRITE_DATA)) {