fix open/mkdir attrs and mode