65 posts
Location
The Internet
Posted 30 June 2012 - 06:30 PM
Hello,
I'm making a program and i need it to be as secure as possible. If disk boot was not a factor, is there a way to make a file permanently un-editable? I managed to make it un-editable for a little, as in you try to edit ti and it throws an error, but then it will open to be edited if you input the edit command again. Is there any way to fix this to make it so it will still won't be editable after the first time?
EDIT: I fixed it myself, nevermind.
Edited on 30 June 2012 - 06:11 PM
107 posts
Posted 01 July 2012 - 04:26 PM
Can you tell us how you fixed it? Would be helpful for people having the same issue.
134 posts
Location
Salt Lake, UT
Posted 02 July 2012 - 02:33 AM
Can you tell us how you fixed it? Would be helpful for people having the same issue.
Yes!!! Please do
95 posts
Posted 04 July 2012 - 11:11 AM
The best and easiest way to make a file un editable is to delete the edit program from the rom as simple as typing "delete edit" but as stated in post it is almost impossible to make it un editable anyways once u have removed edit you then want to block any external device's forcing a shutdown yeh that should do it
2447 posts
Posted 04 July 2012 - 12:54 PM
Except you can't delete files form the rom.
445 posts
Posted 04 July 2012 - 03:05 PM
You could compile the lua code and loadstring() it :3
95 posts
Posted 05 July 2012 - 05:31 AM
Except you can't delete files form the rom.
I am able to on my server in game maybe a setting
8543 posts
Posted 05 July 2012 - 05:45 AM
There are no settings that would enable you to do such a thing.
95 posts
Posted 05 July 2012 - 05:56 AM
There are no settings that would enable you to do such a thing.
Thats really weird on my server i can just type Delete edit for example and it delete's it of that pc i promise im not doing anything special
95 posts
Posted 05 July 2012 - 06:37 AM
Ok so i was talking to my mate the server host and apperently he bugged computercraft on are server its now fixed however i just found a really easy way to stop edit from working type the following
edit edit
os.shutdown()
or if u dont want it to kill everything
os.reboot()
That will 100% lock the edit guaranteed even on server that havent been buggered by ur mate :P/>/> :)/>/> send diamonds to me any time :D/>/>
8543 posts
Posted 05 July 2012 - 06:39 AM
Nope, you're just making a file at /edit. You could still execute the normal edit by running /rom/programs/edit.
95 posts
Posted 05 July 2012 - 06:43 AM
1 sec going to test you has destroyed my plans i think
95 posts
Posted 05 July 2012 - 06:49 AM
Ok that's a small problem i found the way around that its simple but requires you to have access to the server or the rom folder go into it and cut edit from the rom now you need to place edit on every id of all the pcs and then just remove it from the pc's you down t want editable it requires alot of work but should work cant test as i don't own server and have no single players
95 posts
Posted 05 July 2012 - 09:27 AM
So did it work anyone going to tell me :P/>/>
445 posts
Posted 05 July 2012 - 10:27 AM
you can still run the lua console and re-write edit :P/>/>
95 posts
Posted 05 July 2012 - 11:22 AM
you can still run the lua console and re-write edit :P/>/>
Explain more and i will get around it most liklely
if its just another rom program then just do the same as before
445 posts
Posted 05 July 2012 - 12:04 PM
in console:
lua
then you use the fs api for writing files :P/>/>
1548 posts
Location
That dark shadow under your bed...
Posted 05 July 2012 - 12:07 PM
either way you can just open a new file, write whatever and then delete your existing file and then rename your new one to that name, has anyone tried making the server-side file read-only?
445 posts
Posted 05 July 2012 - 12:08 PM
Unless you edit ROM its impossible, if you edit ROM its easy
95 posts
Posted 05 July 2012 - 12:19 PM
that's why its called read only memory
445 posts
Posted 05 July 2012 - 12:23 PM
that's why its called read only memory
I meant editing the bios and such to make it possible :P/>/> not just sticking a file there
1548 posts
Location
That dark shadow under your bed...
Posted 05 July 2012 - 12:56 PM
and could you not use the shell.setAlias() command to assign the 'edit' or 'rom/programs/edit' alias to a random program
what I meant was opening your turtle and making the program you are protecting read only, then they cannot change it
95 posts
Posted 05 July 2012 - 12:56 PM
i believe so yeah that would work to
1548 posts
Location
That dark shadow under your bed...
Posted 05 July 2012 - 12:58 PM
i believe so yeah that would work to
lol, which one
95 posts
Posted 05 July 2012 - 12:59 PM
i believe so yeah that would work to
and could you not use the shell.setAlias() command to assign the 'edit' or 'rom/programs/edit' alias to a random program
what I meant was opening your turtle and making the program you are protecting read only, then they cannot change it
That one my freind
445 posts
Posted 05 July 2012 - 01:11 PM
i believe so yeah that would work to
lol, which one
Can't you still shell.run it? or cp it to a diff filename
1548 posts
Location
That dark shadow under your bed...
Posted 05 July 2012 - 01:27 PM
you can alias out lua if you like
95 posts
Posted 05 July 2012 - 01:27 PM
i still stick by the best method is to clear the rom and have all rom files run from its personal memory
1548 posts
Location
That dark shadow under your bed...
Posted 05 July 2012 - 01:35 PM
but then no-one else can use a PC as they need the rom files, is it not better that you just alias out what you think should be restricted rather than disabling all computers placed after your operation?
95 posts
Posted 05 July 2012 - 01:37 PM
thats why you copy all the rom files into the pc folder the programs still exist but you can delete the ones you no longer want for example on my server the rom folder is empty and we have set up a out of game script that fills a new folder ie id with the old rom files its basically best explained like this.
Everything still in the rom
Windowsits as safe as hell but you cant do much
put all the rom files in the pc and have the rom empty
Lynx you can bugger it up something rotten but the possibilitiesbut then no-one else can use a PC as they need the rom files, is it not better that you just alias out what you think should be restricted rather than disabling all computers placed after your operation?
1548 posts
Location
That dark shadow under your bed...
Posted 05 July 2012 - 02:13 PM
Yes but if you place a new PC after you have done this then it gets a new folder which is empty, it will not have the files
sorry if I am misunderstanding what you are saying, kindly enlighten me
95 posts
Posted 05 July 2012 - 02:23 PM
no what you said there is correct the folder will be empty then you have 2 chooses you can either manually paste all the rom files so i keep a folder called backup rom that is on my desktop
you then can manually copy the whole backup rom to the new pc or you can set up an out of game script that will add those files to any new folder in that folder however i don't know how to do that as my mate is the server host and he made that script in c#
1548 posts
Location
That dark shadow under your bed...
Posted 05 July 2012 - 02:30 PM
you could create a file hosting server and rednet the files across if you like or as you say make a backup folder of the rom and then you can use an exterior script to keep checking for new folders in the computers directory and when one is detected it copies the files in and records that the folder has been taken care of (so if you delete a file it doesn't copy it in again)
1548 posts
Location
That dark shadow under your bed...
Posted 05 July 2012 - 02:33 PM
lol, we are thinking of so many outlandish ways of changing the system:)
1604 posts
Posted 05 July 2012 - 03:11 PM
The only way to do this would be:
1) Go to rom and delete every program that can create files (ie, edit, lua, pastebin).
2) Do the same on every computer.
3) Now no one can create programs.
There's no way to stop people from creating new files. If there's just one computer that can edit files, it can make a floppy and copy them to every computer.
445 posts
Posted 05 July 2012 - 03:13 PM
Fun fact: the OP didn't even want to disable all editing :3
1604 posts
Posted 05 July 2012 - 03:26 PM
Fun fact: the OP didn't even want to disable all editing :3
:P/>/>
You'r right, and it says it's already solved (not sure how, but solved), lol
95 posts
Posted 05 July 2012 - 05:32 PM
yeh but the two at the begging did and it was fun breaking all of dan 200 tools
166 posts
Location
Don't look behind you..
Posted 11 July 2012 - 04:39 PM
This would not happen if we could make programs with names as "door lock" (now when you do that the program wil be "door" and not "door lock")
1 posts
Posted 11 February 2013 - 12:45 PM
anyone able to give me a step by step walk through on how to make it to where people cannot write programs onto a server?
21 posts
Posted 11 February 2013 - 01:17 PM
having a sightly edited shell as a startup program with certain command blacklisted would work by adding "edit <program path/program name>" and "edit startup" as well as "edit /startup", "lua" + direct path and direct path with leading "/" + "shell" + direct path and direct path with leading "/" on the blacklist and if your blacklist actually is a file ofc "edit <blacklistpath/blacklistfile>" with maybe an exception for this/the startup shell where you would need to enter a password to edit (but that would be saved in plain text on the computer unless you create an overly confusing routine to generate it at runtime but definetly dont use one of your normal passwords)
EDIT (after reading the 2nd page): add all other things that make it further possibe to get access to that program to the blacklist is probably only possible if you add edit and alias to the blacklist as well as copying removing and moving any files involved
2217 posts
Location
3232235883
Posted 11 February 2013 - 01:59 PM
i just open it in startup and make sure the file handle dosent get collected
21 posts
Posted 11 February 2013 - 02:04 PM
i just open it in startup and make sure the file handle dosent get collected
any specifications on how exactly?
2217 posts
Location
3232235883
Posted 11 February 2013 - 02:54 PM
fs.open("file_to_protect","r")
504 posts
Location
Seattle, WA
Posted 11 February 2013 - 03:01 PM
You could always just override the fs.open() global function to not return a handle to the file requested if its your file.
Just put this as your startup script:
local FILE_TO_PROTECT = "/myFile"
local old_fsOpen = _G["fs"]["open"]
_G["fs"]["open"] = function (path, mode)
if shell.resolveProgram (path) == shell.resolveProgram (FILE_TO_PROTECT) then
return nil
end
return old_fsOpen (path, mode)
end