hfaxd/FileSystem.c++
/*
 * Set ownership of a file.
 */
Set ownership of a file.
Set ownership of a file .
void
HylaFAXServer::chownCmd(const char* pathname, const char* user)
{
    struct stat sb;
    SpoolDir* dir = fileAccess(pathname, W_OK, sb);
    if (dir) {
	u_int id;
	if (isdigit(user[0]))
	    id = (u_int) atoi(user);
	else if (!userID(user, id))
	    return;
	if (!FileCache::chown(pathname, sb.st_uid, (gid_t) id))
	    perror_reply(550, pathname, errno);
	else
	    ack(250, cmdToken(T_CHOWN));
    }
}
void HylaFAXServer :: chownCmd ( const char * pathname , const char * user ) { struct stat sb ; SpoolDir * dir = fileAccess ( pathname , W_OK , sb ) ; if ( dir ) { u_int id ; if ( isdigit ( user [ 0 ] ) ) id = ( u_int ) atoi ( user ) ; else if ( ! userID ( user , id ) ) return ; if ( ! FileCache :: chown ( pathname , sb . st_uid , ( gid_t ) id ) ) perror_reply ( 550 , pathname , errno ) ; else ack ( 250 , cmdToken ( T_CHOWN ) ) ; } }
Set ownership of a file.
Set ownership of a file .