From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 079AE2858D for ; Thu, 23 May 2024 15:45:24 +0200 (CEST) Received: (qmail 3704 invoked by uid 550); 23 May 2024 13:45:20 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 3672 invoked from network); 23 May 2024 13:45:20 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716471912; x=1717076712; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=A9zTcrDPd+DcsPi6+ePB0Kz2kQXGXVeVXCymqyaCQ8M=; b=LQvyixwX/Vs1YmgkjsfbyA5p2RS/CVzoA7nXBGN88tzzu9pK5HZqjdHO0p6BPRQS2V nc26qhB8oBlOuCcNcxWXJAivE6Gq4uEKLgwdaSoV83SalPEE9rSlJQBfcWUzvFupBCMk PrWj/Hrs5fHmow8TiF5S6AHtpKzcqJgrMAHlu36ApAtvWZ/NwBAfsGU4dV4L88pf7VK9 91Anw3318qWBhw4i0eYWkXf3KdqCXl553iFDa8ak5pK4aRYJ+kufCJiYN2y6YSMdNJYq /rBq0PiZv2jx9eGmL+VgZJLCKay00x1VPSRrVx17IWvbmWl08xkqzr+PwvmDnTun9Can X0Fw== X-Forwarded-Encrypted: i=1; AJvYcCWTYZhPBmJiD1KCMcH1XDZIxBFx7JpIUQzRE7gXdBhCuVvZS2JSanj4sXMjOYHYODcJAVoz0c4T0QOptgi9Wx34ntrhVlqciA== X-Gm-Message-State: AOJu0YycaOm9Y36rt/FZXpoRm87uZ4fun2O9NaQsYSQLdBkuNXl8G5Xs rL8IiNXWtYeC91tg8lzg7o3kFGzuPr84q+SJ084WQFhDjLdComZO X-Google-Smtp-Source: AGHT+IHLxaBgHBSXXfFIIDnULQO1JJTAGHovIChKSTpAYgzJB0zw5t/4a7ZR0NXw4zhKBooOAL4t4g== X-Received: by 2002:a05:600c:a392:b0:420:112e:6c1 with SMTP id 5b1f17b1804b1-420fd2ffca3mr35980525e9.13.1716471911776; Thu, 23 May 2024 06:45:11 -0700 (PDT) From: Leah Neukirchen To: Rich Felker Cc: Collin Funk , musl@lists.openwall.com In-Reply-To: <20240523132117.GZ10433@brightrain.aerifal.cx> (Rich Felker's message of "Thu, 23 May 2024 09:21:17 -0400") References: <625e06f9-10ca-4ad3-86e2-6f6edf585ec9@gmail.com> <20240523132117.GZ10433@brightrain.aerifal.cx> Date: Thu, 23 May 2024 15:45:10 +0200 Message-ID: <87pltc63rt.fsf@vuxu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [musl] getusershell should ignore comments and empty lines. Rich Felker writes: > It says: > > "A hash mark (``#'') indicates the beginning of a comment; > subsequent characters up to the end of the line are not > interpreted by the routines which search the file." > > This isn't very clear whether # is only a comment on the beginning of > a line (after potential whitespace?) or whether # appearing in a line > with a shell pathname is a comment or part of the pathname. If it's a > comment, it's not clear if whitespace before it is part of the shell > pathname -- e.g. does "/bin/sh # best shell" define "/bin/sh" or > "/bin/sh " as the shell pathname? > > It sounds like nobody ever thought about whitespace, quoting, or > rigorous comment syntax here... True: OpenBSD drops the rest of the line with "#" and ignores lines not starting with a "/". glibc drops the rest of the line with "#", elides spaces after the entry, and skips everything before the first "/" (quite bold). pam_shells skips all lines that don't start with a "/" and doesn't handle "#" specially. gnome-terminal just tries to find one line that matches exactly the the shell util-linux skips lines from getusershell that start with "#". Likewise "seunshare". -- Leah Neukirchen https://leahneukirchen.org/