mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: _PATH_LASTLOG
Date: Tue, 3 Dec 2013 14:54:33 -0500	[thread overview]
Message-ID: <20131203195433.GM24286@brightrain.aerifal.cx> (raw)
In-Reply-To: <CACCP0Gr8v88Ag7_L8xJTf2mhPUzkpj5ofhA+cVYjFbTNhnct+w@mail.gmail.com>

On Tue, Dec 03, 2013 at 07:09:05PM +0000, Raphael Cohn wrote:
> Ta.
> 
> Would it be possible to have the "/dev/null/xxx" paths' values as an option
> to ./configure?
> 
> Actually, it would be very useful to be able to ./configure all the other
> hard coded paths in musl, eg the default dynamlic linker search path. When
> running with a setup like Nixos, or the like, these paths need to be
> different. Of course, one can patch, but that's not sustainable in the long
> run.

The dynamic linker searches for its path file relative to its own
location, which should cover this kind of usage. It's only in the case
where no path file exists that the hard-coded /lib, /usr/lib, etc.
would get searched.

> Please?

I think such a request should be accompanied by explanations of what
you're trying to achieve that's difficult or impossible with the
current scheme.

Most of the hard-coded paths in musl are hard-coded because there's a
standard pathname either required by the standards or that was
universal in all historical systems, and because musl aims to be
useful for producing "run anywhere" static binaries. Gratuitously
changing paths defeats this goal. Of course musl attempts to minimize
the number of hard-coded pathnames anyway; here's a list from the
current documentation draft which you could review to determine which
are problematic to your intended usage cases:

----------------------------------------------------------------------
* `/dev/null` - device node, required by POSIX

* `/dev/tty` - device node, required by POSIX

* `/tmp` - required by POSIX to exist as a directory, and used by
  various temporary file creation functions.

* `/bin/sh` - an executable file providing a POSIX-conforming shell

* `/proc` - must be a mount point for Linux procfs or a symlink to
  such. Several functions such as realpath, fexecve, and a number of
  the "at" functions added in POSIX 2008 need access to /proc to
  function correctly.

While some programs may operate correctly even without some or all of
the above, musl's behavior in their absence is unspecified.

### Additional Pathnames Used

* `/dev/log` - a UNIX domain socket to which the `syslog()` interface
  sends log messages. If absent or inaccessible, log messages will be
  discarded.

* `/dev/shm` - a directory; should have permissions 01777. If absent,
  POSIX shared memory and named semaphore interfaces will fail;
  programs not using these features will be unaffected.

* `/dev/ptmx` and `/dev/pts` - device node and devpts filesystem mount
  point, respectively. If absent or inaccessible, `posix_openpt()` and
  `openpty()` will fail.

* `/etc/passwd` and `/etc/group` - text files containing the user and
  group databases, mappings between names and numeric ids, and group
  membership lists, in the standard traditional format. If absent,
  user and/or group lookups will fail.

* `/etc/shadow` - text file containing shadow password hashes for some
  or all users.

* `/etc/resolv.conf` - text file providing addresses of nameservers to
  be used for DNS lookups. If absent, DNS requests will be sent to the
  loopback address and will fail unless the host has its own
  nameserver.

* `/etc/hosts` - text file mapping hostnames to IP addresses.

* `/etc/services` - text file mapping network service names to port
  numbers.

* `/usr/share/zoneinfo`, `/share/zoneinfo`, and `/etc/zoneinfo` -
  directories searched for time zone files when the `TZ` environment
  variable is set to a relative pathname.

* `../etc/ld-musl-$(ARCH).path`, taken relative to the location of the
  "program interpreter" specified in the program's headers - if
  present, this will be processed as a text file containing the shared
  library search path, with components delimited by newlines or
  colons. If absent, a default path of
  `"/lib:/usr/local/lib:/usr/lib"` will be used. Not used by
  static-linked programs.
----------------------------------------------------------------------

Let me know. This may end up being an ugly issue but it's something we
should look at, in any case...

Rich


  reply	other threads:[~2013-12-03 19:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 17:44 _PATH_LASTLOG Raphael Cohn
2013-12-03 18:42 ` _PATH_LASTLOG Szabolcs Nagy
2013-12-03 19:09   ` _PATH_LASTLOG Raphael Cohn
2013-12-03 19:54     ` Rich Felker [this message]
2013-12-03 20:10       ` _PATH_LASTLOG Raphael Cohn
2013-12-03 20:25         ` _PATH_LASTLOG Rich Felker
2013-12-03 20:44           ` _PATH_LASTLOG Laurent Bercot
2013-12-03 20:51             ` _PATH_LASTLOG Raphael Cohn
2013-12-03 21:00               ` _PATH_LASTLOG Nathan McSween
2013-12-03 21:05                 ` _PATH_LASTLOG Raphael Cohn
2013-12-03 21:42                 ` _PATH_LASTLOG Rich Felker
2013-12-03 21:38             ` _PATH_LASTLOG Rich Felker
2013-12-03 20:49           ` _PATH_LASTLOG Raphael Cohn
2013-12-03 20:51         ` _PATH_LASTLOG Laurent Bercot
2013-12-03 20:52           ` _PATH_LASTLOG Raphael Cohn
2013-12-03 19:34 ` _PATH_LASTLOG Rich Felker
2013-12-03 19:50   ` _PATH_LASTLOG Raphael Cohn
2013-12-03 20:03     ` _PATH_LASTLOG Laurent Bercot
2013-12-03 20:11       ` _PATH_LASTLOG Raphael Cohn
2013-12-03 20:06     ` _PATH_LASTLOG Rich Felker
2013-12-03 20:18       ` _PATH_LASTLOG Raphael Cohn
2013-12-03 20:30         ` _PATH_LASTLOG Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131203195433.GM24286@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).