[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] WTF: Rettigheder



"Michael Schmidt" <sslug@sslug> writes:

> Hvis man kalder ls uden parameter defaulter den så til '.' ?
> - Og derfor ikke viser indhold af den folder man står i.

Det gør den. 

Jeg kan iøvrigt anbefale at lege lidt med strace, hvis man er
nysgerig. Den skriver alle de systemkald en process foretager
sig. Udfører man foreksempel kaldet

  sslug@sslug:/tmp/foobar$ LC_ALL=C strace ls

slutter den af med at skrive

  [...]
  open(".", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)
  write(2, "ls: "..., 4ls: )                  = 4
  write(2, "cannot open directory ."..., 23cannot open directory .) = 23
  write(2, ": Permission denied"..., 19: Permission denied)  = 19
  write(2, "\n"..., 1 )                    = 1
  close(1)                                = 0
  close(2)                                = 0
  exit_group(2)                           = ?
  sslug@sslug:/tmp/foobar$ 

heraf kan man se at den prøver at åbne '.' og får en 'adgang
nægtet'-fejl. Jeg sætter lige LC_ALL til 'C' for at undgå at den
bruger en masse systemkald for at finde en korrekt oversat udgave af
fejlbeskeden (som alligevel er engelsk på mit system).

Det tager nok noget tid at kunen gennemskue alt hvad strace fortæller
en, men ofte er det ret lærerigt og manualsiderne hjælper en en del på
vej. ltrace kan ligeledes anbefales, den gør noget tilsvarende på en
lidt højere abstraktionsniveau og (imho) ikke helt så brugbart ved den
slags fejl der afhænger af returværdier.

//Makholm


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2009-07-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *