Ignore:
Timestamp:
May 24, 2009, 7:45:16 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3 branch to 3.3.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/locking/locking.c

    r206 r222  
    12831283*************************************************************************/
    12841284
    1285 static UNIX_USER_TOKEN *copy_unix_token(TALLOC_CTX *ctx, UNIX_USER_TOKEN *tok)
     1285static UNIX_USER_TOKEN *copy_unix_token(TALLOC_CTX *ctx, const UNIX_USER_TOKEN *tok)
    12861286{
    12871287        UNIX_USER_TOKEN *cpy;
     
    13141314****************************************************************************/
    13151315
    1316 void set_delete_on_close_token(struct share_mode_lock *lck, UNIX_USER_TOKEN *tok)
     1316void set_delete_on_close_token(struct share_mode_lock *lck, const UNIX_USER_TOKEN *tok)
    13171317{
    13181318        TALLOC_FREE(lck->delete_token); /* Also deletes groups... */
     
    13341334****************************************************************************/
    13351335
    1336 void set_delete_on_close_lck(struct share_mode_lock *lck, bool delete_on_close, UNIX_USER_TOKEN *tok)
     1336void set_delete_on_close_lck(struct share_mode_lock *lck, bool delete_on_close, const UNIX_USER_TOKEN *tok)
    13371337{
    13381338        if (lck->delete_on_close != delete_on_close) {
     
    13461346}
    13471347
    1348 bool set_delete_on_close(files_struct *fsp, bool delete_on_close, UNIX_USER_TOKEN *tok)
    1349 {
     1348bool set_delete_on_close(files_struct *fsp, bool delete_on_close, const UNIX_USER_TOKEN *tok)
     1349{
     1350        UNIX_USER_TOKEN *tok_copy = NULL;
    13501351        struct share_mode_lock *lck;
    13511352       
     
    13591360        if (lck == NULL) {
    13601361                return False;
     1362        }
     1363
     1364        if (fsp->conn->admin_user) {
     1365                tok_copy = copy_unix_token(lck, tok);
     1366                tok_copy->uid = (uid_t)0;
     1367                if (tok_copy == NULL) {
     1368                        TALLOC_FREE(lck);
     1369                        return false;
     1370                }
     1371                tok = tok_copy;
    13611372        }
    13621373
Note: See TracChangeset for help on using the changeset viewer.