w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Set FileSystemAccessRule for "IIS AppPoolName" permissions fails with "Some or all identity references could not be translated"
The Above C# is correct, and I was wrong, it's down to the timing. I added a loop into that tries to set the permissions via AddAccessRule if it fails I set the thread to sleep for 50ms before trying again & so on until my timeout is reached or it's successful; in all cases it's been successful with 5 attempts.

Categories : C#

hibernate - process scoped identity
Actually, what you implemented is supported out of the box is supported by Hibernate, in a given Hibernate session. Having a unique instance shared between several sessions (and thus transactions) doesn't make any sense because that would ruin the ACID features provided by transactions, and make it completely useless unless only one user accesses the database. For example, your transient fields, stored in memory, would be completely incorrect is the data is modified in the database without going through this unique in-memory instance. And if some constraint is broken and causes a rollback of the transaction, you're left with incorrect values inside your unique instance, which are completely disconnected from the reality of the data stored in the database.

Categories : Java

How to launch process from android app with ROOT permissions
There is a difference on how to build command-line for process for ProcessBuilder: NOT working code: commandLine.add("su -c"); commandLine.add("app"); commandLine.add("params") commandLine.add("sudo"); commandLine.add("app"); commandLine.add("params") WORKING code: commandDownloader.add("su"); commandDownloader.add("-c"); commandLine.add("app"); For working code i'm asked for permission by Android OS (MIUI in my case to be more detailed)

Categories : Android

Get current process identity and authentication information
It would be easiest if you could leverage the built-in authentication of IIS or WCF. If you really need a TCP socket, I think you have to implement the authentication yourself. It's not conceptually difficult if you understand how Kerberos works, but it will take a while to work out the details of all the functions to call. MSDN has a decent overview here. In addition, I'm not aware of any C# wrappers for these, so you would probably need to p-invoke them all; consider writing that part in managed C++.

Categories : C#

How to read the input message of read shell command using process builder
I tried to google for bash read command and got this link: http://ss64.com/bash/read.html -p prompt : Display prompt, without a trailing newline, before attempting to read any input. The prompt is displayed only if input is coming from a terminal. Apparently if input is coming from non terminal as in your example prompt is not shown.

Categories : Java

Using Stream.Read() vs BinaryReader.Read() to process binary streams
Your codes could be much more identical. I was wrong about that. ReadByte() actually returns byte. No, there is no principal difference between the two approaches. The extra Reader adds some buffering so you shouldn't mix them. But don't expect any significant performance differences, it's all dominated by the actual I/O. So, use a stream when you have (only) byte[] to move. As is common in a lot of streaming scenarios. use BinaryWriter and BinaryReader when you have any other basic type (including simple byte) of data to process. Their main purpose is conversion of the built-in framework types to byte[].

Categories : C#

Get publish_action permission after getting read permissions from Facebook
From the facebook sdk 3.0 documents you can not give the read and publish permission simultaniously. But once you open the session with read permission later you can update this session to publish permission, by UiLifecycleHelper class. Once the session state changes to SessionState.OPENED_TOKEN_UPDATED means session updated with publish permission. Here is sample code for you hope this help you. public class Example { private static final int REAUTH_ACTIVITY_CODE = 100; private static final List<String> PERMISSIONS = Arrays.asList("publish_actions", "publish_stream"); private static final String PENDING_PUBLISH_KEY = "pendingPublishReauthorization"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView

Categories : Android

Can't read usb string descriptor with libusb because of permissions
I encountered that problem as well. It seems that pyusb by default opens devices read-write, while lsusb opens them read-only, as can be seen in this $ strace lsusb extract: ... open("/sys/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1:1.0/uevent", O_RDONLY|O_CLOEXEC) = 6 ... I solved the problem by making all usb devices world-read/writable, but that's definitely not optimal from a security standpoint (keyloggers, etc)...

Categories : Python

Facebook iOS SDK - open session and request read permissions
You can "init" your session with read permissions by calling the initWithPermissions: method. Then call openWithBehavior:completionHandler: which will do only 1 open call with the permissions you've already set.

Categories : IOS

Unix File Permissions - Does Write Imply Read?
A file can be a lot of things in unix-like systems. It might, for example be a pipeline, where a user might submit data to, but not receive data from. So no, a write permission does not imply read. Another example might be a directory where the user can deposit data (potentially destroying existing data), but not read what others have deposited.

Categories : Unix

Facebook App Alerts: Permissions - read and write for apps without FB login
The "problem" with your request is the read_friendlists permission, the guidelines in case of non-facebook login says: In this case, make sure that the only read permissions you request are public profile and friend list. Also the offline_access han been deprecated and not useful anymore So you should ask for read_friendlists in a separate request, the alert does not affect the functionality of the app but maybe it will affects other things like quota or apps store. Hope this helps

Categories : Facebook

How do you set read/write permissions in a VS2010 windows service installer?
Permissions for services is determined by the account that is set to run the service. For this issue, the account was set to LOCAL SERVICE. By changing to LOCAL SYSTEM, the issue was resolved. This can be accomplished by looking at this article and scrolling down to To create the installers for your service The LocalService account acts as a non-privileged user on the local computer, and presents anonymous credentials to any remote server. Use the other accounts with caution, as they run with higher privileges and increase your risk of attacks from malicious code.

Categories : Visual Studio 2010

Apache Shiro- using DataBase to read users, roles and permissions
The Realm interface is a security component that can access application-specific security entities such as users, roles, and permissions to determine authentication and authorization operations. You can implement it to interact with any source for finding users and their permissions. If you want to interact with an SQL-based database, you can do that. If you want to interact with a text file, you can do that. If you want to interact with a web service, you can do that. There are two useful (almost necessary) extensions of Realm which are AuthenticatingRealm and AuthorizingRealm. They provide an interface for authentication and authorization services, respectively. AuthorizingRealm extends AuthenticatingRealm. You should extend AuthorizingRealm to implement your own authenticati

Categories : Java

Facebook warning for app: asks for read and write permissions at the same time
You need to include Extended Permissions to be able to use "publish_actions". This guide explains how to set permissions and publish a post to a wall. Esentially, the required permission as stated earlier is included like so: private static final List<String> PERMISSIONS = Arrays.asList("publish_actions"); To publish a story, they have even provided the necessary code for you which also utilises the "publish_actions" permissions: private void publishStory() { Session session = Session.getActiveSession(); if (session != null){ // Check for publish permissions List<String> permissions = session.getPermissions(); if (!isSubsetOf(PERMISSIONS, permissions)) { pendingPublishReauthorization = true; Session.NewPermissionsRequest newPermissionsRequ

Categories : Facebook

how to get next Identity not the last inserted identity of Identity column
You don't need to do anything to "lock" an IDENTITY value. As soon as the table uses a value of an IDENTITY, it's used forever, even if you do a rollback. SQL Fiddle example: http://sqlfiddle.com/#!3/5fdb9/1/0. Note the ids that make it into the table, only 1 and 5. If that doesn't address your problem, please revise your question.

Categories : Sql Server

FBSession.activeSession.permissions does not appear to accurately depict the valid granted permissions
If you were using iOS SDK 3.0, then this was due to a bug in the SDK. See the bug report for more details. Symptom summary: After authorizing user with openActiveSessionWithPermissions method, the sessions variable in callback method contains extended permissions that were not allowed by a user.

Categories : IOS

Read int from process memory
Note that this will only work on 32bits public static int ReadInt(long address, int[] offsets) { address = ReadInt(address); for (int i = 0; i < offsets.Length; i++) { address = ReadInt(address + (long)offsets[i]); } return (int)address; } You have offsets.Length + 1 ReadInt(s) to do, one without offset and offsets.Length with offset. Each one returns the address for the next one. The last one returns a value. Considering this will work only on 32 bits (because you are reading 32 bits and using them as a ptr), using long is useless. int is enough.

Categories : C#

How do I read from a process output
See: How to spawn a process and capture its STDOUT in .NET? ProcessStartInfo.RedirectStandardOutput Code: serverProcess.StartInfo.RedirectStandardOutput = true; serverProcess.OutputDataReceived += (sender, args) => Console.WriteLine("received output: {0}", args.Data); serverProcess.Start(); serverProcess.BeginOutputReadLine(); Or: serverProcess.StartInfo.RedirectStandardOutput = true; var output = serverProcess.StandardOutput.ReadToEnd(); See also: ProcessStartInfo.RedirectStandardError serverProcess.StartInfo.RedirectStandardError = true; var error = serverProcess.StandardError.ReadToEnd();

Categories : C#

Read from a file which is being used by another process
It is likely chrome prevent you from writing to the cache file it is using. Try to make a copy of the cache file(with whatever tools(like cp command) you have at hand), and do the I/O with the replica. A possible explaination is that when chrome get the permisson for read, write and append access, simply opening the file with read permission, reading the bytes with seek operation behind the scene would mess your own reading content, so to be denied by the OS. To check read permission before you call the function open with a default read access, with os.stat(filepath).st_mode; to find if you have the read permisson. Only if it is comfirmed that you have no read permisson, we could go further to figure out why chrome block your access to cache file, but not that of ChromeCacheView.

Categories : Python

Is it possible to determine if another process has read your memory?
In general no. I just had to dump the complete memory of a process some days ago, and the first thing I did, was to suspend the process that should be dumped. As the stopped process has no control over its own restart, there is no guarantee that it can continue afterwards, so there is no way that it could reliable check whether it was dumped or not. There are several approaches that are used, esp in the copy-protection area, like crypting memory addresses, spawning several other process to guard the orignial process, and several other tricks but which are nothing more than that: tricks. As long as the hardware does not fully encrypt everything and does inside the cpu itself without anbybody else giving access to it the there is always a way to read the memory without letting the cpu know

Categories : Linux

Error 299 when trying to read process memory
Me helped solution on www.codeproject.com: Solving-Problems-of-Monitoring-Standard-Output. Solution protect application from additional deadlocks that Microsoft does not mention in their documentation.

Categories : C#

Restarted Process Output won't Read
Okay... I've managed to prevent the errors using different method, which is to call process->StandardOutput->ReadLine(); This way the async stream reading won't happen.

Categories : C++

Finding out the current Identity Provider in Windows Identity Foundation
You typically use the Issuer and OriginalIssuer properties in each claim that you get. If you use e-mail as the unique identifier: var u = this.User as IClaimsPrincipal; var c = (u.Identity as IClaimsIdentity) .Claims .First( c => c.ClaimType == ClaimTypes.Email ); var issuer = c.Issuer; var originalIssuer = c.OriginalIssuer;

Categories : C#

Where is Microsoft.AspNet.Identity.Owin.AuthenticationManager in Asp.Net Identity RTM version?
That class is gone, as it was basically just adding methods that generated a ClaimsIdentity and passed that into an Owin.Security.IAuthenticationManager. Instead the RTM templates have a SignIn method in the controller that looks something like this: private async Task SignInAsync(ApplicationUser user, bool isPersistent) { AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity); }

Categories : Asp Net

Read console for a process you didn't start
Swap in your own executable in place of B that spawns B and sends its output two different places, more or less like the "tee" command does in *nix. (Good job swapping out the .exe -- didn't think of that!)

Categories : Dotnet

Java - Read many txt files on a folder and process them
Assuming you have all the files in one place: File dir = new File("path/to/files/"); for (File file : dir.listFiles()) { Scanner s = new Scanner(file); ... s.close(); } Note that if you have any files that you don't want to include, you can give listFiles() a FileFilter argument to filter them out.

Categories : Java

java- read from process while writing buffer
There are two possible problems here: 1) If the other process does not write whole lines, then there obviously will be no line to read from the input stream. In that case, the readLine method waits until it has a whole line (which may be true after the process has finished). 2) More likely: The other process writes into a buffered writer, but doesn't flush its content. That results in the buffere being flushed at the end of the process. If the other process is a Java process, then using a PrintWriter will be the best choice. That PrintWriter should be constructed this way: PrintWriter writer = new PrintWriter(..., true) The true argument enables the auto-flush behavior for this print writer. See PrintWriter documentation. EDIT I just saw the p.waitFor() call. This causes your thread

Categories : Java

The process could not read file 'C:WindowsTempuncsnapshotname due to OS error 3
OS error 3 means path not found. OS error 5 means access is denied. You must specify a UNC network share such as \computernamesnapshot rather than a local path when using pull subscriptions and/or a remote Distributor. This is covered in Secure the Snapshot Folder. After you have create a share for the snapshot folder and updated the distributor properties to reflect this you must assign appropriate permissions to the folder. The replication agent process account must have read permissions on the snapshot share along with the other permissions described in the section Permissions That Are Required by Agents in Replication Agent Security Mode. To create a share for the snapshot folder and grant appropriate permissions follow the tutorial in Lesson 2: Preparing the Snapshot Folder. If

Categories : SQL

Read Excel file with OleDB c#, when it is used by other process
Sadly OleDB driver by default will open file exclusively then you can't open it when it's in use by someone else, even just for reading. Two considerations: Other application may finalize its work with the file within milliseconds so it's good to try again Driver will always open file locked for writing (so you can't open it twice via OleDB) but it's shared for reading (so you can copy it). That said I suggest you should first try to open it after a short pause, if it's still in use (and you can't wait more) then you can make a copy and open that. Let me assume you have your code in a HandlExcelFile() function: void HandleExcelFile(string path) { try { // Function will perform actual work HandleExcelFileCore(path); } catch (Exception) // Be more spec

Categories : C#

How to Alter a table for Identity Specification is identity SQL Server
You cannot "convert" an existing column into an IDENTITY column - you will have to create a new column as INT IDENTITY: ALTER TABLE ProductInProduct ADD NewId INT IDENTITY (1, 1); Update: OK, so there is a way of converting an existing column to IDENTITY. If you absolutely need this - check out this response by Martin Smith with all the gory details.

Categories : SQL

Read & Process in memory XML data in a streaming manner in C
xmlReaderForMemory from libxml2 seems a good one to me (but haven't used it so, I may be wrong) the char * buffer needs to point to a valid XML document (that can be a part of your entire XML file). This can be extracted reading in chuncks your file but obtaining a valid XML fragment. What's the structure of your XML file ? A root containing subsequent similar nodes or a fully fledged tree ? If I had an XML like this: <root> <node>...</node> <node>...</node> <node>...</node> </root> I'd read starting from the opening <node> till the closing </node> and then parse it with the xmlReaderForMemory function, do what I need to do, then go on with the next <node> node. Ofc if your <node> content is too complex/long, y

Categories : C

logcat process InputStream fail to read new log in android app
Same reason as below, the logcat from other preccess can't be read. How can I get logcat on my device to show logs from all processes

Categories : Android

lauch perl process from C# and read standard output
Why not run the master perl process via C#, and then get an array of System.Diagnostic.Process by searching for process on name, as they'll all be running as "perl" Process [] localByName = Process.GetProcessesByName("perl"); Then iterate through the array and use as a standard System.Diagnostic.Process to get the output.

Categories : C#

Open process with debug privileges and read/write memory
I think you are trying to access kernel land memory range and hence the exception. User land range is from 0x00000000 - 7FFFFFFF , so try accessing is this range, as anything above is kernel space. I am assuming you are on a 32 bit machine. Check this link - http://msdn.microsoft.com/en-us/library/windows/hardware/ff560042(v=vs.85).aspx

Categories : C++

How does read error in swap partition affect a running process?
"Poison" patch should handle your case: https://lwn.net/Articles/348886/ Dirty pages in the swap cache are handled in a delayed fashion. The dirty flag is cleared for the page and the page swap cache entry is maintained. On a later page fault the associated application will be killed.

Categories : Linux

How can I read data from MySQL database into a process in jBPM Web Designer?
You can integrate mysql with jbpm5 as shown here Also you can write java handlers to fetch data from files or databases and then use #{expression} to assign actor id dynamically. Comment if anything is not clear.

Categories : Mysql

Monitoring Windows system Read/Write operations by process?
You could try to find the Filemon tools from SysInternals. They offered the source for download back then, but it was removed. Might be that you can still find it via google. Basically this was done with a driver, so you would have to implement this as a device driver and use a filter driver on top of the file system. It was for NT/XP, but the basic idea should still work. It's not exactly trivial though, so I don't know if this is really what you want to do. I don't see a way to do this from user space, as this would be a big security risk if this can be easily done.

Categories : C#

Read file, and process words with Word class, method
The problem is that scan.next() returns a String not a Word object you can not assign it like that. Try this: while (scan.hasNext()) { Word word = new Word(scan.next()); //... } To do this, you need a constructor like that: public Word(String s){ //... }

Categories : Java

Read stdout of "RunAs" child process started by ProcessBuilder or DefaultExecutor
From what I've read, Microsoft's runas command launches a new terminal when invoked. There is no output piping from the new terminal back to the terminal which invoked it. The closest solution suggested is to include a pipe as part of the command for runas to invoke so that the output of the command run in the new terminal is written to a file. Following this notion, you could also have a flag/signal file written as the last thing before the runas terminal exits. This will be done in one line: runas /noprofile /user:dev /savecred /env "cmd.exe /c java -cp myProj.jar com.myComp.myProj.Main -libjardirs target/lib 2> cmd.log & echo about to close terminal>>cmd.log" Last portion & echo about to close terminal>>cmd.log uses & to issue a second command in the RunAs

Categories : Java

How to set world permissions to be the same as group permissions?
From the chmod(1) man page (relevant parts extracted): -R Change the modes of the file hierarchies rooted in the files instead of just the files themselves. And: The symbolic mode is described by the following grammar: who ::= a | u | g | o op ::= + | - | = perm ::= r | s | t | w | x | X | u | g | o The who symbols "u", "g", and "o" specify the user, group, and other parts of the mode bits, respectively. The who symbol a is equivalent to ugo. The perm symbols represent the portions of the mode bits as follows: g The group permission bits in the original mode of the file. So for you: chmod -R o=g * Example: $ ls -l total 0 drwxr-x--- 2 carl staff 68 Jun 28 10:25 example.d -rw-r----- 1 carl staff 0 Jun 28 10

Categories : Bash



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.