/* Licensed to the Apache Software Foundation (ASF) under one or more *contributorlicenseagreements.SeetheNOTICEfiledistributedwith *thisworkforadditionalinformationregardingcopyrightownership. *TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0 *(the"License");youmaynotusethisfileexceptincompliancewith *theLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting,software *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. *SeetheLicenseforthespecificlanguagegoverningpermissionsand *limitationsundertheLicense.
*/
apr_status_t md_try_chown(constchar *fname, unsignedint uid, int gid, apr_pool_t *p)
{ #if AP_NEED_SET_MUTEX_PERMS && HAVE_UNISTD_H /* Since we only switch user when running as root, we only need to chown directories *inthatcase.Otherwise,theserverwillignoreany"user/group"directivesand *childprocesseshavethesameprivilegesastheparent.
*/ if (!geteuid()) { if (-1 == chown(fname, (uid_t)uid, (gid_t)gid)) {
apr_status_t rv = APR_FROM_OS_ERROR(errno); if (!APR_STATUS_IS_ENOENT(rv)) {
ap_log_perror(APLOG_MARK, APLOG_ERR, rv, p, APLOGNO(10082) "Can't change owner of %s", fname);
} return rv;
}
} return APR_SUCCESS; #else return APR_ENOTIMPL; #endif
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.