9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] chdir to mode 000 directory
@ 2004-06-03  1:58 YAMANASHI Takeshi
  2004-06-03  5:49 ` lucio
  0 siblings, 1 reply; 6+ messages in thread
From: YAMANASHI Takeshi @ 2004-06-03  1:58 UTC (permalink / raw)
  To: 9fans

Clearly, I'm missing something..., but how do I interpret
this behaviour?

% mkdir dir
% chmod 000 dir
% ls -ld dir
d---------- M 9 nashi nashi 0 Jun  3 10:51 dir
% cd dir
%  __chdir succeeds!__
% pwd
pwd: permission denied
-- 




^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [9fans] chdir to mode 000 directory
@ 2004-06-03  6:01 YAMANASHI Takeshi
  2004-06-03  6:19 ` lucio
  0 siblings, 1 reply; 6+ messages in thread
From: YAMANASHI Takeshi @ 2004-06-03  6:01 UTC (permalink / raw)
  To: 9fans

> > % ls -ld dir
> > d---------- M 9 nashi nashi 0 Jun  3 10:51 dir
> > % cd dir
> > %  __chdir succeeds!__
 :
> The semantics of directory permissions are different: you can walk to
> a directory without permission,

Thank you.  My confusion is cleared now.  So when I want to
check if a process can chdir to a directory, the following
fragment is good enough?

	if(access("/usr/hoge/adir", AREAD) < 0){
		// error, can't chdir to adir
			:
	}


I thought the following should work at first, hence my question.
	if(chdir("/usr/hoge/adir") < 0){
		// error, can't chdir to adir
			:
	}
-- 




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-06-06  7:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-03  1:58 [9fans] chdir to mode 000 directory YAMANASHI Takeshi
2004-06-03  5:49 ` lucio
2004-06-03  6:01 YAMANASHI Takeshi
2004-06-03  6:19 ` lucio
2004-06-06  7:10   ` YAMANASHI Takeshi
2004-06-06  7:33     ` Rob Pike

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).