From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12601 invoked from network); 24 Nov 2022 10:08:17 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Nov 2022 10:08:17 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1669284497; b=IMlFKH8pzX0dt9IXYdod/e3P3R+31vQ69dr5cYnFUCe+hL70SIIeGMOJC5nbeGnad78mVHFu5f lmDgwLOAT+Sgv4ZziD0jOuv7ZpWXcLSgaFaoJcJJ1E5Og04AIFhWhbZimyuhhguTu/dCuRdvNp MMxPelPosdDFMrmDj4AKUr06wxTZ/rAaJuJrCRAzOCdHUOyhBHGXwuY0kr7zxijoZgyZP7c01V i5AQMEwDc/HSup1S+L+phV+msqU3ii2fqUF4Y2sfIVdUCV1a3ESbol4xjIyAjXEHvhgAtrhSNT zzFt58EcdIR7FrM6t2iYKtmYRb4o3YH3ZV9pgntPBKhm4g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtp1.bureaucracy.de) smtp.remote-ip=80.190.133.201; dmarc=none header.from=bureaucracy.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1669284497; bh=RbFRy/Agzw6Qgaj/9IPl6osStEPkPXu93JORx/gwHtQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:Cc:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=hvIC9+apYL+42s19omsNyroHHvNn9g+B9yIZVwGwlITohyV7wS53Ta3KK2GLW2rsv+bVnDZg2l lJRG/K8Tkfj306UXGL24ndSiDlIHKCXjF1SUt1rAqko2DNC2VG3Fj43PykzqhPFmUTYYs+LrUu 4LFFCGOQst8fmwXqzLLMoP1MIuy58tKBYiJ+8/n5suPSeHaOH1VcPvaiOmmH4y5W0HXVaNxTE2 xo7pS2YH8xEUq15vLIIUAAa+rhmuTEMRxvCnbazJyIiS2RXPd/uQOLxq8vqZWq8xPTAcqTEofY yLwyIm+qN5QGfFTvK7cjpsL2kBZRk4rwQfIR2D9B6WCqTA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:In-Reply-To:Cc:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=7qAhCI5vYMxx+DHToUX8wSUcHJeGcuELuGnUVYua5IE=; b=iv/Z6smMjzlJCsPmcUwE0kX09C UpSX9IyF6QdCZEwjzrsQPbIBHlsxj9rsW2m33VKtuv235rlO+pY4yruL/vWsbMJQuXKoikqf91oSD XikxUV0Ya1lnpkzpc2X6O8NaUa1L1iw/4Oyq3pDsAgRH8XA42HhlxW+R5PwasCrExFQ1v0HD5fMpZ 4qP9PA9gFKgnQRDKhOVckrydmCjwhJObFiQGRKrmEq7xsOnJgUV+Anqn2O2NFav51pZoCeDHLwS2S 6BJb8QV/vxq5kgBwZzCx5mB2inFb2uAOZ3BO7z9vlEv34Ttgl3muWmC6OzPlct3Dv3S3eZ5eGFiyL XIqV67/g==; Received: by zero.zsh.org with local id 1oy99T-0004eU-Vx; Thu, 24 Nov 2022 10:08:16 +0000 Authentication-Results: zsh.org; iprev=pass (smtp1.bureaucracy.de) smtp.remote-ip=80.190.133.201; dmarc=none header.from=bureaucracy.de; arc=none Received: from smtp1.bureaucracy.de ([80.190.133.201]:10885) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oy98s-0004Jc-Nt; Thu, 24 Nov 2022 10:07:39 +0000 Received: from [IPV6:2001:7c7:20f4:4b:56e1:adff:feb0:3ae6] ( [2001:7c7:20f4:4b:56e1:adff:feb0:3ae6]) by smtp1.bureaucracy.de (OpenSMTPD) with ESMTPSA id 60a0c76e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 24 Nov 2022 10:07:37 +0000 (UTC) Message-ID: <126127ef-2c52-ec4e-7bfe-6000ebe29bf9@bureaucracy.de> Date: Thu, 24 Nov 2022 11:07:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH] zsh/random module [UPDATED] To: Clinton Bunch References: <741b77be-b679-76cc-f8ec-49c9d89323c1@zentaur.org> <1e8ea669-7a25-b321-6024-72dbc43ac023@zentaur.org> <41205a86-8aad-4821-baa4-1d2ac9bf3c5d@app.fastmail.com> <1b2cafe6-b4b5-c59a-11f3-4dbc1e99e2bc@zentaur.org> <6275a5ac-3a47-f591-7b3c-380ec4fed5ac@zentaur.org> <20221123194658.GM27622@tarpaulin.shahaf.local2> <4e500f9c-48ef-e1eb-ed7c-5895bd5473ab@zentaur.org> Content-Language: de-DE, en-US From: nimaje+zml@bureaucracy.de Cc: zsh-workers@zsh.org In-Reply-To: <4e500f9c-48ef-e1eb-ed7c-5895bd5473ab@zentaur.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Seq: 51060 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 11/24/22 03:58, Clinton Bunch wrote: > [snip] >>> +/**/ >>> +int >>> +setup_(UNUSED(Module m)) >>> +{ >>> +#ifdef USE_URANDOM >>> +    /* Check for the existence of /dev/urandom */ >>> + >>> +    struct stat st; >>> + >>> +    if (lstat("/dev/urandom",&st) < 0) { >> Why not stat()? > Is it appropriate for /dev/urandom to be a symlink? Yes, for example that is the case on freebsd where urandom is just a symlink to random for compatibility with programs that expect urandom to be there (random blocks until the randomness pool is seeded and then doesn't block anymore). >> >>> +    zwarn("No kernel random pool found."); >>> +    return 1; >>> +    } >>> + >>> +    if (!(S_ISCHR(st.st_mode)) ) { >>> +    zwarn("No kernel random pool found."); >>> +    return 1; >>> +    } So this check would be wrong on freebsd (or use random directly and give an option to use urandom on systems where random starts to block for some reason after being seeded, but no idea if there is a good reason for random being a symlink). >[snip]