Skip to content
Tcl Source Code Artifact [75402df4ef]
Login

Artifact [75402df4ef]

Artifact 75402df4eff3d28470deaa8556f1bd84a053b9ad:

Ticket change [75402df4ef] - New ticket [391bc0fd2cdd5920|391bc0fd2c] <i>glob, -nocomplain, -types, and insufficient privileges</i>. by pooryorick on 2016-11-16 06:27:46.
D 2016-11-16T06:27:46.248
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment When\s<code>glob</code>\sis\sdenied\spermission\sto\sget\sa\sdirectory\slisting,\sthe\r\nresult\sis\san\serror.\s\sThis\sis\strue\seven\swith\s<code>-nocomplain</code>.\s\sHowever,\r\nthere\sis\sa\scircumstance\sunder\swhich\sinability\sto\sreturn\sthe\srequested\sresult\r\ndue\sto\sinsufficient\spermissions\sdoes\snot\sresult\sin\san\serror.\s\sOn\s*nix\r\nplatforms,\sa\suser\smay\shave\sread\spermissions\sbut\snot\sexecute\spermissions\son\sa\r\ndirectory,\swhich\smeans\sthat\sthey\smay\slist\sthe\scontents\sof\sthe\sdirectory,\sbut\r\nnot\sthe\sattributes\sof\sthose\scontents.\s\sIn\sthis\ssituation,\s<code>glob\r\n-nocomplain\s-dir\s/path/to/dir\s-types\sd</code>\sreturns\sthe\sempty\sstring,\ssince\r\nit\slacks\sthe\sability\sto\sget\sthe\sattributes\sof\sthe\sfile\sand\sthus\sdetermine\sits\r\ntype.\s\sBack\sbefore\s<code>glob</code>\shad\sa\s<code>-nocomplain</code>\soption,\r\nthis\sscenario\swas\scovered\sby\sthe\s"empty\slist\sresult\sis\san\serror"\sbehaviour\sof\r\n<code>glob</code>.\s\sThe\sintroduction\sof\s<code>-nocomplain</code>\smay\shave\r\ninadvertently\slead\sto\sthis\scurrent\sbehaviour,\swhere\sinability\sto\scomplete\sthe\r\noperation\sdue\sto\sinsufficient\spermissions\sended\sup\snot\sbeing\san\serror.\r\n\r\nAnother\sfacet\sof\sthis\sissue\sis\sthat\s<code>-types\shidden</code>\salso\sreturns\san\r\nempty\sstring,\seven\sthough\son\s*nix,\sthat\sinformation\sis\scontained\sin\sthe\s"."\r\ncharacter\sprefixing\sthe\sname.\r\n\r\nBecause\sof\sthis\sbehaviour,\sthe\ssimple\stask\sof\swalking\sa\shierarchy\sof\sfiles,\r\nmodifying\sthem\sas\sneeded\sin\sorder\sto\scontinue\sthe\swalk,\sbecomes\srather\scomplex:\r\n<code>-types</code>\scan't\sbe\sused\sat\sall,\shidden\sfiles\shave\sto\sbe\sexplicitly\r\nmatched\son\s*nix\ssystems,\sand\ssomething\slike\s<code>file\stype</code>,\swhich\r\n*does*\sraise\san\serror,\smust\sbe\sused\sinstead\sin\sorder\sto\sraise\sthe\salert\sthat\r\nthere\sis\sa\spotential\spermissions\sproblem.
J foundin 8.6.6
J is_private 0
J login pooryorick
J priority 5\sMedium
J private_contact e476148cded301ffff84bcdc432536dc0c949e88
J resolution None
J severity Minor
J status Open
J submitter pooryorick
J subsystem 16.\sCommands\sA-H
J title glob,\s-nocomplain,\s-types,\sand\sinsufficient\sprivileges
J type Bug
K 391bc0fd2cdd59209201660b95a2d886d24c1825
U pooryorick
Z 8dce428d9e0e134b94aef1fb4af075a3