[SLUG] Can't enter a directory after unzipping it

2001-10-24 Thread Simon Wong

I have downloaded the source code for Java Cookbook from O'Reilly
(fabulous book!) but am having strange things happen when I UNZIP the
source.

After unzipping two directories are created in the current directory one
called META-INF and the javacook.

When I 'ls -la' it says that I am the owner and that the group is
correct.  Also the permissions are set OK...


lonewolf: /usr/local/java/books
$ lsa
total 1528
   4 drwxr-sr-x4 sjw  staff4096 Oct 24 23:23 .
   4 drwxr-sr-x4 sjw  staff4096 Oct 24 22:57 ..
   4 drw-r--r--2 sjw  staff4096 Oct 13 19:22
META-INF
   4 drw-r--r--   43 sjw  staff4096 Oct 13 19:21
javacook
1512 -rw-rw-r--1 sjw  staff 1542109 Oct 24 23:14
javacooksrc.zip


But when I try and cd into either of the directories I get an error:

lonewolf: /usr/local/java/books
$ cd javacook
bash: cd: javacook: Permission denied

lonewolf: /usr/local/java/books
$ 

As root I can go into the directories and the contents are all there. 
Also, when I use tab completion it lists the files too.

How do I get into that directory?

Puzzled -(


-- 
*
* Simon Wong*
*   *
* [EMAIL PROTECTED] *
*   *
*


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Can't enter a directory after unzipping it

2001-10-24 Thread Jeff Waugh

quote who=Simon Wong

 4 drw-r--r--   43 sjw  staff4096 Oct 13 19:21 javacook
 
 How do I get into that directory?

  chmod -R a+x javacook

The execute bits on the directory are not set, the result of which is that
no one is allowed to enter it. If you add the execute bit for all, the ls
-la will look like this:

  4 drwxr-xr-x   43 sjw  staff4096 Oct 13 19:21 javacook

Which is what you want. :)

- Jeff

-- 
 What does an underage calf drink?  
  Long Island Iced Teats.   

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Can't enter a directory after unzipping it

2001-10-24 Thread Ben Leslie

On Wed, 24 Oct 2001, Simon Wong wrote:

 I have downloaded the source code for Java Cookbook from O'Reilly
 (fabulous book!) but am having strange things happen when I UNZIP the
 source.
 
 After unzipping two directories are created in the current directory one
 called META-INF and the javacook.
 
 When I 'ls -la' it says that I am the owner and that the group is
 correct.  Also the permissions are set OK...
 
 
 lonewolf: /usr/local/java/books
 $ lsa
 total 1528
4 drwxr-sr-x4 sjw  staff4096 Oct 24 23:23 .
4 drwxr-sr-x4 sjw  staff4096 Oct 24 22:57 ..
4 drw-r--r--2 sjw  staff4096 Oct 13 19:22
 META-INF
4 drw-r--r--   43 sjw  staff4096 Oct 13 19:21
 javacook
 1512 -rw-rw-r--1 sjw  staff 1542109 Oct 24 23:14
 javacooksrc.zip
 
 
 But when I try and cd into either of the directories I get an error:

You need execute permission bit set to be able to change into a directory.

chmod u+x javacook

Benno

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Can't enter a directory after unzipping it

2001-10-24 Thread Jeff Waugh

quote who=Simon Wong

 So, if I only want to change the execute bit on the directories and not
 on any files in there...what tricky command could I use??
 
 I was thinking of using find with -exec chmod but it doesn't look like
 it can only find directories?

Oh, good call. The one I offered was a very casual way of doing it, now I
realise. ;)

  find -type d -exec chmod a+x {} ;

- Jeff

-- 
I'm taking no part in your merry 5-way clusterfuck - sort that mess
 out between yourselves. - Alexander Viro  

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Can't enter a directory after unzipping it

2001-10-24 Thread Simon Wong

On Wed, 2001-10-24 at 23:55, Jeff Waugh wrote:
 
   find -type d -exec chmod a+x {} ;

Cool but you need to escape the ;

Not sure why that is?

Works a treat...the more I learn about Lin/Unix the more I like it :-)

Thanks guys...


-- 
*
* Simon Wong*
*   *
* [EMAIL PROTECTED] *
*   *
*


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Can't enter a directory after unzipping it

2001-10-24 Thread Crossfire

Simon Wong was once rumoured to have said:
 So, if I only want to change the execute bit on the directories and not
 on any files in there...what tricky command could I use??

You can do this using GNU chmod.

chmod -R u+X path

This will tell chmod to set +x on all the directories, or any file
with any execute bit set.

of course, thats specific to GNU chown, and won't work on any other
chown.

 I was thinking of using find with -exec chmod but it doesn't look like
 it can only find directories?

You can find directories using the '-type d' predicate.

C.
-- 
--==--
  Crossfire  | This email was brought to you
  [EMAIL PROTECTED] | on 100% Recycled Electrons
--==--

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Can't enter a directory after unzipping it

2001-10-24 Thread DaZZa

On 24 Oct 2001, Simon Wong wrote:

 lonewolf: /usr/local/java/books
 $ lsa
 total 1528
4 drwxr-sr-x4 sjw  staff4096 Oct 24 23:23 .
4 drwxr-sr-x4 sjw  staff4096 Oct 24 22:57 ..
4 drw-r--r--2 sjw  staff4096 Oct 13 19:22
 META-INF
4 drw-r--r--   43 sjw  staff4096 Oct 13 19:21
 javacook
 1512 -rw-rw-r--1 sjw  staff 1542109 Oct 24 23:14
 javacooksrc.zip


 But when I try and cd into either of the directories I get an error:

 lonewolf: /usr/local/java/books
 $ cd javacook
 bash: cd: javacook: Permission denied

 lonewolf: /usr/local/java/books
 $

For any user except the root user to enter a directory, that user must
have the execute bit set at the relavent permission level {user, group or
other}.

In your case, you have

drw-r--r--   43 sjw  staff  4096 Oct 13 19:21   javacook

Note that in none of the three permission groups is the execute bit set.

To allow access to everyone, you need to do this {as either root or sjw}

chmod 755 javacook

ls -l will then show you

drwxr-xr-x   43 sjw  staff  4096 Oct 13 19:21   javacook

and you'll be able to enter the directory.

DaZZa


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Can't enter a directory after unzipping it

2001-10-24 Thread Matthew Dalton

Simon Wong wrote:
 
 On Wed, 2001-10-24 at 23:55, Jeff Waugh wrote:
 
find -type d -exec chmod a+x {} ;
 
 Cool but you need to escape the ;
 
 Not sure why that is?

The semicolon marks the end of the chmod command. You have to escape it
so bash doesn't interpret it as the end of the find command.



 Works a treat...the more I learn about Lin/Unix the more I like it :-)

That's why it's cool!

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug