Two Laptop Bag*
The moose likes Linux / UNIX and the fly likes RPM wont create directory correctly -rwxrwxrwx vs drwxrwxrwx Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "RPM wont create directory correctly -rwxrwxrwx vs drwxrwxrwx" Watch "RPM wont create directory correctly -rwxrwxrwx vs drwxrwxrwx" New topic
Author

RPM wont create directory correctly -rwxrwxrwx vs drwxrwxrwx

John Lark
Ranch Hand

Joined: Feb 08, 2010
Posts: 72
Hey Everyone,

I am modifying an RPM that previously ran in 32 bit Centos to 64 bit Centos. Previously I would create a folder i386 (drwxrwxrwx) and write a couple files to it. This worked fine, then I changed the name of the folder I was creating to x86_64, and when I attempt to write to it I receive an error informing me its not a directory. When I do an ls -al I get -rwxrwxrwx... however I am using the same line syntax "mkdir -p %{_topdir}/RPMS/x86_64 or /i386" Is this related to the underscore? Is their a way to compensate here? I feel like this shouldn't be an issue. Also as a side NOTE before the Linux gurus freak out I am not a actually using rwxrwxrwx it just to hopefully better illustrates that the d is missing.

Thanks guys!
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1505
    
    5

John Lark wrote:Hey Everyone,

I am modifying an RPM that previously ran in 32 bit Centos to 64 bit Centos. Previously I would create a folder i386 (drwxrwxrwx) and write a couple files to it. This worked fine, then I changed the name of the folder I was creating to x86_64, and when I attempt to write to it I receive an error informing me its not a directory. When I do an ls -al I get -rwxrwxrwx... however I am using the same line syntax "mkdir -p %{_topdir}/RPMS/x86_64 or /i386" Is this related to the underscore? Is their a way to compensate here? I feel like this shouldn't be an issue. Also as a side NOTE before the Linux gurus freak out I am not a actually using rwxrwxrwx it just to hopefully better illustrates that the d is missing.

Thanks guys!


I know my answer might not be helpful (as I'm not into creating own RPMs etc.) - but just check out if there is any space in the path.
e.g. would create a RPMS dir, and inside that a x86_64 dir. However, would create two dirs (RPMS and x86_64) at same level. Further, if you copy something at RPMS/x86_64, then a file x86_64 would be created.

Besides this, the underscore should not create any issue. It is a valid filename/dirname character.

This is a very wild guess. Btw, I'm not a Linux guru, but that 777 permission thing got freaked me out


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

I'm a cynic, so I'd be looking at whether there are selinux issues showing up in the audit log.

However, you are apparently creating directories programmatically in the RPM, and for the most part I'd just use a file specifier to do that. Then again, since you're doing a mkdir and the result is listing as a file, maybe you did provide a (incorrect) file specifier and it interfered with the script doing the mkdir.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 867
    
    5
What is Umask?
 
 
subject: RPM wont create directory correctly -rwxrwxrwx vs drwxrwxrwx