security

Ruby on Rails private link sharing: Google Docs Style

你离开我真会死。 提交于 2020-01-01 09:57:30
问题 What would be the best way to go about giving users the ability to share a private link that enables anyone who clicks it to view a certain page/document/item that have privacy restrictions in place? In my case: A User creates events which are limited to certain groups of relationships in the database (namely: friends, friends of friends, etc.) I have a :before_filter in the event controller that checks the eligibility of the current logged in user to make sure that that user has permission

Ruby on Rails private link sharing: Google Docs Style

久未见 提交于 2020-01-01 09:57:12
问题 What would be the best way to go about giving users the ability to share a private link that enables anyone who clicks it to view a certain page/document/item that have privacy restrictions in place? In my case: A User creates events which are limited to certain groups of relationships in the database (namely: friends, friends of friends, etc.) I have a :before_filter in the event controller that checks the eligibility of the current logged in user to make sure that that user has permission

PHP - hash_pbkdf2 function

最后都变了- 提交于 2020-01-01 09:55:12
问题 I'm trying to do a function to hash passwords with this php function: http://be.php.net/manual/en/function.hash-pbkdf2.php. Here is the code: $hash_algo = "sha256"; $password = "password"; $salt = "salt"; $iterations = 1; $length = 1; $raw_output = false; $hash = hash_pbkdf2($hash_algo, $password, $salt, $iterations ,$length ,$raw_output); echo $hash; I got this error: Fatal error: Call to undefined function hash_pbkdf2(). How can the function be undefined??? PS: All the values of my

correct way to run setuid programs in C

老子叫甜甜 提交于 2020-01-01 09:47:50
问题 I have a process with permissions 4750. Two users exist in my Linux system. The root user and the appz user. The process inherits the permissions of a process manager that runs as "appz" user. I have two basic routines: void do_root (void) { int status; status = seteuid (euid); if (status < 0) { exit (status); } } /* undo root permissions */ void undo_root (void) { int status; status = seteuid (ruid); if (status < 0) { exit (status); } status = setuid(ruid); if (status < 0) { exit (status); }

correct way to run setuid programs in C

谁都会走 提交于 2020-01-01 09:47:25
问题 I have a process with permissions 4750. Two users exist in my Linux system. The root user and the appz user. The process inherits the permissions of a process manager that runs as "appz" user. I have two basic routines: void do_root (void) { int status; status = seteuid (euid); if (status < 0) { exit (status); } } /* undo root permissions */ void undo_root (void) { int status; status = seteuid (ruid); if (status < 0) { exit (status); } status = setuid(ruid); if (status < 0) { exit (status); }

Security Risks of Including a 3rd Party iFrame

社会主义新天地 提交于 2020-01-01 09:47:09
问题 What are the application security risks of including a hidden 3rd Party iFrame? If I understand correctly... Click jacking isn't an issue for me because I own the parent page Same-Origin Policy prevents 3p frame from interacting my dom/cookies/js The frame is hidden, so I don't have to worry about anything that may be displayed in the frame However I did some experiments in the Chrome console and... 3p frame can call things like alert/prompt 3p frame can redirect the parent via location.href

How do you rename a Role using Membership in .NET?

女生的网名这么多〃 提交于 2020-01-01 09:45:09
问题 I'm using ASP.NET Membership and noticed there isn't a method in the Roles class to modify a role (its name for instance), only to create and delete them. Is it possible or it's not supported? EDIT: @CheGueVerra: Yes, nice workaround. Do you know (for extra credit :) ) why it's not possible? 回答1: There is no direct way to change a role name in the Membership provider. I would get the list of users that are in the role you want to rename, then remove them from the list, delete the role, create

sun.security.x509.CertAndKeyGen and sun.security.pkcs.PKCS10 - missing in JDK8. Implementation suggestions

孤者浪人 提交于 2020-01-01 09:36:14
问题 In JDK8 the class sun.security.x509.CertAndKeyGen does not exists anymore. Also sun.security.pkcs.PKCS10 is missing. In JDK7 they existed. What could be an alternatives to these classes methods? 回答1: I think you are looking for: sun.security.tools.keytool.CertAndKeyGen You'll find it inside the rt.jar under the JRE libraries. Keep in mind this class is outside of J2SE, it's likely only available with OpenJDK, so for example the GNU Compiler won't have it. 回答2: If you are using maven, put this

How do online interpretors/compilers deal with malicious code? [closed]

倾然丶 夕夏残阳落幕 提交于 2020-01-01 09:32:51
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . How does an online code interpreter/compiler (jsfiddle.net, jsbin.com, ideone.com, codepad.org, etc) deal with malicious code, such as

How do online interpretors/compilers deal with malicious code? [closed]

℡╲_俬逩灬. 提交于 2020-01-01 09:31:39
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . How does an online code interpreter/compiler (jsfiddle.net, jsbin.com, ideone.com, codepad.org, etc) deal with malicious code, such as