Problem with socket permissions!

Hi All!
I'm developing an applet that displays an image after downlading it from a server; this server is different from the server I download the applet from, so I have problems with security. In fact I get the following exception:
java.security.AccessControlException: access denied (java.net.SocketPermission 172.16.1.22:8080 connect,resolve)
I'm using:
- Java Plugin 1.3;
- Netscape 7.0;
- IE 6;
I've tried to self-sign the applet but with no results (maybe I cannot use selfsigned certificate with java plugin 1.3);
After that I've created a new policy file ("MyPolicy" file)and mentioned it into:
C:\Program Files\JavaSoft\JRE\1.3.1_03\lib\security\java.policy
but it didn't resolve my problem (maybe I'm doing something wrong in creating my policy file??!!).
Which steps do I have to follow in order to make my applet connect to images server without security problems?
Thanks so much in advance,
Carlo

1.     Compile the applet
2.     Create a JAR file
3.     Generate Keys
4.     Sign the JAR file
5.     Export the Public Key Certificate
6.     Import the Certificate as a Trusted Certificate
7.     Create the policy file
8.     Run the applet
Susan
Susan bundles the applet executable in a JAR file, signs the JAR file, and exports the public key certificate.
1.     Compile the Applet
In her working directory, Susan uses the javac command to compile the SignedAppletDemo.java class. The output from the javac command is the SignedAppletDemo.class.
javac SignedAppletDemo.java
2.     Make a JAR File
Susan then makes the compiled SignedAppletDemo.class file into a JAR file. The -cvf option to the jar command creates a new archive (c), using verbose mode (v), and specifies the archive file name (f). The archive file name is SignedApplet.jar.
jar cvf SignedApplet.jar SignedAppletDemo.class
3.     Generate Keys
Susan creates a keystore database named susanstore that has an entry for a newly generated public and private key pair with the public key in a certificate. A JAR file is signed with the private key of the creator of the JAR file and the signature is verified by the recipient of the JAR file with the public key in the pair. The certificate is a statement from the owner of the private key that the public key in the pair has a particular value so the person using the public key can be assured the public key is authentic. Public and private keys must already exist in the keystore database before jarsigner can be used to sign or verify the signature on a JAR file.
In her working directory, Susan creates a keystore database and generates the keys:
keytool -genkey -alias signFiles -keystore susanstore -keypass kpi135 -dname "cn=jones" -storepass ab987c
This keytool -genkey command invocation generates a key pair that is identified by the alias signFiles. Subsequent keytool command invocations use this alias and the key password (-keypass kpi135) to access the private key in the generated pair.
The generated key pair is stored in a keystore database called susanstore (-keystore susanstore) in the current directory, and accessed with the susanstore password (-storepass ab987c).
The -dname "cn=jones" option specifies an X.500 Distinguished Name with a commonName (cn) value. X.500 Distinguished Names identify entities for X.509 certificates.
You can view all keytool options and parameters by typing:
keytool -help
4.     Sign the JAR File
JAR Signer is a command line tool for signing and verifying the signature on JAR files. In her working directory, Susan uses jarsigner to make a signed copy of the SignedApplet.jar file.
jarsigner -keystore susanstore -storepass ab987c -keypass kpi135 -signedjar SSignedApplet.jar SignedApplet.jar signFiles
The -storepass ab987c and -keystore susanstore options specify the keystore database and password where the private key for signing the JAR file is stored. The -keypass kpi135 option is the password to the private key, SSignedApplet.jar is the name of the signed JAR file, and signFiles is the alias to the private key. jarsigner extracts the certificate from the keystore whose entry is signFiles and attaches it to the generated signature of the signed JAR file.
5.     Export the Public Key Certificate
The public key certificate is sent with the JAR file to the whoever is going to use the applet. That person uses the certificate to authenticate the signature on the JAR file. To send a certificate, you have to first export it.
The -storepass ab987c and -keystore susanstore options specify the keystore database and password where the private key for signing the JAR file is stored. The -keypass kpi135 option is the password to the private key, SSignedApplet.jar is the name of the signed JAR file, and signFiles is the alias to the private key. jarsigner extracts the certificate from the keystore whose entry is signFiles and attaches it to the generated signature of the signed JAR file.
5: Export the Public Key Certificate
The public key certificate is sent with the JAR file to the whoever is going to use the applet. That person uses the certificate to authenticate the signature on the JAR file. To send a certificate, you have to first export it.
In her working directory, Susan uses keytool to copy the certificate from susanstore to a file named SusanJones.cer as follows:
keytool -export -keystore susanstore -storepass ab987c -alias signFiles -file SusanJones.cer
Ray
Ray receives the JAR file from Susan, imports the certificate, creates a policy file granting the applet access, and runs the applet.
6.     Import Certificate as a Trusted Certificate
Ray has received SSignedApplet.jar and SusanJones.cer from Susan. He puts them in his home directory. Ray must now create a keystore database (raystore) and import the certificate into it. Ray uses keytool in his home directory /home/ray to import the certificate:
keytool -import -alias susan -file SusanJones.cer -keystore raystore -storepass abcdefgh
7.     Create the Policy File
The policy file grants the SSignedApplet.jar file signed by the alias susan permission to create newfile (and no other file) in the user's home directory.
Ray creates the policy file in his home directory using either policytool or an ASCII editor.
keystore "/home/ray/raystore";
// A sample policy file that lets a JavaTM program
// create newfile in user's home directory
// Satya N Dodda
grant SignedBy "susan"
     permission java.security.AllPermission;
8.     Run the Applet in Applet Viewer
Applet Viewer connects to the HTML documents and resources specified in the call to appletviewer, and displays the applet in its own window. To run the example, Ray copies the signed JAR file and HTML file to /home/aURL/public_html and invokes Applet viewer from his home directory as follows:
Html code :
</body>
</html>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="600" height="400" align="middle"
codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,1,2">
<PARAM NAME="code" VALUE="SignedAppletDemo.class">
<PARAM NAME="archive" VALUE="SSignedApplet.jar">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
</OBJECT>
</body>
</html>
appletviewer -J-Djava.security.policy=Write.jp
http://aURL.com/SignedApplet.html
Note: Type everything on one line and put a space after Write.jp
The -J-Djava.security.policy=Write.jp option tells Applet Viewer to run the applet referenced in the SignedApplet.html file with the Write.jp policy file.
Note: The Policy file can be stored on a server and specified in the appletviewer invocation as a URL.
9.     Run the Applet in Browser
Download JRE 1.3 from Javasoft

Similar Messages

  • Problem with file permissions

    Hello all,
    I am making a simple HttpServlet, which takes input
    from html page and saves in to a file, but I'm having a
    bit of a problem with file permissions.
    I'm getting the following exception
    java.security.AccessControlException: access denied (java.io.FilePermission ./data/result read)
         java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         java.security.AccessController.checkPermission(AccessController.java:427)
         java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         java.lang.SecurityManager.checkRead(SecurityManager.java:871)
         java.io.File.exists(File.java:700)
         SyksyHTTPServlet.doPost(SyksyHTTPServlet.java:31)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)The exception seems to occur when I'm trying to check whether the file already
    exists or not.
    The data directory has all permissions (read, write and execute) set for all users,
    and I have made an empty file called result inside the data directory for testing.
    This file has read and write permissions enabled for all users.
    Here's my code
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.Enumeration;
    import java.util.List;
    import java.util.ArrayList;
    public class SyksyHTTPServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              int totalCount = 0;
              List list;
              String song = request.getParameter("song");
              PrintWriter out = response.getWriter();
              File file = new File("./data/result");
              if(file.exists())  // this is line 31, which seems to cause the exception
                   list = readFile(file);
              else
                   file.createNewFile();
                   list = new ArrayList();
              list.add(song);
              writeFile(file, list);
              for(int i = 0 ; i < list.size() ; i++)
                   out.println(list.get(i));
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
         private List readFile(File file)
              List list = null;
              try
                   FileInputStream fis = new FileInputStream(file);
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   list = (ArrayList)ois.readObject();
                   ois.close();
              catch(Exception e)
                   e.printStackTrace();
              return list;
         private void writeFile(File file, List list)
              try
                   FileOutputStream fos = new FileOutputStream(file);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                   oos.writeObject(list);
                   oos.flush();
                   oos.close();
              catch(Exception e)
                   e.printStackTrace();
    }I'm using Tomcat 5.5 on Ubuntu Linux, if that has anything to do with this.
    I'll appreciate all help.
    kari-matti

    Hello again.
    I'm still having problems with this. I made
    a simple servlet that reads from and writes
    to text file. The reading part work fine on my
    computer, but the writing doesn't, not even
    an exception is thrown if the file exists that
    I'm trying to write to. If I try to create a new
    file I'll get an exception about file permissions.
    I also asked a friend of mine to try this same
    servlet on his windows computer and it works
    as it should.
    Here's the code
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class ReadServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              String s = "";
              PrintWriter out = response.getWriter();
              String docroot = getServletContext().getRealPath( "/" );
              out.println("docroot: "+docroot);
              File file = new File(docroot+"test.txt");
              if(file.exists())
                   s = readFile(file);
                   out.println(s);
              else
                   out.println("file not found");
                   //file.createNewFile();                    // causes exception
                   //out.println("new file created.");
              writeFile(file, "written by servlet");
              out.println("Now look in the file "+file.getPath());
              out.println("and see if it contains text 'written by servlet'");
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
         private String readFile(File file)
              FileInputStream fis = null;
              BufferedInputStream bis = null;
              DataInputStream dis = null;
              String s = "";
              try
                   fis = new FileInputStream(file);
                   bis = new BufferedInputStream(fis);
                   dis = new DataInputStream(bis);
                   s = dis.readLine();
                   fis.close();
                   bis.close();
                   dis.close();
              catch(Exception e)
                   e.printStackTrace();
              return s;
         private void writeFile(File file, String s)
              FileOutputStream fos = null;
              BufferedOutputStream bos = null;
              DataOutputStream dos = null;
              try
                   fos = new FileOutputStream(file);
                   bos = new BufferedOutputStream(fos);
                   dos = new DataOutputStream(bos);
                   dos.writeChars(s);
                   fos.flush();
                   bos.flush();
                   dos.flush();
                   fos.close();
                   bos.close();
                   dos.close();
              catch(Exception e)
                   e.printStackTrace();
    }And if someone wants to test this servlet I can
    give a war package.
    Any advices?
    kari-matti

  • Problem with socket packaging

    There seems to be a problem with the plastic cpu clip i work as a tech in a computer store we build many systems with msi boards, the plastic clip on the 915G series most times has fallen off and pins in the cpu socket have been damaged.
    You should use a plastic insert under the cpu hood to prevent it from falling off.

    Quote
    Not sure either why DelUK thinks this is not a suitable topic for this forum.
    Probably because Del interpreted "You should use a plastic insert under the cpu hood to prevent it from falling off." to mean that "You" was MSI, and not the members of this forum. Oddly enough, I interpreted this the same way.  I don't see where Del indicated the topic was not suitable, though.
    As Del said, and as mentioned in the Forum Rules, MSI does not participate here. If you feel there is a manufacturing problem, contact MSI directly.

  • Problem with Socket Sever

    Hello,
    I have a problem with a java socket.
    I have a server application that generate random number.
    I my client application, I connected to server application and red the random number.
    My problem is in my application client only read one time. After this, the socket server application close.
    How to do the server socket wait a new request from my client application?

    Put your accept in a while ....
    while (!this.interrupted()) {
    Socket socket;
    try {
    socket = serverSocket.accept();
    if (this.isInterrupted()) {
    return;
    new ClientConnection(); ///////Do your thing here ...
    } catch (IOException e) {
    return;
    HOPE this helps

  • Live Data / Problem with file permissions

    Just trying out an old version of Dreamweaver MX 2004. I am
    using my webhosting service for remote server/testing server
    duties. It is running PHP 4.3.10 and MySQL 3.23.58. I was able to
    set up the database connection and test-retrieve a recordset with
    no problems. In following the tutorial I found that Livedata
    wouldn't work, it just giving me a warning about file permissions
    being wrong. It turns out that when Dreamweaver creates a temporary
    file of the work-in-progress to upload to the remote server the
    file is created on the server with owner=rw, group=rw, world=r
    which explains why it won't run - group has to be set to group=r.
    The file is created on the fly and then immediately deleted by
    Dreamweaver so it is impossible to manually set the permission on
    the server and probably fairly pointless too.
    I tried just saving the file and previewing in the browser
    which again causes it to be uploaded to the remote server. The
    first time this resulted in the browser offering a file download
    box instead of running the page. The reason is - again - that
    Dreamweaver is setting the uploaded file permissions to include
    group=rw. If I manually set the permission for group to group=r it
    runs fine.
    It turns out that Dreamweaver is always setting the file
    permissions on file uploads (checked php and html) to the
    remote/testing server to include group=rw. Once I set it manually
    on the remote/testing server to group=r for a php file everything
    is fine and subsequent uploads of the same file do not change it
    again.
    I checked with the webhosting company and their second-line
    have reported back to me that the default file permission they set
    on uploaded files includes group=r so it must be DW that is causing
    the problem by setting group=rw the first time. I confirmed this by
    using WS-FTP to upload the same file (renamed) to the same target
    directory and the permissions set were owner=rw, group=r, world=r.
    So
    Can anyone please tell me how to change the permissions DW
    sets on files written to a remote server because I have spent
    countless hours on it without success. From looking at other posts
    in this forum it could be that other users are hitting the same
    kind of problem with DW8

    Stop using Live Data with a hosting account. Set up PHP and
    MySQL locally on
    your machine. That is how it's supposed to work. You
    shouldn't test files on
    the fly on a host as you write them. Change your test account
    in DW to use
    the local server. Upload your files to your remote server
    after they are
    fully tested.
    Tom Muck
    http://www.tom-muck.com/
    "nigelssuk" <[email protected]> wrote in
    message
    news:[email protected]...
    > Just trying out an old version of Dreamweaver MX 2004. I
    am using my
    > webhosting
    > service for remote server/testing server duties. It is
    running PHP 4.3.10
    > and
    > MySQL 3.23.58. I was able to set up the database
    connection and
    > test-retrieve a
    > recordset with no problems. In following the tutorial I
    found that
    > Livedata
    > wouldn't work, it just giving me a warning about file
    permissions being
    > wrong.
    > It turns out that when Dreamweaver creates a temporary
    file of the
    > work-in-progress to upload to the remote server the file
    is created on the
    > server with owner=rw, group=rw, world=r which explains
    why it won't run -
    > group
    > has to be set to group=r. The file is created on the fly
    and then
    > immediately
    > deleted by Dreamweaver so it is impossible to manually
    set the permission
    > on
    > the server and probably fairly pointless too.
    >
    > I tried just saving the file and previewing in the
    browser which again
    > causes
    > it to be uploaded to the remote server. The first time
    this resulted in
    > the
    > browser offering a file download box instead of running
    the page. The
    > reason is
    > - again - that Dreamweaver is setting the uploaded file
    permissions to
    > include
    > group=rw. If I manually set the permission for group to
    group=r it runs
    > fine.
    >
    > It turns out that Dreamweaver is always setting the file
    permissions on
    > file
    > uploads (checked php and html) to the remote/testing
    server to include
    > group=rw. Once I set it manually on the remote/testing
    server to group=r
    > for a
    > php file everything is fine and subsequent uploads of
    the same file do not
    > change it again.
    >
    > I checked with the webhosting company and their
    second-line have reported
    > back
    > to me that the default file permission they set on
    uploaded files includes
    > group=r so it must be DW that is causing the problem by
    setting group=rw
    > the
    > first time. I confirmed this by using WS-FTP to upload
    the same file
    > (renamed)
    > to the same target directory and the permissions set
    were owner=rw,
    > group=r,
    > world=r.
    >
    > So
    >
    > Can anyone please tell me how to change the permissions
    DW sets on files
    > written to a remote server because I have spent
    countless hours on it
    > without
    > success. From looking at other posts in this forum it
    could be that other
    > users
    > are hitting the same kind of problem with DW8
    >

  • Problem with file permissions using Snow Lepord

    I'm having problems with file Sharing & Permissions using Snow Lepord.
    When I save any new file it only has 'Read & Write' privileges for the user, everyone else is 'read only' or 'no access'.
    We have a Netgear NAS Server which is accessed by other users over the local network and if I change the Privilege to 'read & write' via Get Info and then copy the file from my desktop to ther server it changes the Privilege of the server version to 'no access' we then have to change it again for it to work.
    I also created a new folder on the server and now it says 'no access' and has a no entry icon!
    Any ideas???

    We have issues like this. Have tried running AFP and SMB, now connecting using CIFS. All have the same problem. I can work on one or two files fine, then suddenly, one of the files I just worked on says I don't have permissions. I log off the server and log back on, and then I have permissions to the file. It will work fine for one or two operations, then fails. We just updated to OSX Mavericks and a Windows 2012 server, but have been having this issue for years. My permissions look fine. I can even change permissions, but it won't let me work on the file or move or delete the file or rename the file. Once I log out and log back in, I can do anything I want.

  • Two problems with iTunes (permissions issue?)

    Hello,
    I have two problems with iTunes. I am not sure if they are related that's why I post them both.
    1) iTunes doesn't delete apps after updating them anymore. This is happening since the (two?) last versions of iTunes and is the same with 10.5. The reason seems to be the permissions of the apps. Nearly all have "everyone = custom". Therefore I have to enter my admin password when I try to delete them manually. And iTunes itself cannot delete them on its own, of course. Why is this happening? Why is iTunes assigning such permissions to downloaded apps?
    2) I can't login to my account from within iTunes anymore. That is also happening since quite a while. I am logged in (my ID is shown in the top right of the store) but cannot access my account details. iTunes asks for my password but after entering it the login mask appears again. It's not the password itself, it is correct.
    Any suggestions?

    Correct answer to find here:
    https://discussions.apple.com/thread/1215039?start=0&tstart=0

  • Having Problems With Sharing & Permissions in Finder

    I am using a Mac Mini (mid-2011) running Lion Server 10.7.4.
    I have noticed lately that when I check files the Sharing & Permissions portion using Get Info on my files I find that there are two lines for each user on my compuer.  The first set of lines says Read & Write which I actually selected.  The second set of lines says Custom.  When I check I have the list Read & Write, Read, Custom.  When I try to change Custom I cam select new option No Privileges Info.  For the other users I am able to delete the extra line once I select No Privileges Info.  However even though I have more than one line I cannot delete the extra line for the main user.  I will try and delete the extra line for the main user logged in as someone else that has what I have defined as admin privileges (reason I have more than one user).
    This really concerns me because this issue is causing problems with me adding or removing files as needed in the terminal.  When I try I get this funky error:
    Dubious permissions on file (skipping): filename with duplicate entries for a user.
    This is happening more and more even though I am not changing the file permissions that I am aware of.
    Any help would be appreciated.

    Repairing the permissions of a home folder in Lion is a complicated procedure. I don’t know of a simpler one that always works.
    Back up all data now. Before proceeding, you must be sure you can restore your system to its present state
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the page that opens.
    Drag or copy — do not type — the following line into the Terminal window, then press return:
    chmod -R -N ~
    The command will take a noticeable amount of time to run. When a new line ending in a dollar sign ($) appears below what you entered, it’s done. You may see a few error messages about an “invalid argument” while the command is running. You can ignore those. If you get an error message with the words “Permission denied,” enter this:
    sudo !!
    You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up.
    Next, boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the Recovery screen appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, enter “resetpassword” (without the quotes) and press return. A Reset Password window opens. You’re not going to reset the password.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • Problems with update / permissions

    Hi
    I have a problem with my 15" mid 2010 macbook Pro with 8GB RAM, running Lion with 10.7.4.
    Problem:
    I cannot update the SW running the Apple update - I finds the new updates for iMovie, iPhoto, Java etc, but when asking it to install them, it prompts me that I cannot install due to not having the correct permissions.
    The problem occured approx 3-4 weeks ago. Before that I had never experienced this before...
    I have repaired the permissions, but that didn't help - does anyone have a solution to this?
    FYI I'm still a novice on the Mac - so I'm learning everyday....
    Br
    Per

    Besides repairing permissions with disk utility, you need to reset your user permissions. Follow instructions here:
    Repairing User Permissions in OS X Lion
    You’ll need to reboot to perform this, and then use the same resetpassword utility that is used to change passwords in Lion, but instead choosing a hidden option.
    When you use the Disk Utility app and Repair Permissions — it doesn’t actually repair the permission settings on folders and files in your Home folder where your documents and personal applications reside.
    In Lion, there is an additional Repair Permissions application utility hidden away. This toolis located inside boot Repair Utilities. Here’s how to access it.
    Restart Lion and hold down the Command and R keys.
    You will boot into the Repair Utilities screen. On top, in the Menu Bar click the Utilities item then select Terminal.
    In the Terminal window, type resetpassword and hit Return.
    The Password reset utility launches, but you’re not going to reset the password. Instead, click on the icon for your Mac’s hard drive at the top. From the drop-down below it, select the user account where you are having issues.
    At the bottom of the window, you’ll see an area labeled ‘Reset Home Directory Permissions and ACLs’. Click the Reset button there.
    The reset process takes a couple of minutes. When it’s done, quit the programs you’ve opened and restart your Mac. Notice that ‘Spotlight’ starts re-indexing immediately.

  • Problems with Calendar Permissions

    Hi There. I am having a problem with the Calendar of one user:
    This user cannot share his calendar from OWA or Outlook, nor can I set then in Powershell. Even worse, I can't even view his calendar permissions in PowerShell. For all other folders there's no problem.
    So for example, I can run:
    get-mailboxfolderstatistics -identity user | select-object name
    this proves to me there's a path of username:\calendar and it does exist. Then I can run:
    get-mailboxfolderpermission username:\inbox
    and this is fine. But if I run:
    get-mailboxfolderpermission username:\calendar
    I get this error:
    "The operation couldn't be performed because object 'username:\calendar' couldn't be found on 'Microsoft.Exchange.Data.Storage.MailboxSession'"
    I have to stress this is a medium sized deployment with 6 databases and 4000+ mailboxes. This is the ONLY mailbox (and specifically the only folder) to be displaying this behaviour.
    Has anyone ever seen similar behaviour for a single folder for a single user before?

    Hi,
    Please right-click the Calendar folder for this mailbox in Outlook Online mode, and check the Permissions tab in the Properties. We need to check whether the name Default is listed there with permissions.
    If the Default is missing in the permission list, please refer to Will’s suggestion to recreate the calendar folder with MFCMapi. If the permission list is normal for this mailbox, please move the problematic mailbox to another database to have a try.
    Personal suggestion, please try the following command:
    Get-MailboxFolderPermission -Identity Username:\Kalender
    | FL
    Regards,
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Winnie Liang
    TechNet Community Support

  • Problem with socket cross domain

    Hi guys,
    This is my cross domain file:
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
    <!-- Policy file for xmlsocket://socks.example.com -->
    <cross-domain-policy>
       <site-control permitted-cross-domain-policies="*"/>
       <allow-access-from domain="localhost" to-ports="80" />
    </cross-domain-policy>
    I am placing it in my server.
    From flex i am running this:
    Security.loadPolicyFile("my server address");
    And yet I am getting this event:
    SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048"
    What can I do?

    Hello ILikeMyScreenNameNdCoffee,
    I had the same problem with XMLSocket and I used a policy server that runs
    on the remote server on port 843 and from Flex I load file before connecting
    the xmlsocket Security.loadPolicyFile("my server address:843"). If you want
    I can upload a version of my policy server or you can use the server policy
    from here
    http://www.broculos.net/tutorials/how_to_make_a_multi_client_flash_java_server/20080320/en
    Also you can read here more about file policy:
    http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html.
    On Thu, Aug 19, 2010 at 5:40 PM, ILikeMyScreenNameNdCoffee <[email protected]

  • [solved] findutils - problem with file permissions

    Hey,
    I tried running makepkg -c for an updated PKGBUILD of a package I maintain in the AUR (gretl), and it seemed fine but then hit:
    ==> Tidying install...
    -> Purging other files...
    -> Compressing man and info pages...
    -> Stripping debugging symbols from binaries and libraries...
    -> Removing libtool .la files...
    -> Removing empty directories...
    find: invalid predicate `-delete'
    I'd had some other strange errors with find over the past few weeks or so (my last -Syu was after this month's catalyst driver came out with support for the current kernel) but had shrugged them off. This error made me decide to try reinstalling findutils, and it gave the error:
    error: cannot remove file 'usr/bin/find': Operation not permitted
    a bit stupidly, I tried pacman -Rd then -S findutils, and now I get
    error: failed to commit transaction (conflicting files)
    findutils: /usr/bin/find exists in filesystem
    Errors occurred, no packages were upgraded.
    missing dependency for ca-certificates : findutils
    missing dependency for initscripts : findutils
    missing dependency for mkinitcpio : findutils
    missing dependency for texinfo : findutils
    ls -als /usr/bin | grep find     gives:
    12 -rwxr-xr-x 1 root root 10636 Mar 25 16:24 deepfind
    64 -rwxr-xr-x 1 root root 59200 May 9 01:58 efinder
    64 -rwxr-xr-x 1 500 500 59536 Jun 16 14:49 find
    and rm, mv, chmod, chown etc on /usr/bin/find as root, and from livecd, all also come back with "Operation not permitted".
    find seems to work fine for a few simple uses I've just tried.. but the last time I ran makepkg -c without the error was before the last system upgrade, so I'm guessing find didn't upgrade properly then due to whatever is wrong with the permissions, leading to the other errors.
    Anyway, I guess the question is, can I do anything to get rid of /usr/bin/find and reinstall findutils? don't mind so much about missing dependencies as I tend not to upgrade that often, but find not doing what it should is a bit of a pain.
    Last edited by manehi (2009-08-30 08:52:20)

    mm I tried all that, and no luck. though trying adduser 500 did give me a helpful reminder that usernames can't start with numbers...
    anyway, it's not a huge deal atm, and I can always clean reinstall the / partition if things really break. Thanks all the same.
    PS:
    huh, just had a thought - I remember how I used to get annoyed how mounting partitions using ext2ifs in windows didn't respect permissions properly. and now I almost wish I had a windows partition / that this wasn't a laptop hard drive...
    Last edited by manehi (2009-08-30 00:31:13)

  • Problem with socket connection in midp 2.0

    hello everyone.
    I'm new one in j2me and I am learning socket connection in j2me. I'm using basic socket,datagram example wich is come with sun java wireless toolkit 2.5. for it i wrote small socket server program on c# and tested it example on my pc and its working fine. also socket server from another computer via internet working fine. But when i instal this socket example into my phone on nokia n78 (Also on nokia 5800) it's not working didn't connect to socket server.. On phone I'm using wi-fi internet. Can anybody help me with this problem? I hear it's need to modify manifest file and set appreciate pressions like this
    MIDlet-Permissions: javax.microedition.io.Connector.socket,javax.microedition.io.Connector.file.write,javax.microedition.io.Connector.ssl,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.http,javax.microedition.io.Connector.https
    is it true?
    can anybody suggest me how can i solve this problem?
    where can I read full information about socket connection specifiecs in j2me?
    Thanks.

    Maybe this can be helpful:
    [http://download-llnw.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/index.html]
    you can check there the Datagram interface anda DatagramConnection interface and learn a little about that.
    If the client example runs fine in the wireless toolkit emulator, it should run the same way in your phone; i suggest to try to catch some exception that maybe is hapenning and display it on a Alert screen, this in the phone.

  • I suppose it is the problem with socket connection,Please help

    Hi,
    I'm trying to build a chat server in Java on Linux OS.I've created basically 2 classes in the client program.The first one shows the login window.When we enter the Login ID & password & click on the ok button,the data is sent to the server for verification.If the login is true,the second class is invoked,which displays the messenger window.This class again access the server
    for collecting the IDs of the online persons.But this statement which reads from the server causes an exception in the program.If we invoke the second class independently(ie not from 1st class) then there is no problem & the required data is read from the server.Can anyone please help me in getting this program right.I'm working on a p4 machine with JDK1.4.
    The Exceptions caused are given below
    java.net.SocketException: Connection reset by peer: Connection reset by peer
    at java.net.SocketInputStream.SocketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:119)
         at java.io.InputStreamReader$CharsetFiller.readBytes(InputStreanReader.java :339)
         at java.io.InputStreamReader$CharsetFiller.fill(InputStreamReader.java:374)
         at java.io.InputStreamReader.read(InputStreamReader.java:511)
         at java.io.BufferedReader.fill(BufferedReader.java:139)
         at java.io.BufferedReader.readLine(BufferedReader.java:299)
         at java.io.BufferedReader.readLine(BufferedReader.java:362)
         at Login.LoginData(Login.java:330)
         at Login.test(Login.java:155)
         at Login$Buttonhandler.actionPerformed(Login.java:138)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1722)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:17775)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:4141)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:253)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:261)
         at java.awt.Component.processMouseEvent(Component.java:4906)
         at java.awt.Component.processEvent(component.java:4732)
         at java.awt.Container.processEvent(Container.java:1337)
         at java.awt.component.dispatchEventImpl(Component.java:3476)
         at java.awt.Container.dispatchEventImpl(Container.java:1399)
         at java.awt.Component.dispatchEvent(Component.java:3343)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3302)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3014)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2967)
         at java.awt.Container.dispatchEventImpl(Container.java:1373)
         at java.awt.window.dispatchEventImpl(Window.java:1459)
         at java.awt.Component.dispatchEvent(Component.java:3343)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:439)
         at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:131)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
         My program looks somewhat like this :
    1st class definition:
    public class Login extends Jframe// Login is the name of the first class;
    Socket connection;
    DataOutputStream outStream;
    BufferedReader inStream;
    Frame is set up here
    public class Buttonhandler implements ActionListener
    public void actionPerformed(ActionEvent e) {
    String comm = e.getActionCommand();
    if(comm.equals("ok")) {
    check=LoginCheck(ID,paswd);
    test();
    public void test() //checks whether the login is true
    if(check)
    new Messenger(ID);// the second class is invoked
    public boolean LoginCheck(String user,String passwd)
    //Enter the Server's IP & port below
    String destination="localhost";
    int port=1234;
    try
    connection=new Socket(destination,port);
    }catch (UnknownHostException ex){
    error("Unknown host");
    catch (IOException ex){
    ex.printStackTrace ();
    error("IO error creating socket ");
    try{
    inStream = new BufferedReader(new InputStreamReader(connection.getInputStream()));
    outStream=new DataOutputStream(connection.getOutputStream());
    }catch (IOException ex){
    error("IO error getting streams");
    ex.printStackTrace();
    System.out.println("connected to "+destination+" at port "+port+".");
    BufferedReader keyboardInput=new BufferedReader(new InputStreamReader(System.in));
    String receive=new String();
    try{
    receive=inStream.readLine();
    }catch(IOException ex){ error("Error reading from server");}
    if(receive.equals("Logintrue"))
    check=true;
    else
    check=false;
    try{
    inStream.close();
    outStream.close();
    connection.close();
    }catch (IOException ex){
    error("IO error closing socket");
    return(check);
    // second class is defined below
    public class Messenger
    Socket connect;
    DataOutputStream outStr;
    BufferedReader inStr;
    public static void main(String args[])
    { Messenger mes = new Messenger(args[0]);}
    Messenger(String strg)
    CreateWindow();
    setupEvents();
    LoginData(strg);
    fram.show();
    void setupEvents()
    fram.addWindowListener(new WindowHandler());
    login.addActionListener(new MenuItemHandler());
    quit.addActionListener(new MenuItemHandler());
    button.addActionListener(new Buttonhandle());
    public void LoginData(String name)
    //Enter the Server's IP & port below
    String dest="localhost";
    int port=1234;
    int r=0;
    String str[]=new String[40];
    try
    connect=new Socket(dest,port);
    }catch (UnknownHostException ex){
    error("Unknown host");
    catch (IOException ex){
    ex.printStackTrace ();
    error("IO error creating socket ");
    try{
    inStr = new BufferedReader(new InputStreamReader(connect.getInputStream()));
    outStr=new DataOutputStream(connect.getOutputStream());
    }catch (IOException ex){
    error("IO error getting streams");
    ex.printStackTrace();
    String codeln=new String("\n");
    try{
    outStr.flush();
    outStr.writeBytes("!@*&!@#$%^");//code for sending logged in users
    outStr.writeBytes(codeln);
    outStr.write(13);
    outStr.flush();
    String check="qkpltx";
    String receive=new String();
    try{
    while((receive=inStr.readLine())!=null) //the statement that causes the exception
    if(receive.equals(check))
    break;
    else
         str[r]=receive;
         r++;
    }catch(IOException ex){ex.printStackTrace();error("Error reading from socket");}
    catch(NullPointerException ex){ex.printStackTrace();}
    } catch (IOException ex){ex.printStackTrace();
    error("Error reading from keyboard or socket ");
    try{
    inStr.close();
    outStr.close();
    connect.close();
    }catch (IOException ex){
    error("IO error closing socket");
    for(int l=0,k=1;l<r;l=l+2,k++)
    if(!(str[l].equals(name)))
    stud[k]=" "+str[l];
    else
    k--;
    public class Buttonhandle implements ActionListener
    public void actionPerformed(ActionEvent e) {
    //chat with the selected user;
    public class MenuItemHandler implements ActionListener
    public void actionPerformed(ActionEvent e)
    String cmd=e.getActionCommand();
    if(cmd.equals("Disconnect"))
    //Disconnect from the server
    else if(cmd.equals("Change User"))
         //Disconnect from the server & call the login window
    else if(cmd.equals("View Connection Details"))
    //show connection details;
    public class WindowHandler extends WindowAdapter
    public void windowClosing(WindowEvent e){
    //Disconnect from server & then exit;
    System.exit(0);}
    I�ll be very thankful if anyone corrects the mistake for me.Please help.

    You're connecting to the server twice. After you've successfully logged in, pass the Socket to the Messenger class.
    public class Messenger {
        Socket connect;
        public static void main(String args[]) {
            Messenger mes = new Messenger(args[0]);
        Messenger(Socket s, String strg) {
            this.connect = s;
            CreateWindow();
            setupEvents();
            LoginData(strg);
            fram.show();
    }

  • Problem with socket responses with flex

    Hi, I am using the code below to connect to an IMAP server.
    When I telnet to the server and use the commands that I am sending in the code, the rsponses are correct.
    However, when I run the code below, I only obtain the ready and logged in responses as shown below.
    Any ideas why I am not receiving the full set of responses from the socket?
    Thanks in advance fro your advice.
    The following is the output from the code:
    +++++++++++++++++ START SENDING IMAP DATA +++++++++++++++++++++++++
    sent: . login user1 myPassword
    sent: . status INBOX (messages)
    sent: . select INBOX
    +++++++++++++++++ END SENDING IMAP DATA +++++++++++++++++++++++++
    ++++++++ [IMAP START]
    Response is: * OK Dovecot ready.
    [IMAP END] +++++++++
    ++++++++ [IMAP START]
    Response is: . OK Logged in.
    [IMAP END] +++++++++
    The code is:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx"
       applicationComplete="init()">
    <fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
    <![CDATA[
    public var dataStr:String;
    private var socket:Socket;
    private var serverURL:String= "dead.org";
    private var serverPort:int = 143;
    private var serverResponse:ByteArray = new ByteArray();
    private function init():void
      this.serverURL = serverURL;
      this.serverPort = serverPort;
      socket = new Socket();
      socket.addEventListener(ProgressEvent.SOCKET_DATA,handleNewIMAPData); //Event when socket receives new data
      this.connectToServer();
      sendIMAPdata();
    private function sendString(dataStr:String):void
      var bytes:ByteArray = new ByteArray();
      bytes.writeMultiByte(dataStr, "UTF-8");
      socket.writeBytes(bytes);
      socket.flush();
      trace("sent: " + dataStr);
    public function sendIMAPdata():void
      trace("\t +++++++++++++++++ START SENDING IMAP DATA +++++++++++++++++++++++++");
      dataStr =". login user1 myPassword" + "\r\n";
      sendString(dataStr);
      dataStr =". status INBOX (messages)" + "\r\n";
      sendString(dataStr);
      dataStr =". select INBOX" + "\r\n";
          sendString(dataStr);
      trace("\t +++++++++++++++++ END SENDING IMAP DATA +++++++++++++++++++++++++");
    private function handleNewIMAPData(event:ProgressEvent):void
      var numBytes:int = socket.bytesAvailable;
      serverResponse = new ByteArray();
      while(socket.bytesAvailable)
        var byte:int = socket.readUnsignedByte();
    serverResponse.writeByte(byte);
      var response:String = serverResponse.toString();
      trace(" ++++++++ [IMAP START]\n Response is: " + response + "[IMAP END] +++++++++\n");
    private function connectToServer():void
      socket.connect(serverURL, serverPort);
    ]]>
    </fx:Script>
    </s:WindowedApplication>

    When I run telnet, the console responses are the same as the tcpdump messages.
    When I run the program, the messages from tcpdump match the messages in my trace statements.
    The messages from telnet and running the program are different:-)
    I can only assume (at the moment) that I am sending multiple messages too quickly(?), but I did a quick and dirty big "for loop" to slow down the sending of subsequent messages, but with no resulting change in the programs behaviour.
    So, still thinking about the problem -  unfortunately.

Maybe you are looking for