On 2018/06/28 08:52, Martijn van Duren wrote:
> - If realpath fails the content of resolved is undefined, so why waste
> cycles setting it to ".". If anyone thinks we should return something
> sensible I reckon we should make it an empty string.

Not sure if it's important or not, but if someone ignores the failure
and uses the result anyway (for example perhaps appending "/something"
to the string), "." seems less likely to cause problems than an empty
string would.

One area where this might possibly be triggered is if the user doesn't
have permissions on the current directory (sometimes I've had problems
in this area where rc scripts leave cwd as /root but it's mode 700 and
a uid change has rendered it unreadable by that uid).

If you want to look at users in ports to see what sort of checks they
do, here's a starter ..

$ grep -lwR realpath ~sthen/ports-nm/ | cut -d/ -f6- | sort
archivers/gshar+gunshar
archivers/unshield
audio/cdparanoia
audio/deadbeef
audio/libcdio
audio/mt-daapd
audio/pulseaudio
audio/squeezelite
audio/xmms2
cad/gerbv
cad/gtkwave
cad/ngspice
cad/pcb
comms/gammu
comms/kermit
comms/pilot-link
converters/dos2unix
databases/evolution-data-server
databases/kyotocabinet
databases/mariadb,-main
databases/strigi
databases/tokyocabinet
devel/appstream-glib
devel/arm-elf/binutils
devel/arm-elf/gdb
devel/arm-none-eabi/binutils,aarch64
devel/arm-none-eabi/binutils,arm
devel/arm-none-eabi/gdb
devel/autogen
devel/avr/binutils
devel/avr/gcc
devel/avr/gdb
devel/avr32/binutils
devel/avr32/gcc
devel/avr32/gcc-bootstrap
devel/ccache
devel/cmake
devel/commoncpp
devel/cppcheck
devel/distcc,-gtk
devel/dlib
devel/gas
devel/gdb
devel/geany
devel/git,-main
devel/gmake
devel/gobject-introspection
devel/hs-system-fileio
devel/jdk/1.8,-main
devel/keystone
devel/kf5/kdelibs4support
devel/libgit2/libgit2
devel/libuv
devel/luaposix
devel/luaposix,lua52
devel/luaposix,lua53
devel/mercurial,-main
devel/msp430/binutils
devel/msp430/gcc
devel/msp430/gdb
devel/nasm
devel/openmpi
devel/openocd
devel/physfs
devel/radare2/main
devel/swig
devel/xtensa-elf/binutils
devel/xtensa-elf/gcc
editors/ht
editors/ht,no_x11
editors/tea
editors/tpad
editors/vile
editors/xemacs21/stable
editors/xemacs21/stable,mule
emulators/ppsspp
emulators/qemu
emulators/retroarch
emulators/stella
emulators/ucon64
games/0ad/base
games/dhewm3
games/gcompris
games/manaplus
games/megaglest/base
games/minetest
games/openrct2
games/supertuxkart
games/tome4,-data
games/warmux
games/xbubble
games/xcowsay
geo/viking
graphics/darktable
graphics/feh
graphics/gdcm
graphics/gegl,-main
graphics/gegl03
graphics/gracula
graphics/grafx2
graphics/hugin
graphics/jpegoptim
graphics/opencv,-main
graphics/openscenegraph
graphics/pqiv
graphics/qiv
graphics/shotwell
graphics/simgear
graphics/sxiv
java/tanukiwrapper
lang/apl
lang/bacon
lang/clisp
lang/gcc/4.9,-main
lang/ghc
lang/gprolog
lang/iverilog
lang/jimtcl
lang/librep
lang/moarvm
lang/newlisp
lang/node
lang/python/2.7,-main
lang/python/3.6,-main
lang/sbcl
lang/squeak/vm
lang/tcl/8.5
lang/tcl/8.6
lang/vala,-main
lang/vala,-valadoc
lang/verilator
mail/alpine,-c-client
mail/dovecot-pigeonhole
mail/exim,-eximon
mail/exim,-main
mail/exim,-main,mysql,postgresql,ldap
mail/geary
mail/kopano/core,-main
mail/mailest
mail/mozilla-thunderbird,-main
mail/mu
mail/mutt
mail/mutt,gpgme
mail/mutt,gpgme,sasl
mail/mutt,sasl
mail/mutt,sasl,slang
mail/neomutt
mail/neomutt,gpgme
mail/neomutt,gpgme,sasl
mail/neomutt,sasl
mail/opendkim
mail/rmilter
mail/rspamd
mail/s-nail
math/R
math/hdf5
misc/dvtm
misc/mc
misc/rpm
multimedia/assimp
multimedia/dvdstyler
multimedia/minidlna
multimedia/mjpegtools
multimedia/mjpegtools,quicktime
multimedia/vitunes
net/argus-clients
net/cvsync
net/epic4
net/gdnsd
net/icinga/core2,-main
net/isc-dhcp,-client
net/knot
net/netatalk
net/netatalk,avahi
net/netatalk3
net/ntopng
net/ntp
net/ocserv
net/pmacct
net/pmacct,mysql
net/pmacct,postgresql
net/pure-ftpd
net/pure-ftpd,ldap
net/pure-ftpd,ldap,virtual_chroot
net/pure-ftpd,mysql
net/pure-ftpd,mysql,virtual_chroot
net/pure-ftpd,postgresql
net/pure-ftpd,postgresql,virtual_chroot
net/pure-ftpd,virtual_chroot
net/quagga
net/rrdtool,-main
net/samba,-ldb
net/tcpreplay
net/transmission,-gtk
net/weechat,-lua
net/weex
news/yencode
print/lyx
print/texlive/base
productivity/grisbi
productivity/workrave
security/foremost
security/gnutls
security/gringotts
security/kc
security/openpam
security/ssdeep
security/ssh-ldap-helper
security/sslsplit
security/stunnel
shells/bash
shells/fish
shells/ksh93
shells/zsh
sysutils/apachetop
sysutils/coreutils
sysutils/curlftpfs
sysutils/gkrellm/plugins/volume
sysutils/iogen
sysutils/libstatgrab
sysutils/lsyncd
sysutils/monit
sysutils/multitail
sysutils/noice
sysutils/ntfs-3g
sysutils/nut,-main
sysutils/radmind
sysutils/rpl
sysutils/simple-mtpfs
sysutils/symon,-main
sysutils/syslog-ng
sysutils/tarsnap
sysutils/tmate
sysutils/torture
telephony/asterisk,-calendar
telephony/asterisk,-main
textproc/clucene
textproc/groff
textproc/hyperestraier
textproc/jq
textproc/opensp
textproc/pdfpc
textproc/the_silver_searcher
textproc/wkhtmltopdf
textproc/xerces-c
www/analog
www/cgit
www/firefox-esr
www/goaccess
www/netsurf/browser
www/netsurf/netsurf-fb
www/nginx,-geoip
www/phantomjs
www/ruby-passenger,ruby23
www/ruby-passenger,ruby24
www/seamonkey,-main
www/stagit
www/surf
www/tor-browser/browser
www/webkitgtk4
www/wml
x11/e17/ecore
x11/e17/edje
x11/e17/efreet
x11/e17/eina
x11/e17/evas
x11/emelfm2
x11/gnome/libgnomeui
x11/gnome/librsvg
x11/gnustep/base
x11/irrlicht
x11/kde/accessibility3
x11/kde/base3,-en_US
x11/kde/libs3,-main
x11/kde4/jovie
x11/kde4/juk
x11/kde4/libs,-main
x11/kde4/okular
x11/mowitz
x11/nx/nxssh
x11/qt3,-main
x11/qt4,-main
x11/qt5/qt3d,-examples
x11/qt5/qtbase,-main
x11/rox-filer
x11/tint2
x11/windowmaker,-main
x11/worker
x11/xarchive
x11/xscreensaver

Reply via email to