Bug 6647 - get_root_nt_token: getpwnam("root") failed!
Summary: get_root_nt_token: getpwnam("root") failed!
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.2
Classification: Unclassified
Component: User & Group Accounts (show other bugs)
Version: 3.2.14
Hardware: Other Linux
: P3 normal
Target Milestone: ---
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-19 10:44 UTC by Mikhail Ionov
Modified: 2009-08-24 13:54 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Ionov 2009-08-19 10:44:34 UTC
Get a message in log on startup
[2009/08/19 19:30:42,  0] source/auth/token_util.c:get_root_nt_token(95)
  get_root_nt_token: getpwnam("root") failed!

there is no user root and i do not want to create one whith this name due to security reasons. Is there any workaround?
smb.conf

[global]
        unix charset = CP1251
        display charset = CP1251
        workgroup = HAPPYLAND
        server string = Router
        interfaces = 192.168.1.0/16
        log level = 1
        security = user
        log file = /opt/var/log/smbd.log
        smb passwd file = /opt/etc/samba/smbpasswd
        max log size = 100

[torrent]
        path = /tmp/hdd/torrent/work
        comment = Torrent work directory
        valid users = sambauser
        force user = sambauser
        readonly = No
Comment 1 Volker Lendecke 2009-08-19 10:54:27 UTC
Would replacing the sys_getpwnam("root") in token_util.c sys_getpwuid(0) help you? Or don't you have any user with the uid 0 in the system at all?

Volker
Comment 2 Mikhail Ionov 2009-08-19 12:45:16 UTC
(In reply to comment #1)
> Would replacing the sys_getpwnam("root") in token_util.c sys_getpwuid(0) help
> you? Or don't you have any user with the uid 0 in the system at all?
> Volker

I think this would help in my particular case. I'll try as soon as I can (in  a day or two).
Comment 3 Mikhail Ionov 2009-08-19 13:27:41 UTC
I realized that I have no ability to try it by myself. My OS ia a Busybox v1.1.3 on my router. I think it will take a lot of time to compile samba.
I took executables from http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable

So how we can try this solution?
And I think that better variant is to make a special key in config file. What do you think?
Comment 4 Jeremy Allison 2009-08-19 18:57:06 UTC
I think all UNIX'es must have a passwd entry for a uid of zero, no matter what it's called. So I think the getpwuid(0) is the best solution. I've committed to master for 3.5.0 (git 8c347ed1775acc124ff7887e2f14776529e40298).
Jeremy.
Comment 5 Mikhail Ionov 2009-08-20 01:41:08 UTC
I think you're right. I'm a novice in Linux and Samba, so I rely on your opinion. Should we change Status of the Bug?

Mikhail.
Comment 6 Volker Lendecke 2009-08-20 03:11:20 UTC
Marking as fixed. Solution will be in Samba 3.5.

Volker
Comment 7 Guenther Deschner 2009-08-20 03:20:38 UTC
This change breaks the RPC-SVCCTL test on the buildfarm as there is no user with uid 0 in nss_wrapper.
Comment 8 Jeremy Allison 2009-08-24 13:54:10 UTC
New fix checked into master tries getpwuid(0), then falls back to getpwnam("root").
Jeremy.