Sponsored Content
Full Discussion: Numeric CHMOD for .js files
Top Forums UNIX for Advanced & Expert Users Numeric CHMOD for .js files Post 98716 by cbkihong on Friday 10th of February 2006 09:42:53 AM
Old 02-10-2006
Quote:
Originally Posted by Texan
Hello!

At present, my .js files are also within the public_html directory.
Anyone is able to type the name of these files in their browser
address bar and then be presented the javascript (or text) code.
That makes sense. As Javascript is run on the client side on users' browsers, it MUST be publicly accessible and so this is the expected behaviour. On HTTP a .js file is just served in exactly the same way by the Web server as an HTML file or a PDF file. Javascript files are NEVER executed on the server so the file permissions are irrelevant. The file will be served correctly provided Apache can have read permission to the file.

What is the point of writing Javascript that cannot be accessed by clients?

Quote:
What numeric CHMOD should be applied to these, which: Permit
the world and group to execute the commands contained in
the files, but Disallows display of the actual code contained
within the script to the world and group?
But hey, you can't run Javascript with the shell (if you know an interpreter that does, tell me)!! And as I said, unlike server-side languages such as Perl that can act as CGI programs, that will be executed by the Web server and just serve the generated output without divulging the sources, Javascript files are served verbatim as static resources and so either you let clients get it, or you don't. You can't have a Javascript that only executes but not readable, because the HTTP protocol is open. Even if browsers do not have a "view source" function, there are still so many ways to get the source. For instance, by a packet sniffer and everything must be there. You can't hide anything.

Javascript can only be obfuscated with difficult-to-read-variable-names and reducing the entire script into a one-liner with some unusual structure. This is already the utmost one can do to Javascript if he wants to make it hard for people wishing to hack or steal the sources, but still, that obfuscated code is available for access publicly, otherwise the browser will never be able to get the source to run it!

I am pretty sure your concepts has been screwed.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ls and chmod numeric permissions

Hello, When I do a "ls -l" I can see my directories have drwxr-xr-xr. I am more used to the chmod numerical syntax like 755. Is there an easy way to list out the numerical permissions rather than rwx etc. (1 Reply)
Discussion started by: rondebbs
1 Replies

2. UNIX for Dummies Questions & Answers

chmod command for recently modified files

hello! is there a way for me to use the chmod command to change permissions for several files all at once -based on the fact that these files were all most recently modified TODAY ? I can't use a wildcard on their filenames because the filenames are varied. But I was hoping I could somehow do... (2 Replies)
Discussion started by: polka_friend
2 Replies

3. UNIX for Dummies Questions & Answers

users need to chmod on newly ftp'd files

Is there a way to specify 774 permissions for a file uploaded to an app server via ftp without the users logging in and doing a chmod on the file they just put? I understand they were doing this with an old shared account, and it was working. When they started using their own accounts it stopped... (1 Reply)
Discussion started by: jgentile
1 Replies

4. Shell Programming and Scripting

help with chmod (files only)

hello, i want to chmod 444 all files in a directory, files in subdirs cannot be chmoded same goes for the subdirs themself. So using: chmod -R 444 /dir/ won't work because it will chmod the directorys and files (together with files in subdirectorys) I figured out how to chmod files... (1 Reply)
Discussion started by: TehOne
1 Replies

5. UNIX for Dummies Questions & Answers

chmod for files and directories

Hi, OS - Unix, linux (all unix flavors) My requirement. To check directory/file exists and then change the permission of the directories/files. Iam trying to start with directory and here is my code in the file totalchange.sh (insideragain - is a directory, test1.txt - is a file under the... (2 Replies)
Discussion started by: kenkanya
2 Replies

6. Shell Programming and Scripting

chmod a lot of files

So i have about 600gb of data.. in which there are alot of directories and alot of files.. Im trying to put this on a ftp server.. So i want to set the permissions on the directories to be 755 and the permission on the files to be 644. So i used: find . -type d -exec chmod 755 {}\; and find .... (6 Replies)
Discussion started by: supermiguel
6 Replies

7. Shell Programming and Scripting

chmod for great number of files

Hi all, I have a script who generate as an output a lot of files (the number is highly variable : 500 to more than 10000). At the end of this script I need to do a "chmod" on all those files. I tried but it says -bash: /bin/chmod: Argument list too long So it seems that chmod can't... (9 Replies)
Discussion started by: Moumou
9 Replies

8. Shell Programming and Scripting

chmod on 690k files

I have a folder that contains about 690k files and I need to change their permissions. The challenge is, I have no telnet access and the GUI FTP manager via cpanel just simply fails. I tried doing it via command line ftp but that too, fails saying 'no such file or directory'. My last resort is... (11 Replies)
Discussion started by: designflaw
11 Replies

9. UNIX and Linux Applications

What is the difference between chmod in solaris and chmod in Linux?

i think it is the same in both... Iam i right? (1 Reply)
Discussion started by: sumaiya
1 Replies

10. Shell Programming and Scripting

Chmod list of files

Hi, I have a list of files in a text file. I want to change the mode of every one of those files, but am having difficulty in doing so. #!/bin/bash files=/home/david/files.txt for $item in $files { chmod 640 $item } .. doesn't cut it. Can anyone help? Thanks. (7 Replies)
Discussion started by: davidm123SED
7 Replies
pyca(1) 						      General Commands Manual							   pyca(1)

NAME
pyca - CA written in python DESCRIPTION
The scripts in ths suite are basically wrappers around openssl(1). Additionally the scripts integrates the generic CA-functionality with the mail-system and apache for handling certificate requests; with LDAP for handling distributing certificates and revocation lists; and cron for maintenance tasks. PROGRAMMES
ca2ldif.py Write CA certificates and CRLs to a LDIF file. This is intended for initially setting up the CA entries not for daily CRL update. The entries are of objectclass certificationAuthority and contain the attributes cACertificate;binary, authorityRevocation- List;binary and certificateRevocationList;binary. This might require extending schemas on LDAPv2 servers. Have a look at your LDAP servers configuration documentation. certs2ldap.py Send all certs and CRLs to a LDAP repository. copy-cacerts.py Copy all CA certificates defined in an OpenSSL configuration to a bundled PEM file or a directory with hash-named symbolic links. This is quite handy in conjunction with ApacheSSL or Apache with mod_ssl for copying the files for SSLCACertificateFile or SSLCACer- tificatePath. ns-jsconfig.py Create Javascript code containing all CA certificates defined in an OpenSSL configuration for use with the Netscape admin tool (cre- ating netscape.cfg). print-cacerts.py This simple script prints all CA certs on stdout. It is intended to generate authentic printouts (on paper!) of the CA certs finger- prints and is typically run on the private CA system. Choose the option --html to generate nicer formatted HTML-output instead of the default textual output in ISO-8859-1. ns-jsconfig.py Create a Javascript file to be included in a Netscape configuration file (netscape.cfg). SEE ALSO
pyca(8) The programs are documented fully by the HTML documents in /usr/share/doc/pyca/htdocs/ COPYRIGHT
Copyright (C) 2001 - 2003 Michael Stroeder <michael@stroeder.com> This software including all modules is Open Source and given away under: GPL (GNU GENERAL PUBLIC LICENSE) Version 2. The author refuses to give any warranty of any kind. AUTHOR
Michael Stroeder <michael@stroeder.com> This manual page was written by Lars Bahner <bahner@debian.org>, for the Debian GNU/Linux system. june 30, 2002 pyca(1)
All times are GMT -4. The time now is 02:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy