Updates the mode/owner/group for the remote file at the given
    location.
333965
def file_attribs(location,
                 mode=None,
                 owner=None,
                 group=None,
                 use_sudo=False,
                 recursive=True):
    """"""
    return dir_attribs(location=location,
                       mode=mode,
                       owner=owner,
                       group=group,
                       recursive=recursive,
                       use_sudo=False)
719703
private void safeSetPathPermission(Path path, OwnerAndPermission ownerAndPermission) {

    try {
      if (ownerAndPermission.getFsPermission() != null) {
        this.fs.setPermission(path, ownerAndPermission.getFsPermission());
      }
    } catch (IOException ioe) {
      log.warn("Failed to set permission for directory " + path, ioe);
    }

    String owner = Strings.isNullOrEmpty(ownerAndPermission.getOwner()) ? null : ownerAndPermission.getOwner();
    String group = Strings.isNullOrEmpty(ownerAndPermission.getGroup()) ? null : ownerAndPermission.getGroup();

    try {
      if (owner != null || group != null) {
        this.fs.setOwner(path, owner, group);
      }
    } catch (IOException ioe) {
      log.warn("Failed to set owner and/or group for path " + path, ioe);
    }
  }
2116
public void setOwner(String src, String username, String group
  ) throws IOException {
    INode[] inodes = null;
    writeLock();
    try {
      if (isInSafeMode()) {
        throw new SafeModeException("Cannot set permission for " + src, safeMode);
      }
      inodes = dir.getExistingPathINodes(src);
      if (isPermissionCheckingEnabled(inodes)) {
        FSPermissionChecker pc = checkOwner(src, inodes);
        if (!pc.isSuper) {
          if (username != null && !pc.user.equals(username)) {
            if (this.permissionAuditOnly) {
              // do not throw the exception, we would like to only log.
              LOG.warn("PermissionAudit failed on " + src + 
                  ": non-super user cannot change owner.");
            } else {
              throw new AccessControlException("Non-super user cannot change owner.");
            }
          }
          if (group != null && !pc.containsGroup(group)) {
            if (this.permissionAuditOnly) {
              // do not throw the exception, we would like to only log.
              LOG.warn("PermissionAudit failed on " + src + 
                  ": user does not belong to " + group + " .");
            } else {
              throw new AccessControlException("User does not belong to " + group
                  + " .");
            }
          }
        }
      }
      dir.setOwner(src, username, group);
    } finally {
      writeUnlock();
    }
    getEditLog().logSync(false);
    if (auditLog.isInfoEnabled()) {
      logAuditEvent(getCurrentUGI(),
        Server.getRemoteIp(),
        "setOwner", src, null, getLastINode(inodes));
    }
  }
201294
def update(self):
        
        if self._owner_changed:
            self.update_owner(self.owner)

        self._resources = [res.name for res in self.resources]
        return self.parent.update(self)
413468
def _set_symlink_ownership(path, user, group, win_owner):
    '''
    
    '''
    if salt.utils.platform.is_windows():
        try:
            salt.utils.win_dacl.set_owner(path, win_owner)
        except CommandExecutionError:
            pass
    else:
        try:
            __salt__['file.lchown'](path, user, group)
        except OSError:
            pass
    return _check_symlink_ownership(path, user, group, win_owner)
755832
public void update(URI location) {
    try {
      if (mUfs.isFile(mCheckpoint.toString())) {
        UnderFileSystemUtils.deleteFileIfExists(mUfs, mTempBackupCheckpoint.toString());
        UnderFileSystemUtils.deleteFileIfExists(mUfs, mBackupCheckpoint.toString());
        // Rename in two steps so that we never have identical mCheckpointPath and
        // mBackupCheckpointPath. This is a concern since UFS may implement rename as copy + delete.
        mUfs.renameFile(mCheckpoint.toString(), mTempBackupCheckpoint.toString());
        mUfs.renameFile(mTempBackupCheckpoint.toString(), mBackupCheckpoint.toString());
        LOG.info("Backed up the checkpoint file to {}", mBackupCheckpoint.toString());
      }
      mUfs.renameFile(location.getPath(), mCheckpoint.toString());
      LOG.info("Renamed the checkpoint file from {} to {}", location,
          mCheckpoint.toString());

      // The checkpoint already reflects the information in the completed logs.
      mWriter.deleteCompletedLogs();
      UnderFileSystemUtils.deleteFileIfExists(mUfs, mBackupCheckpoint.toString());
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
249996
def update_endpoint_group(self, endpoint_group, body=None):
        """"""
        return self.put(self.endpoint_group_path % endpoint_group, body=body)
90618
public function chown(string $file, string $owner = null, bool $recursive = false) : void
    {
        if ($owner === null) {
            $owner = $this->getUser();
        }

        $this->call('update_chown', [
            'chown_path' => $file,
            'chown_user' => $owner,
            'recursive' => $recursive ? 'Y' : 'N',
        ]);
    }
1140103
def update(driver_name, outputdir, version=None):
    
    platform = helpers.get_platform()
    driver_name = helpers.normalize_driver_name(driver_name)
    driver_class = helpers.get_driver_class(driver_name)
    driver = driver_class(outputdir, platform['os_name'], platform['os_bits'])
    if version:
        driver.download_driver_executable(version=version)
    elif driver.is_remote_higher_than_local():
        latest_remote_version = driver.get_latest_remote_version()
        driver.download_driver_executable(version=latest_remote_version)
    else:
        logger.info('{} is up to date'.format(driver_name))
630992
public function chmod($remote_file, $mode)
    {
        $mode = octdec(str_pad($mode, 4, '0', STR_PAD_LEFT));
        $mode = (int) $mode;

        if (!@ftp_chmod($this->connection, $mode, $remote_file) !== false) {
            throw new \Exception("Could not change remote file to mode: " . $mode);
        }

        return true;
    }
20518
def updateperms(self, action, groups):
        
        self.bugzilla.updateperms(self.name, action, groups)
588956
public void updateGroup(long groupId, String name, boolean isPrivate) {
		LinkedMultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
		params.set("name",name);
		params.set("private", String.valueOf(isPrivate));
		restTemplate.put(buildUri("groups/"+groupId), params);
	}
723511
def validate_file_ownership(config):
    """"""
    files = config.get('files', {})
    for file_name, options in files.items():
        for key in options.keys():
            if key not in ["owner", "group", "mode"]:
                raise RuntimeError(
                    "Invalid ownership configuration: {}".format(key))
        owner = options.get('owner', config.get('owner', 'root'))
        group = options.get('group', config.get('group', 'root'))
        optional = options.get('optional', config.get('optional', 'False'))
        if '*' in file_name:
            for file in glob.glob(file_name):
                if file not in files.keys():
                    if os.path.isfile(file):
                        _validate_file_ownership(owner, group, file, optional)
        else:
            if os.path.isfile(file_name):
                _validate_file_ownership(owner, group, file_name, optional)
1295135
def update_resourcegroup(group,**kwargs):
    

    group_i                 = _get_group(group.id)
    group_i.name            = group.name
    group_i.description     = group.description
    group_i.status          = group.status

    db.DBSession.flush()

    return group_i
432381
def update_location(self, ps):
        """"""

        loc = ps.get('location')
        if not loc:
            loc = os.path.join(self.project().get('location'), self.name())
            ps = ps.add_raw(["<location>" + loc])

        return ps
1048955
def _match_modes(self, remote_path, l_st):
        """"""
        self.sftp.chmod(remote_path, S_IMODE(l_st.st_mode))
        self.sftp.utime(remote_path, (l_st.st_atime, l_st.st_mtime))

        if self.chown:
            self.sftp.chown(remote_path, l_st.st_uid, l_st.st_gid)
89441
public GitlabGroup updateGroup(GitlabGroup group, GitlabUser sudoUser) throws IOException {

        Query query = new Query()
                .appendIf("name", group.getName())
                .appendIf("path", group.getPath())
                .appendIf("description", group.getDescription())
                .appendIf("membership_lock", group.getMembershipLock())
                .appendIf("share_with_group_lock", group.getShareWithGroupLock())
                .appendIf("visibility", group.getVisibility().toString())
                .appendIf("lfs_enabled", group.isLfsEnabled())
                .appendIf("request_access_enabled", group.isRequestAccessEnabled())
                .appendIf("shared_runners_minutes_limit", group.getSharedRunnersMinutesLimit())
                .appendIf("ldap_cn", group.getLdapCn())
                .appendIf("ldap_access", group.getLdapAccess())
                .appendIf(PARAM_SUDO, sudoUser != null ? sudoUser.getId() : null);

        String tailUrl = GitlabGroup.URL + "/" + group.getId() + query.toString();

        return retrieve().method(PUT).to(tailUrl, GitlabGroup.class);
    }