Move create_share_access_mask() from smbd/service.c to smbd/uid.c
authorJeremy Allison <jra@samba.org>
Fri, 11 Jan 2013 19:12:15 +0000 (11:12 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 14 Jan 2013 18:03:29 +0000 (19:03 +0100)
Make it static. Only called from uid.c now.

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/smbd/proto.h
source3/smbd/service.c
source3/smbd/uid.c

index f9cf5fbbc938884224ede520af5be0a881aa5174..fae1407a816f877cedefa95bbd179b02077bf535 100644 (file)
@@ -967,9 +967,6 @@ void smbd_exit_server_cleanly(const char *const reason) _NORETURN_;
 
 bool set_conn_connectpath(connection_struct *conn, const char *connectpath);
 NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum);
-uint32_t create_share_access_mask(int snum,
-                       bool readonly_share,
-                       const struct security_token *token);
 bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir);
 void load_registry_shares(void);
 int add_home_service(const char *service, const char *username, const char *homedir);
index d3cda73a8219a52f044f0ff229acdcb64ae61fd8..b3abdd89d3ce62e2cf35a9c3c225f914039732ba 100644 (file)
@@ -511,44 +511,6 @@ NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum)
        return NT_STATUS_OK;
 }
 
-/****************************************************************************
-  Setup the share access mask for a connection.
-****************************************************************************/
-
-uint32_t create_share_access_mask(int snum,
-                               bool readonly_share,
-                               const struct security_token *token)
-{
-       uint32_t share_access = 0;
-
-       share_access_check(token,
-                       lp_servicename(talloc_tos(), snum),
-                       MAXIMUM_ALLOWED_ACCESS,
-                       &share_access);
-
-       if (readonly_share) {
-               share_access &=
-                       ~(SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA |
-                         SEC_FILE_WRITE_EA | SEC_FILE_WRITE_ATTRIBUTE |
-                         SEC_DIR_DELETE_CHILD );
-       }
-
-       if (security_token_has_privilege(token, SEC_PRIV_SECURITY)) {
-               share_access |= SEC_FLAG_SYSTEM_SECURITY;
-       }
-       if (security_token_has_privilege(token, SEC_PRIV_RESTORE)) {
-               share_access |= (SEC_RIGHTS_PRIV_RESTORE);
-       }
-       if (security_token_has_privilege(token, SEC_PRIV_BACKUP)) {
-               share_access |= (SEC_RIGHTS_PRIV_BACKUP);
-       }
-       if (security_token_has_privilege(token, SEC_PRIV_TAKE_OWNERSHIP)) {
-               share_access |= (SEC_STD_WRITE_OWNER);
-       }
-
-       return share_access;
-}
-
 /****************************************************************************
   Make a connection, given the snum to connect to, and the vuser of the
   connecting user if appropriate.
index 562867aaee4cb680efe5bc4917556f00ddb7ed10..a3d4f08cd7583ed5512cff7340c6e4555d7c5f80 100644 (file)
@@ -78,6 +78,44 @@ static void free_conn_session_info_if_unused(connection_struct *conn)
        TALLOC_FREE(conn->session_info);
 }
 
+/****************************************************************************
+  Setup the share access mask for a connection.
+****************************************************************************/
+
+static uint32_t create_share_access_mask(int snum,
+                               bool readonly_share,
+                               const struct security_token *token)
+{
+       uint32_t share_access = 0;
+
+       share_access_check(token,
+                       lp_servicename(talloc_tos(), snum),
+                       MAXIMUM_ALLOWED_ACCESS,
+                       &share_access);
+
+       if (readonly_share) {
+               share_access &=
+                       ~(SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA |
+                         SEC_FILE_WRITE_EA | SEC_FILE_WRITE_ATTRIBUTE |
+                         SEC_DIR_DELETE_CHILD );
+       }
+
+       if (security_token_has_privilege(token, SEC_PRIV_SECURITY)) {
+               share_access |= SEC_FLAG_SYSTEM_SECURITY;
+       }
+       if (security_token_has_privilege(token, SEC_PRIV_RESTORE)) {
+               share_access |= (SEC_RIGHTS_PRIV_RESTORE);
+       }
+       if (security_token_has_privilege(token, SEC_PRIV_BACKUP)) {
+               share_access |= (SEC_RIGHTS_PRIV_BACKUP);
+       }
+       if (security_token_has_privilege(token, SEC_PRIV_TAKE_OWNERSHIP)) {
+               share_access |= (SEC_STD_WRITE_OWNER);
+       }
+
+       return share_access;
+}
+
 /*******************************************************************
  Calculate access mask and if this user can access this share.
 ********************************************************************/