jedipi
Jul 23 2005, 12:02 PM
| | The following is the content of my test.cgi. Permission is 777,
CODE #!/usr/bin/perl print "Content-type: text/plain\n\n"; $ss="/home";
if (opendir(DIR, $ss)){ print "open $ss ok\n"; } else { print "fail open $ss !\n"; }
after run this scripte, the result is : fail open /home !
It works if I change the value of $ss from /home to /tmp.
Why does it not work when the value of $ss is /home?? How can I make it work for /home directory??
Please help. Thank you. |
Reply
Quatrux
Jul 23 2005, 08:51 PM
maybe your home directory permissions are not readable or the dir belongs to root or something ? try to connect to ftp thru php and open the dir, more about it here: ftp connectoh darn only now i remember that your script is an cgi/perl script, anyway if you include a php file thru cgi the server will stil parse it. CODE <!--#include virtual="/open.php" -->
<!-- -->
anyway, i don't know much of this language, maybe you have something native 
Reply
jedipi
Jul 24 2005, 03:22 PM
I did a test on RHEL, but fail. It is the same problem. /home directory cannot be accessed. But why???  Even the permission is set to 777. It just does not work. is it anything to do with the setting of apache??? I did not change any setting of my apache server. Default setting is used.
Reply
qwijibow
Jul 25 2005, 12:56 PM
I assume you are using the perl script through a web server, possably apache ??? for securety, apache runs as user "nobody" for securety reasons. nobody doesnt have a /home and so does not have access. this prevents a compromised web server getting access to usernames (stored in /home) nobody DOES have access to /tmp however. you chould change the access rightas to /home, but i would not recomend this. just re-think whatever you are trying to accumplish, and re-design it to work more securely.
Reply
jedipi
Jul 26 2005, 03:51 PM
After a few day, the problem was fixed finally. My friend just tell me to disable SELINUX. After SELINUX is disable, the test script runs well. to qwijibow: you are quite right. I should design my script to work more securely. However, I just started to learn perl about two weeks ago. I will spend more time on it. Thanks for your help.
Reply
mastercomputers
Jul 27 2005, 08:40 AM
I've written a guide on making SELinux co-operate with Apache, it's not really a good idea to disable SELinux so I looked for a method to work with this. You'll want to look up the "chcon" command (change security context) and you may want to use "ls -Z" to display what you need altered or to show you if it's correct. chcon -t httpd_sys_content_t -R $HOME/public_html Say in your /home/UserName/ directory you have a directory called public_html, this command issued above, will make all directories, sub-directories and files all allow access for httpd (apache) to be able use public_html as we specifically made it contain system content that apache is allowed to view. httpd_sys_exec_script_t should be set on all cgi/perl scripts as well as the cgi-bin directory. Have a look at This Post for more information and better ways of setting permissions on your directories. There could be more of these httpd_sys_ prefixed contexts, but the top two are the most common and most likely ones you'll ever need, I've not used any other context than these two on my own personal servers. This should hopefully get you comfortable with SELinux. Cheers, MC
Reply
Similar Topics
Keywords : strange, opendir, problem, work, home, directory
- Computer Freezing Problem
solutions to pc freezing (8)
Non-destructive Recovery Xp-home
(4) Hi I'm new and can't find this question anywhere and if it is redundant...please let me know
where to go to see it already asked! I'm trying to find my internet settings after doing a
non-destructive recovery on win xp....Thanx in advance for any and all help and direction, Suxie....
Domain Transfers
How do they work? (3) Aside from the fact that I'm planning on transferring a domain of mine to Xisto at some point,
I'm curious as to how the actual process works. $9.99/year for a new domain or a transferred
domain implies to me that regardless of which I do, I get a year from scratch with the domain I
choose. What's the actual process in transferring a domain, and what sort of information would
Xisto need? Currently I'm lacking the earnings to do it, and I haven't got my hosting plan
for it sorted yet, but assuming that I intend to get around to it at some point soonish....
System Is Crashed - Hardware Problem
Precaution (3) Dear all, i am working on my IBM Thinkpad R52, for internet i am using airtel card, and windows XP2
with other software also, what i have problem when i dial for connect to internet, my screen is
blank, i reboot the system and system is working fine, after some time again this problem is come my
screen is blank. it may be work fine whole day or it may blank after sometime , i solve this again
by restarting my laptop but my data each time lost, when without airtel card to internet system is
working fine, no any type of error is came, but it is my need that i serf net so ....
Problem Setting Up Wireless Internet & Wireless Nintendo Wii
Need some help installing/configuring Wireless (4) Hi all, I am having quite some troubling issues with my wireless setup (to be setup *more like
it*). Current hardware: 1. NETGEAR ProSafe 802.11g Wireless Access Point WG102 2. Telkom Wireless
Router / Switch 3. Nintendo Wii (Wireless) 4. IBM Thinkpad T42 (Wireless) 5. Desktop PC With NIC
The current setup *See attached picture* "Setup" So I have a 3G card working through PCMCIA on my
T42 Thinkpad, which I use for internet connectivity. I want to share my internet connection
throughout my house.. to my desktop PC + Nintendo Wii... I have tried setting it up myself, ....
Hard To Work With Spyware
(5) I have a virus or a sort which disallows me to open the following things. .exe's / .lnk's I
cannot even open my nortan and that didn't even detect it. I need major help. My OS is Windows
XP Professional.....
Graphics Driver Out...
Devie Usage problem... (2) So I was playing around with properties. I went to Desktop > Right click > properties > settings >
advanced > adapter > properties and on the devie usage thing, I "accidentally" clicked disable..
Now I think that my graphics driver is not properly functioning... Can anyone help me? Thanks in
advance.........
Pc Problem
(8) i have a problem with my PC... when i start a game (FABLE:TLC or shaiya) something starts working
very fast and louder in my case and the PC shuts down immediately(sometimes) and sometimes i can
just play the game normally.... when i place my hand over graphics card (Geforce 9600 galaxy) it is
not very hot..its normal...do u understand?....
Undoing The Privacy Option On A Folder In Win Xp Home
(3) Hi all, I have an interesting problem I hope someone can help me with. I had a hard drive that had
Win XP Home on it decide to not boot up & figured it was just dead, so I bought another hard drive.
Installed Win XP Home on that one & just for giggles hooked up the other hard drive to see if I
could save any data from it. I was surprised to find I could see my husband's info on his side,
but on my side (which was also the computer admin) I couldn't see any of my data. Whenever I
would click on my folder it would give me an access denied message. Also I look....
Type Checking Not Work On For .. In Loop
Flash 8 - actionscript 2.0 (2) It seems that the actionscript 2.0 type checking was not work as expected on some place. When
variables was created on for .. in loop. It will allow any variable type to be used. Or it is
default construt !? CODE var dayNames1:Array = ; for (var dayName:String in dayNames1) {
trace(dayNames1 ); trace(typeof(dayNames1 )); } CODE 5 number Tuesday string Monday
string Sunday string ....
Problem With Div's In Ie6 And Lower
(4) I'm working on a template for joomla, but I'm heaving some serious problems to get it
working in IE6 and lower. Basically, this is my layout: CODE
-------------------------------------------------------------------------------------
| |
| | header
| | | -----------------------------------------------------------------
| | | ....
Cpu Upgrade But It Doesn't Work
(11) Okay, so, here's the deal. The guy who originally installed my old CPU installed it in a manner
that the fan on top of it melted off any product numbers and all that. All I know is that the place
it hooks into says mPGA478B. It was originally a Celeron. Well, when taking it out, the pins were
bent, so I needed to buy a new one. I went online to find one, searched the mPGA478B thing, cross
referenced it with the Dell, it said everything was a-okay. BUT, once I received it, it didn't
work. The new one is an Intel Pentium 4, Northwood Core 478 Socket with spe....
Choice Of Motherboard For Linux Virtualization
Who knows which ones work well? (5) Virtualization is a relatively arcane subject, but it is one which is very rapidly growing, and
apparently very "hot" in commercial enterprises. For the hobbyist with multiple computers (I have
8), it offers the possibility of taking snapshots of running, fully configured applications and
operating systems, and transferring some or all of them onto a single computer platform. First, it
saves energy. Second, once the conversion has been made from real hardware to a virtual "guest,"
the driver problems associated with moving from one hardware platform to another are sol....
Explorer Does Not Run
experiencing the following with XP Home Ed. (9) Has anyone ever experienced or came across a PC who's Exploer and Internet Explorer was not
working? Well mine is going through that right now. When the PC boots up it loads after the logon
screen - all i see the the desktop background with no icons or taskbar. I can do the Ctrl + Alt +
Delete to start tasks. I've tried the following the remedy the situation. Safemode.... Nope
Boot back normal- Boot to last good known config -- no luck System restore - no restore points to
fall back to (I saw some at first, but didn't think I'd think this was going to be....
Strange Error When Trying To Install Fedora Core 9
(6) Hi all, I tried to install Fedora Core 9 in a VmWare virtual machine under WinXP. I downloaded the
DVD ISO image and proceeded with the installation. When the process was started since about a
minute, the following error did show: "The file evince-2.22.1.1-1.fc9.i386.rpm cannot be opened.
This is due to a missing file, a corrupt package or corrupt media" Fine, I told to myself,
let's download the ISO image again, this time from a different server, just in case. No joy,
same error. Tried another couple of times, each one using a different server for the download. Sa....
I6networks....does Not Work!
(4) This hosting site (i6networks.com)should be avoided at all costs ,its a big waste of time.......
They send the confirmation email four days late (and it is supposed to be "automated") And heres
exactly what they send QUOTE === Please print for future reference === 2008/02/16
Congratulations! Your web hosting account is ready! This e-mail contains basic setup instructions
and details on the features of your hosting package. For more information you can always reference
our online customer support area at: http://www.i6networks.com/support.shtml ---------------....
Comment For My Work
(10) Comment for my work please: I used photoshop to edit this one ....
Theme Hospital Cheats Don't Work
(10) QUOTE Cheat Mode - To enter the cheat mode, press 2,4,3,2,8, on the fax machine. Extra $10,000 -
While in cheat mode, press + C together. I tried that and a few others but nothing happens.
It's Xp.....
Problem With Drag And Drop (or So It Seems).
(12) I'm running on Windows XP with Service Pack 1. The last few days, all of a sudden, the drag and
drop functionality of explorer (or anything on the operating system that uses system calls in order
to perform it) screws up completely. I attempt to drag it, and it just flickers a bit to the
direciton I'm moving it and then fails. It doesn't seem to be the mouse as I can still drag
a rectangle selection to select multiple files etc, just no drag and drop. However, it isn't
always like that, it works generally (as far as I know) and stop working out of now....
Frustrating Problem With XP On Laptop
(20) I have my Dualcore AMD Acer laptop, 5102Wlmi, with a 120GB hd, 2 GB ram, etc. I had a friend buy it
in the states and bring it over just 2 months ago. All of a sudden, the other day when i went to
turn it on, it would bring up the xp boot screen, and then just hang there. I tried a different hard
drive. no luck. I tired installing XP, but after booting from cd and loading all the drivers, right
after the FAT and NTFS drivers, it says "Setup is loading Windows" and then it hangs there. I've
left it overnight and in the morning it's still in the same place. I can....
Spam Problem On My Forums
(26) I’m starting to have a real problem in my forums. Apparently “midget anal porn” is the hottest new
thing. I didn’t think midgets were into that kind of thing but apparently I’m wrong (apologies to
any midgets out there). I knew that spam may be a problem on my board but I didn’t think that I
would be a target just yet. I only have 16 registered users (including the spam bots). How in the
world did they find me? Just like junk mail I figure this problem is only going to get worst since
I am now apparently on the list. Does anyone have a solution to this problem? I....
Blue Screen - irql_not_less_or_equal
computer OS Windows problem booting (35) Hi , My computer AMD64 256mb RAM / 80GB HDD / Windows XP Professional recently started showing a
blue screen while starting .. QUOTE A problem has been detected and windows has been shut down
to prevent further damage to your computer . IRQL_NOT_LESS_OR_EQUAL (blah blah blah ... )
Technical Information: *** STOP: 0x0000000A (oxFB07D354, ox000000FF, ox00000001, ox804E2E41)
Initially, if I restarted it would not come the next time. It used to come only randomly. But
later it started coming more often, and now it did not start for quite a few times con....
Photoshop Cropping Problem
(7) All right. For most of my Photoshop work, I use Photoshop 6.0. Yes, I know it's old, but it
gets the job done, not to mention I just don't have the money of Photoshop CS or Photoshop CS2
right now. But I'm getting off topic. Anyways, a few months ago, when I went to crop a
picture, it wouldn't crop all the way. It would crop to a certain point and then just stop and
refused to go any further with the cropping box. It seems to only form squares and sometimes
horizontal rectangles, but only to a certain extent. However, when I opened Adobe Photosho....
Einstein Quiz
Can you solve this problem? (30) Hi everybody; I want to ask the quiz written by Einstein last century.It is called Einstein's
Riddle.Einstein said that 98% of the people in the world cannot solve his riddle. Are you among the
other 2%?(Hint:It is really easy:) Hints: 1: There are 5 houses in 5 different colors 2: In each
house lives a person with a different nationality. 3: These 5 owners drink a certain beverage, smoke
a certain brand of cigar and keep a certain pet. 4: No owners have the same pet, smoke the same
brand of cigar or drink the same drink. Further Details: a: The Brit lives in a re....
Problem Accessing My Cpanel
[solved] (9) Don't know if I'm in the right subforum for asking that question. But I really have a
strange problem. Since a few days I started not to be able to access my cpanel with Internet
Explorer. I keep getting 504 or 503 errors (remote page not available or not found). It's not
due to astahost because I can reach my cpanel from my office's computer. Only home I cannot !
Unfortunately, it's the place where I should use it. It behaves as if the 2082 service port was
unavailable. Is there something in IE6 settings (under XP) preventing my PC to open something....
ATI Video Card Problem! Need Help
(7) Ok here is my problem. On a somewhat regular basis I get the following error listed on the BSOD:
ati2dvag.dll stopped responding if this is the first time this has happened restart your computer,
if not then contact the hardware manufacturer. Well I thought it might just be a driver error so I
updated my ATI drivers to the latest but the problem still ensued. I then went to the web and found
that others have had this problem and corrected it by changing the CPU to AGP controller to a PCI to
PCI bridge, I did this but found that I had a major hit to my ingame video pr....
Plasma Effect In Photoshop
Done in CS, but should work in other ver (7) This is a tutorial to create a plasma background effect. We are trying to get with a few filters.
Step 1) Press 'D' to reset your colours, choose linear gradient, uncheck all bozes, black
to white, and go crazy. Step 2)Do a wave filter (filter>distort>wave) and hit randomize a few
times. Step 3)Press ctrl+j(duplicate layer) and repeat step 2 on the duplicated layer. Set layer
belnding mode to lighten. Step 4)Repeat steps 2-3 once. Step 5)Press ctrl+u, check colorize, and
change colour! Congratulations, now you're done!....
MSN Help
Problem (5) I have a problem with MSN search, I was under the impression that it followed link on my site, but
for some reason it is finding pages that don't exsist on my forums, or really wierd ones, it
hasn't read any posts, it just checks the login and registration pages and all sorts of wierd
things... I am sure that the group that the bots are treated as have acess to the forums to read
them, but they still don't check posts, it just comes every day and see's if my users
long-in differently now... /laugh.gif' border='0' style='vertical-align:middle' alt='laugh....
Ip Problem
...With Halo Trial (8) I'm having IP problems when I host a Halo multiplayer game online. The problem is that Halo
uses my network IP and I need it to use my computer's real IP. Is there a patch for this? If
so, I need it. I'm sure that many other people have this problem too, because many people have
home networks. Thanks, technick2....
Help! Problem With My Flash-Drive
Sh17 happens .. (2) Story :: A was installing WinXP on PC B's Flash Drive (FD) was in the USB Slot. While the
WindowsXP Setup is partitioning, 'A' realised that the light on the FD was blinking ..
indicating activity so he plucked it out immediately. Now 'B's FD is corrupted .. I
recovered almost all the data from the corrupted FD using Ontrack's EasyRecovery 6.0 .. It is
the most amazing software ever developed .. it could virtually recover all data in a drive that had
been formatted .. Alright .. now is the headache .. there is no way that I could get the drive ....
Looking for strange, opendir, problem, work, home, directory
|
*SIMILAR VIDEOS*
Searching Video's for strange, opendir, problem, work, home, directory
|
advertisement
|
|