Move create_share_access_mask() from smbd/service.c to smbd/uid.c.
[kai/samba.git] / source3 / smbd / service.c
index fabc5a36ac8e250c5957ed9acbc7346081fe7130..8f6d4859b08242b982c7e9ee7f9433deb18d7755 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.