/// checks to see if hab/hab exists, if not, fall back to
/// current user/group. If that fails, then return an error.
checks to see if hab/hab exists, if not, fall back to
current user/group. If that fails, then return an error.
checks to see if hab / hab exists if not fall back to current user / group . If that fails then return an error .
fn default_user_and_group() -> Result<(String, String)> {
    let uid = users::get_uid_by_name(DEFAULT_USER);
    let gid = users::get_gid_by_name(DEFAULT_GROUP);
    match (uid, gid) {
        (Some(_), Some(_)) => Ok((DEFAULT_USER.to_string(), DEFAULT_GROUP.to_string())),
        _ => {
            debug!("hab:hab does NOT exist");
            let user = users::get_current_username();
            let group = users::get_current_groupname();
            match (user, group) {
                (Some(user), Some(group)) => {
                    debug!("Running as {}/{}", user, group);
                    Ok((user, group))
                }
                _ => {
                    Err(Error::PermissionFailed("Can't determine current \
                                                 user:group"
                                                            .to_string()))
                }
            }
        }
    }
}
fn default_user_and_group ( ) -> Result < ( String , String ) > { let uid = users :: get_uid_by_name ( DEFAULT_USER ) ; let gid = users :: get_gid_by_name ( DEFAULT_GROUP ) ; match ( uid , gid ) { ( Some ( _ ) , Some ( _ ) ) => Ok ( ( DEFAULT_USER . to_string ( ) , DEFAULT_GROUP . to_string ( ) ) ) , _ => { debug ! ( " " ) ; let user = users :: get_current_username ( ) ; let group = users :: get_current_groupname ( ) ; match ( user , group ) { ( Some ( user ) , Some ( group ) ) => { debug ! ( " " user group ) ; Ok ( ( user , group ) ) } _ => { Err ( Error :: PermissionFailed ( " \
 " . to_string ( ) ) ) } } } } }
checks to see if hab/hab exists, if not, fall back to
current user/group.
checks to see if hab / hab exists if not fall back to current user / group .