Ignore:
Timestamp:
Mar 25, 2007, 5:18:51 PM (18 years ago)
Author:
Yuri Dario
Message:

Source code upgrade to 3.0.25pre2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/source/modules/nfs4_acls.c

    r1 r22  
    605605                return False;
    606606
    607         /* chown logic is a copy/paste from posix_acl.c:set_nt_acl */
    608         if (!unpack_nt_owners(SNUM(fsp->conn), &newUID, &newGID, security_info_sent, psd))
    609         {
    610                 DEBUG(8, ("unpack_nt_owners failed"));
    611                 return False;
    612         }
    613         if (((newUID != (uid_t)-1) && (sbuf.st_uid != newUID)) ||
    614                 ((newGID != (gid_t)-1) && (sbuf.st_gid != newGID))) {
    615                 need_chown = True;
    616         }
    617         if (need_chown) {
    618                 if ((newUID == (uid_t)-1 || newUID == current_user.ut.uid)) {
    619                         if(try_chown(fsp->conn, fsp->fsp_name, newUID, newGID)) {
    620                                 DEBUG(3,("chown %s, %u, %u failed. Error = %s.\n",
    621                                         fsp->fsp_name, (unsigned int)newUID, (unsigned int)newGID, strerror(errno) ));
    622                                 return False;
    623                         }
    624                         DEBUG(10,("chown %s, %u, %u succeeded.\n",
    625                                 fsp->fsp_name, (unsigned int)newUID, (unsigned int)newGID));
    626                         if (smbacl4_GetFileOwner(fsp, &sbuf))
    627                                 return False;
    628                         need_chown = False;
    629                 } else { /* chown is needed, but _after_ changing acl */
    630                         sbuf.st_uid = newUID; /* OWNER@ in case of e_special */
    631                         sbuf.st_gid = newGID; /* GROUP@ in case of e_special */
     607        if (params.do_chown) {
     608                /* chown logic is a copy/paste from posix_acl.c:set_nt_acl */
     609                if (!unpack_nt_owners(SNUM(fsp->conn), &newUID, &newGID, security_info_sent, psd))
     610                {
     611                        DEBUG(8, ("unpack_nt_owners failed"));
     612                        return False;
     613                }
     614                if (((newUID != (uid_t)-1) && (sbuf.st_uid != newUID)) ||
     615                        ((newGID != (gid_t)-1) && (sbuf.st_gid != newGID))) {
     616                        need_chown = True;
     617                }
     618                if (need_chown) {
     619                        if ((newUID == (uid_t)-1 || newUID == current_user.ut.uid)) {
     620                                if(try_chown(fsp->conn, fsp->fsp_name, newUID, newGID)) {
     621                                        DEBUG(3,("chown %s, %u, %u failed. Error = %s.\n",
     622                                                fsp->fsp_name, (unsigned int)newUID, (unsigned int)newGID, strerror(errno) ));
     623                                        return False;
     624                                }
     625                                DEBUG(10,("chown %s, %u, %u succeeded.\n",
     626                                        fsp->fsp_name, (unsigned int)newUID, (unsigned int)newGID));
     627                                if (smbacl4_GetFileOwner(fsp, &sbuf))
     628                                        return False;
     629                                need_chown = False;
     630                        } else { /* chown is needed, but _after_ changing acl */
     631                                sbuf.st_uid = newUID; /* OWNER@ in case of e_special */
     632                                sbuf.st_gid = newGID; /* GROUP@ in case of e_special */
     633                        }
    632634                }
    633635        }
Note: See TracChangeset for help on using the changeset viewer.