~psusi/ubuntu/utopic/udisks2/fix-standby

« back to all changes in this revision

Viewing changes to src/udiskslinuxfilesystem.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-08-22 12:36:09 UTC
  • Revision ID: package-import@ubuntu.com-20120822123609-fq0id0yvp7day81x
Tags: 1.99.0-2
Add mount_in_media.patch: Mount drives in /media, not /run/media/, to stay
FHS compatible. (Closes: #680403, LP: #1020759)

Show diffs side-by-side

added added

removed removed

Lines of Context:
859
859
    }
860
860
 
861
861
  /* If we know the user-name and it doesn't have any '/' character in
862
 
   * it, mount in /run/media/$USER
 
862
   * it, mount in /media/$USER
863
863
   */
864
864
  if (user_name != NULL && strstr (user_name, "/") == NULL)
865
865
    {
866
 
      mount_dir = g_strdup_printf ("/run/media/%s", user_name);
 
866
      mount_dir = g_strdup_printf ("/media/%s", user_name);
867
867
      if (!g_file_test (mount_dir, G_FILE_TEST_EXISTS))
868
868
        {
869
 
          /* First ensure that /run/media exists */
870
 
          if (!g_file_test ("/run/media", G_FILE_TEST_EXISTS))
 
869
          /* First ensure that /media exists */
 
870
          if (!g_file_test ("/media", G_FILE_TEST_EXISTS))
871
871
            {
872
 
              if (g_mkdir ("/run/media", 0755) != 0)
 
872
              if (g_mkdir ("/media", 0755) != 0)
873
873
                {
874
874
                  g_set_error (error,
875
875
                               UDISKS_ERROR,
876
876
                               UDISKS_ERROR_FAILED,
877
 
                               "Error creating directory /run/media: %m");
 
877
                               "Error creating directory /media: %m");
878
878
                  goto out;
879
879
                }
880
880
            }
881
 
          /* Then create the per-user /run/media/$USER */
 
881
          /* Then create the per-user /media/$USER */
882
882
          if (g_mkdir (mount_dir, 0700) != 0)
883
883
            {
884
884
              g_set_error (error,