#363 Open of /var/mail/hackware.del failed : Permission denied

1.380
closed-works-for-me
Read Mail (122)
5
2009-02-17
2009-02-17
No

ns1:/.../...> uname -mnrs
FreeBSD ns1.tru2life.net 7.1-RELEASE i386

Webmin:
Version 1.450 on ns1.tru2life.net (FreeBSD 7.1)

Usermin:
Version 1.380 on ns1.tru2life.net (FreeBSD 7.1)

ns1:/.../...> ls -al /var/mail/*hackware*
-rw------- 1 hackware hackware 767676 Feb 17 02:54 /var/mail/hackware

Usermin:Read_Mail: opened a message and hit [Delete].

Got error message:
Open of /var/mail/hackware.del failed : Permission denied

ns1:/.../...> ls -al /var/mail/*hackware*
-rw------- 1 hackware hackware 767676 Feb 17 02:54 /var/mail/hackware

Usermin:Read_Mail:Preferences: Changed
When deleting mail:
TO:Just delete from mail file
FROM:Move to Trash folder

Usermin:Read_Mail: opened a message and hit [Delete].

Got error message: (same same)
Open of /var/mail/hackware.del failed : Permission denied

ns1:/.../...> ls -al /var/mail/*hackware*
-rw------- 1 hackware hackware 767676 Feb 17 02:54 /var/mail/hackware

Tried below just to see:
ns1:/.../...> touch /var/mail/hackware.del
ns1:/.../...> chmod 0600 /var/mail/hackware.del
ns1:/.../...> chown hackware:hackware /var/mail/hackware.del
ns1:/.../...> ls -al /var/mail/*hackware*
-rw------- 1 hackware hackware 767676 Feb 17 02:54 /var/mail/hackware
-rw------- 1 hackware hackware 0 Feb 17 03:29 /var/mail/hackware.del

Usermin:Read_Mail: opened a message and hit [Delete].

Returned to Mail_In_Inbox (message "read" but there).

ns1:/.../...> ls -al /var/mail/*hackware*
-rw------- 1 hackware hackware 767676 Feb 17 02:54 /var/mail/hackware
-rw------- 1 hackware hackware 765931 Feb 17 03:30 /var/mail/hackware.del

Webmin:Servers:Read_User_Mail:hackware:
Open (same) message, hit [Delete].

NO error, and message is gone on return to Read_User_Mail.

ns1:/.../...> ls -al /var/mail/*hackware*
-rw------- 1 hackware hackware 765931 Feb 17 03:34 /var/mail/hackware

The file /var/mail/hackware.del is gone, and the file /var/mail/hackware is size that /var/mail/hackware.del was (of course)...

Tried many times, and with different user accounts...

Discussion

  • Jamie Cameron

    Jamie Cameron - 2009-02-17
    • status: open --> closed-works-for-me
     
  • Jamie Cameron

    Jamie Cameron - 2009-02-17

    You need to make sure that /var/mail is world-writable, so that Usermin can create the .del file in that directory for use as a temporary copy of the mailbox when re-writing it. Normal practice is for it to be mode 777, but with the sticky bit set to stop users from deleting each other's mail files.

     
  • William O. Yates

    Old system which worked fine yesterday: (Just checked again, still works...)
    Webmin: Version 1.450 on ns2.tru2life.net (FreeBSD 6.2)
    Usermin: Version 1.380 on ns2.tru2life.net (FreeBSD 6.2)
    ns2:/.../...> uname -mnrs
    FreeBSD ns2.tru2life.net 6.2-RELEASE i386
    ns2:/.../...> ls -al /var
    total 1
    drwxr-xr-x 25 root wheel 512 Feb 14 11:55 .
    drwxr-xr-x 19 root wheel 512 Feb 9 06:05 ..
    drwxrwxr-x 2 root operator 512 Sep 12 12:08 .snap
    drwxr-xr-x 2 root wheel 512 Jan 11 2007 account
    drwxr-xr-x 4 root wheel 512 Feb 23 2007 at
    drwxr-x--- 2 root audit 512 Jan 11 2007 audit
    drwxr-x--- 2 root wheel 512 Feb 10 03:01 backups
    drwxr-x--- 2 root wheel 512 Feb 23 2007 crash
    drwxr-x--- 3 root wheel 512 Feb 23 2007 cron
    drwxr-xr-x 9 root wheel 512 Feb 14 19:55 db
    dr-xr-xr-x 2 root wheel 512 Jan 11 2007 empty
    drwxrwxr-x 2 root games 512 Feb 23 2007 games
    drwx------ 2 root wheel 512 Jan 11 2007 heimdal
    drwxr-xr-x 3 root wheel 512 Oct 26 2007 lib
    drwxr-xr-x 5 root wheel 1536 Feb 17 05:00 log
    drwxrwxr-x 2 root mail 512 Feb 17 03:03 mail
    drwxr-xr-x 2 daemon wheel 512 Feb 26 2007 msgs
    drwxr-xr-x 5 root wheel 512 Feb 23 2007 named
    drwxr-xr-x 2 root wheel 512 Jan 11 2007 preserve
    drwxr-xr-x 5 root wheel 512 Feb 15 04:11 run
    drwxrwxr-x 2 root daemon 512 Jan 11 2007 rwho
    drwxr-sr-t 6 root wheel 512 Feb 9 06:07 service
    drwxr-xr-x 8 root wheel 512 Feb 23 2007 spool
    drwxrwxrwt 3 root wheel 1024 Feb 14 19:55 tmp
    drwxr-xr-x 2 root wheel 512 Feb 23 2007 yp

    New system which has problem:
    Webmin: Version 1.450 on ns1.tru2life.net (FreeBSD 7.1)
    Usermin: Version 1.380 on ns1.tru2life.net (FreeBSD 7.1)
    ns1:/.../...> uname -mnrs
    FreeBSD ns1.tru2life.net 7.1-RELEASE i386
    ns1:/.../...> ls -al /var
    total 1
    drwxr-xr-x 23 root wheel 512 Feb 13 07:05 .
    drwxr-xr-x 20 root wheel 512 Feb 15 04:47 ..
    drwxrwxr-x 2 root operator 512 Jan 31 13:01 .snap
    drwxr-xr-x 2 root wheel 512 Jan 1 03:48 account
    drwxr-xr-x 4 root wheel 512 Jan 31 13:01 at
    drwxr-x--- 2 root audit 512 Jan 1 03:48 audit
    drwxr-x--- 2 root wheel 512 Feb 17 03:01 backups
    drwxr-x--- 2 root wheel 512 Jan 31 13:01 crash
    drwxr-x--- 3 root wheel 512 Jan 31 13:01 cron
    drwxr-xr-x 11 root wheel 512 Feb 13 15:12 db
    dr-xr-xr-x 2 root wheel 512 Jan 1 03:48 empty
    drwxrwxr-x 2 root games 512 Jan 31 13:02 games
    drwx------ 2 root wheel 512 Jan 1 03:48 heimdal
    drwxr-xr-x 5 root wheel 1024 Feb 17 10:00 log
    drwxrwxr-x 2 root mail 512 Feb 17 03:34 mail
    drwxr-xr-x 2 daemon wheel 512 Jan 31 21:08 msgs
    drwxr-xr-x 5 root wheel 512 Jan 31 13:01 named
    drwxr-xr-x 2 root wheel 512 Jan 1 03:48 preserve
    drwxr-xr-x 4 root wheel 512 Feb 17 03:07 run
    drwxrwxr-x 2 root daemon 512 Jan 1 03:48 rwho
    drwxr-xr-x 8 root wheel 512 Jan 31 13:01 spool
    drwxrwxrwt 3 root wheel 512 Feb 16 09:10 tmp
    drwxr-xr-x 2 root wheel 512 Jan 31 13:01 yp

    Perhaps I can not read man pages correctly, but it does NOT appear to have the sticky bit set on the old machine.
    LS(1), CHMOD(2), STICKY(8)

    As per the STICKY(8) man page below, would not a "sticky" directory PREVENT the file /var/mail/hackware.del from being deleted?

    Have used your great programs for years without messing with permissions.

    STICKY(8) FreeBSD System Manager's Manual STICKY(8)

    NAME
    sticky -- sticky text and append-only directories

    DESCRIPTION
    A special file mode, called the sticky bit (mode S_ISTXT), is used to
    indicate special treatment for directories. It is ignored for regular
    files. See chmod(2) or the file <sys/stat.h> for an explanation of file
    modes.

    STICKY DIRECTORIES
    A directory whose `sticky bit' is set becomes an append-only directory,
    or, more accurately, a directory in which the deletion of files is
    restricted. A file in a sticky directory may only be removed or renamed
    by a user if the user has write permission for the directory and the user
    is the owner of the file, the owner of the directory, or the super-user.
    This feature is usefully applied to directories such as /tmp which must
    be publicly writable but should deny users the license to arbitrarily
    delete or rename each others' files.

    Any user may create a sticky directory. See chmod(1) for details about
    modifying file modes.

    HISTORY
    A sticky command appeared in Version 32V AT&T UNIX.

    BUGS
    Neither open(2) nor mkdir(2) will create a file with the sticky bit set.

    FreeBSD 7.0 June 5, 1993 FreeBSD 7.0

     
  • William O. Yates

    OK: followup on followup... :-)

    $ uname -mnrs
    FreeBSD ns2.tru2life.net 6.2-RELEASE i386
    $ whoami
    hackware
    $ touch /var/mail/hackware.del
    touch: /var/mail/hackware.del: Permission denied

    $ uname -mnrs
    FreeBSD ns1.tru2life.net 7.1-RELEASE i386
    $ whoami
    hackware
    $ touch /var/mail/hackware.del
    touch: /var/mail/hackware.del: Permission denied

    (Had a HOPE above would FAIL on NEW machine, and WORK on OLD machine.)
    So now I am totally confused... sigh...
    How the heck does usermin sneak in there and WORK on OLD machine...? @#@@!?????
    sudo or sumthin...?

    I REALLY REALLY HATE changing things I do not understand...

    The NEW machine (FreeBSD_7.1-RELEASE) has very little installed.

    ns1:/.../...> pkg_info
    apache-2.2.11_3 Version 2.2.x of Apache web server with prefork MPM.
    autoconf-2.62 Automatically configure source code on many Un*x platforms
    autoconf-wrapper-20071109 Wrapper script for GNU autoconf
    expat-2.0.1 XML 1.0 parser written in C
    gettext-0.17_1 GNU gettext package
    gmake-3.81_3 GNU version of 'make' utility
    help2man-1.36.4_2 Automatically generating simple manual pages from program o
    libiconv-1.11_1 A character set conversion library
    libtool-1.5.26 Generic shared library support script
    lynx-2.8.7d9_1 A non-graphical, text-based World-Wide Web client
    m4-1.4.11,1 GNU m4
    mime-support-3.44.1 MIME Media Types list
    mysql-client-6.0.9 Multithreaded SQL database (client)
    mysql-server-6.0.9 Multithreaded SQL database (server)
    p5-Authen-PAM-0.16_1 A Perl interface to the PAM library
    p5-Net-SSLeay-1.35 Perl5 interface to SSL
    p5-gettext-1.05_2 Message handling functions
    pcre-7.8 Perl Compatible Regular Expressions library
    perl-5.8.9 Practical Extraction and Report Language
    portaudit-0.5.12 Checks installed ports against a list of security vulnerabi
    portmaster-2.7 Manage your ports without external databases or languages
    usermin-1.380_1 Web-based interface for performing some user tasks
    webmin-1.450_2 Web-based interface for system administration for Unix
    ns1:/.../...>

    Am I missing some tool/package?

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks