Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm not sure how much of an issue this is, Samba mostly works, however I do get this message constantly on my logs:

[2013/08/29 13:52:24.155039,  0] param/loadparm.c:8843(check_usershare_stat)
  check_usershare_stat: file /var/lib/samba/usershares/ owned by uid 0 is not a regular file
[2013/08/29 14:07:24.128107,  0] param/loadparm.c:8843(check_usershare_stat)
  check_usershare_stat: file /var/lib/samba/usershares/ owned by uid 0 is not a regular file
[2013/08/29 14:07:24.136845,  0] param/loadparm.c:8843(check_usershare_stat)
  check_usershare_stat: file /var/lib/samba/usershares/ owned by uid 0 is not a regular file
[2013/08/29 14:22:24.090561,  0] param/loadparm.c:8843(check_usershare_stat)
  check_usershare_stat: file /var/lib/samba/usershares/ owned by uid 0 is not a regular file
[2013/08/29 14:22:24.096851,  0] param/loadparm.c:8843(check_usershare_stat)
  check_usershare_stat: file /var/lib/samba/usershares/ owned by uid 0 is not a regular file

I checked out the code for my version (3.6.3):

    if (!S_ISREG(psbuf->st_ex_mode)) {
        DEBUG(0,("check_usershare_stat: file %s owned by uid %u is "
            "not a regular file\n",
            fname, (unsigned int)psbuf->st_ex_uid ));
        return False;
    }

I went after S_ISREG, and found out that is a POSIX macro (http://linux.die.net/man/2/stat), that checks if a path is a regular file, i.e. not a directory.

That should have been obvious, /var/lib/samba/usershares was a directory, I rmdired it and touched it so it was now a file.

To my surprise this was now bloating my logs:

[2013/08/29 14:37:24.062508,  0] param/loadparm.c:9307(load_usershare_service)
  load_usershare_service: /var/lib/samba/usershares is not a directory.
[2013/08/29 14:37:24.067807,  0] param/loadparm.c:9307(load_usershare_service)
  load_usershare_service: /var/lib/samba/usershares is not a directory.

An the code for that part:

    if (!S_ISDIR(sbuf.st_ex_mode)) {
        DEBUG(0,("load_usershare_service: %s is not a directory.\n",
            usersharepath ));
        return -1;
    }

Specifically checks if that path is a directory, which blew my mind. I couldn't find anyone having that issue, so I must be doing something wrong.

[global]
        unix charset = iso8859-1
        display charset = cp850
        workgroup = WORKGROUP
        netbios name = WORK
        server string = WORK GROUP
        obey pam restrictions = Yes
        passdb backend = tdbsam
        pam password change = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
        username map = /etc/samba/smbusers
        unix password sync = Yes
        load printers = no
        printing = bsd
        printcap name = /dev/null
        disable spoolss = yes
        wins support = yes
        log level = 1
        log file = /var/log/samba/%m.log
        notify:inotify = false
        max log size = 50
        time server = Yes
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        add machine script = /usr/sbin/useradd -d /dev/null -g winmachines -s /bin/false %u -c "Samba machine"
        logon script = %g_logon.bat
        logon path = \\%L\profiles
        logon drive = h:
        domain logons = Yes
        os level = 99
        preferred master = Yes
        domain master = Yes
        dns proxy = No
        ldap ssl = no
        idmap config * : range = 15000-20000
        idmap config * : backend = tdb
        admin users = root, cabreu
        read only = No
        force create mode = 0777
        force security mode = 0777
        directory mask = 0777
        force directory mode = 0777
        force directory security mode = 0777
        lpq command = %p
        lprm command =
        unix extensions = no
        wide links = yes
        smb ports = 139

I recently migrated this configuration from an old Samba 3.4.7, so that might have something to do, but I can't figure out what.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.