Ignore:
Timestamp:
Jul 11, 2008, 1:13:42 AM (17 years ago)
Author:
Paul Smedley
Message:

Update branch to 3.0.31 release

Location:
branches/samba-3.0/source/smbd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/smbd/oplock_linux.c

    r1 r140  
    2424#if HAVE_KERNEL_OPLOCKS_LINUX
    2525
    26 /* these can be removed when they are in glibc headers */
    27 struct  cap_user_header {
    28         uint32 version;
    29         int pid;
    30 } header;
    31 struct cap_user_data {
    32         uint32 effective;
    33         uint32 permitted;
    34         uint32 inheritable;
    35 } data;
    36 
    37 extern int capget(struct cap_user_header * hdrp,
    38                   struct cap_user_data * datap);
    39 extern int capset(struct cap_user_header * hdrp,
    40                   const struct cap_user_data * datap);
    41 
    4226static SIG_ATOMIC_T signals_received;
    4327#define FD_PENDING_SIZE 100
     
    7761}
    7862
    79 /****************************************************************************
    80  Try to gain a linux capability.
    81 ****************************************************************************/
    82 
    83 static void set_capability(unsigned capability)
    84 {
    85 #ifndef _LINUX_CAPABILITY_VERSION
    86 #define _LINUX_CAPABILITY_VERSION 0x19980330
    87 #endif
    88         header.version = _LINUX_CAPABILITY_VERSION;
    89         header.pid = 0;
    90 
    91         if (capget(&header, &data) == -1) {
    92                 DEBUG(3,("Unable to get kernel capabilities (%s)\n",
    93                          strerror(errno)));
    94                 return;
    95         }
    96 
    97         data.effective |= (1<<capability);
    98 
    99         if (capset(&header, &data) == -1) {
    100                 DEBUG(3,("Unable to set %d capability (%s)\n",
    101                          capability, strerror(errno)));
    102         }
    103 }
    104 
    10563/*
    10664 Call to set the kernel lease signal handler
     
    12886        ret = fcntl(fd, F_SETLEASE, leasetype);
    12987        if (ret == -1 && errno == EACCES) {
    130                 set_capability(CAP_LEASE);
     88                set_effective_capability(LEASE_CAPABILITY);
    13189                ret = fcntl(fd, F_SETLEASE, leasetype);
    13290        }
  • branches/samba-3.0/source/smbd/posix_acls.c

    r124 r140  
    22902290
    22912291/****************************************************************************
    2292  Should we override a deny ?  Check deprecated 'acl group control'
    2293  and 'dos filemode'
    2294 ****************************************************************************/
    2295 
    2296 static BOOL acl_group_override(connection_struct *conn, gid_t prim_gid)
    2297 {
    2298         if ( (errno == EACCES || errno == EPERM)
    2299                 && (lp_acl_group_control(SNUM(conn)) || lp_dos_filemode(SNUM(conn)))
    2300                 && current_user_in_group(prim_gid))
    2301         {
     2292 Should we override a deny ?  Check 'acl group control' and 'dos filemode'
     2293****************************************************************************/
     2294
     2295static BOOL acl_group_override(connection_struct *conn, gid_t prim_gid, const char *fname)
     2296{
     2297        SMB_STRUCT_STAT sbuf;
     2298
     2299        if ((errno != EPERM) && (errno != EACCES)) {
     2300                return False;
     2301        }
     2302
     2303        /* file primary group == user primary or supplementary group */
     2304        if (lp_acl_group_control(SNUM(conn)) && current_user_in_group(prim_gid)) {
    23022305                return True;
    2303         }
     2306        }
     2307
     2308        /* user has writeable permission */
     2309        if (lp_dos_filemode(SNUM(conn)) && can_write_to_file(conn, fname, &sbuf)) {
     2310                return True;
     2311        }
    23042312
    23052313        return False;
     
    24892497                        }
    24902498
    2491                         if (acl_group_override(conn, prim_gid)) {
     2499                        if (acl_group_override(conn, prim_gid, fsp->fsp_name)) {
    24922500                                int sret;
    24932501
     
    25202528                        }
    25212529
    2522                         if (acl_group_override(conn, prim_gid)) {
     2530                        if (acl_group_override(conn, prim_gid, fsp->fsp_name)) {
    25232531                                int sret;
    25242532
     
    34783486                                                int sret = -1;
    34793487
    3480                                                 if (acl_group_override(conn, sbuf.st_gid)) {
     3488                                                if (acl_group_override(conn, sbuf.st_gid, fsp->fsp_name)) {
    34813489                                                        DEBUG(5,("set_nt_acl: acl group control on and "
    34823490                                                                "current user in file %s primary group. Override delete_def_acl\n",
     
    35253533                                        if(SMB_VFS_CHMOD(conn,fsp->fsp_name, posix_perms) == -1) {
    35263534                                                int sret = -1;
    3527                                                 if (acl_group_override(conn, sbuf.st_gid)) {
     3535                                                if (acl_group_override(conn, sbuf.st_gid, fsp->fsp_name)) {
    35283536                                                        DEBUG(5,("set_nt_acl: acl group control on and "
    35293537                                                                "current user in file %s primary group. Override chmod\n",
Note: See TracChangeset for help on using the changeset viewer.