***ing file permissions

Discussion in 'Mac OS X 10.3 (Panther) Discussion' started by fritzintn, Nov 2, 2003.

  1. fritzintn macrumors newbie

    Aug 20, 2003
    This may be the inappropriate forum...

    I'm running Panther and thanks to the new fast user switching I thought it would be nice to enable a 'download' user for my girlfriend to run 'in the background' so to speak, uncluttering her user's desktop when downloading large files from our media server (DVD images mostly). These files get dumped to a shared folder where her main id and the 'download' id have read and write permissions. However I found it annoying that even though i created a folder with the owner as her id, it still shows the actual file owner as 'download'. This causes problems if she pulls mp3s this way to sync with her ipod since itunes will not let you modify the contents.

    I thought umask 777 would set all created files to have a 'all users read and write' permission, but i guess im doing something wrong.

    Annnnyway. Is it possible for another user to download files where the defaule permissions are 'read and write' for all users (chmod 777 ish). If not I guess I'll have to enable root and have her use that :confused:
  2. wrldwzrd89 macrumors G5


    Jun 6, 2003
    Solon, OH
    I find using the GUI for manipulating file permissions FAR less confusing than trying to do it via the command line. You can make permission changes in a file's Get Info window (you may need to temporarily change the owner to yourself to make modifications; you can always change it back when done).
  3. bankshot macrumors 65816


    Jan 23, 2003
    Southern California
    Hi. First, let's look at unix permissions. The reason that new files are owned by the 'download' user is because they were created by that user. Unix does not allow any normal (non-root) user to change the ownership of files, whether changing from themselves to another user, or vice versa. It's for security reasons, obviously.

    For the umask, what you wanted was actually the opposite of what you typed. As you can guess from its name, the umask tells which permission bits should be masked out when creating new files. A typical umask value is 022 - mask out nothing for myself, and mask out write permission for my group and others. If you want world writable files, use a umask of 000 - mask out nothing.

    Problem is, I don't think Safari honors the umask value. I tried it (umask 000; open /Applications/Safari.app) and downloaded files still had 644 (rw-r--r--) permissions. Besides, I don't know of a way to get this setting in the gui login. You can set it in your .bash_profile or .cshrc depending on your shell, but that obviously only affects the command line.

    I had a great solution figured out for you, but then I tested it and it didn't work. :eek: Oh well. I was going to suggest using NetInfo Manager (in /Applications/Utilities) to change the uid of the download user to be the same as your girlfriend's. Only problem? Fast user switching to the alternate account doesn't work -- it sees the same uid and takes you right back to the original logged in account. Doh!

    So personally, I think I would just have her do those downloads in a different browser. Mozilla, Firebird, Camino are all good choices. That way the files are still owned by her and no crazy permission problems to deal with. But if you insist on using the alternate user, wrldwzrd89's advice is good. You can have her take ownership of the shared directory through the Get Info window (which authenticates you and uses superuser permissions to do it) and then every once in awhile go back in and click "Apply to enclosed items..." It's not perfect, but should work.

    Or if you REALLY wanted to, you could setup a root cron job to chown the files to her every minute, but that seems a bit overkill... :p
  4. fritzintn thread starter macrumors newbie

    Aug 20, 2003
    Thanks for the help, sadly i think the cron job is my best bet as long as its fairly transparent to my girlfriend and runs automatically. I've also been reading up on the 'find' command. Can someone give me help setting up a cron job to give full permissions to everyone for the files within a direcory and the subfolders?

    ' find dir -type d -print0 | xargs -0 chmod 777
    chmod -R 777'

    I'm lost :)
  5. madru macrumors member

    Jun 11, 2003
    Have you tried this

    chmod -R a+rw dir_name

    this will add read + write to all directories mounted under dir_name
  6. fritzintn thread starter macrumors newbie

    Aug 20, 2003
    Groovy, that seems to work. Now to setup a cron job i would modify the 'crontab' file in /etc/ (or /etc/private?) correct, and add the line:

    15 * * * * root chmod -R a+rw /Users/download/Documents

    To change the file permissions every 15 minutes?
  7. madru macrumors member

    Jun 11, 2003

Share This Page