Bug 3223 - net rpc info is broken
Summary: net rpc info is broken
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.21
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-28 17:08 UTC by John H Terpstra (mail address dead(
Modified: 2005-11-09 10:35 UTC (History)
0 users

See Also:


Attachments
Backtrace from gdb (3.46 KB, text/plain)
2005-10-28 17:10 UTC, John H Terpstra (mail address dead(
no flags Details
Proposed patch (3.48 KB, patch)
2005-10-31 16:44 UTC, Jeremy Allison
no flags Details
GDB Backtrace (3.41 KB, text/plain)
2005-10-31 20:22 UTC, John H Terpstra (mail address dead(
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John H Terpstra (mail address dead( 2005-10-28 17:08:37 UTC
Debugging results found the failure of lib/smbldap.c at line 826

I replaced the return statement with smb_panic(), compiled with -O1 and -g.

Executed:

   net rpc info -Uroot%password

Backtrace is attached.

When I print out the return value of geteuid() at the point of failure it is
always 65534 (0xFFFE).

This does look like a bug somewhere!
Comment 1 John H Terpstra (mail address dead( 2005-10-28 17:10:28 UTC
Created attachment 1550 [details]
Backtrace from gdb
Comment 2 Jeremy Allison 2005-10-31 16:44:46 UTC
Created attachment 1556 [details]
Proposed patch

This should fix it.
Jeremy.
Comment 3 Jeremy Allison 2005-10-31 16:45:48 UTC
Should be fixed - please re-open if not (fixed in SAMBA_3_0 and HEAD svn).
Jeremy.
Comment 4 John H Terpstra (mail address dead( 2005-10-31 20:22:41 UTC
Created attachment 1557 [details]
GDB Backtrace

Binaries were built from SVN version 11433.
Comment 5 John H Terpstra (mail address dead( 2005-10-31 20:23:04 UTC
Sorry, it is not fixed.

I replaced the return statement following line 826 in smbldap.c with:

DEBUG(0, ("getuid returned: %X", geteuid()));
smb_panic("Oops, Panic!");


When I executed:
   net rpc info -S merlin -U root%password

Output was:
geteuid returned: FFFE

Backtrace will be attached.

- John T.
Comment 6 Jeremy Allison 2005-10-31 22:08:53 UTC
The line number in your backtrace doesn't match the source code. You are not
running out of SAMBA_3_0.

In your backtrace you have :

#12 0x081f0ba8 in pdb_get_account_policy (policy_index=-512, value=0xfffffe00)
at pdb_interface.c:1426
#13 0x0817d50e in _samr_query_dom_info (p=0x83d9ff8, q_u=0xbfffe710,
r_u=0xbfffe700) at srv_samr_nt.c:1852 

The source code at srv_samr_nt.c:1852 in SAMBA_3_0 is :
   1850                         unix_to_nt_time_abs(&nt_min_age, u_min_age);
   1851
   1852                         init_unk_info1(&ctr->info.inf1,
(uint16)min_pass_len, (uint16)pass_hist,
   1853                                        flag, nt_expire, nt_min_age);
   1854                         break;

The pdb_get_account_policy call occurs on line *1842* in the current source
code. You're not running the binaries with the modified code.

Jeremy.
Comment 7 John H Terpstra (mail address dead( 2005-11-01 00:33:00 UTC
Apologies. The changes you made were not picked up.
This problem is certainly closed.

- John T.
Comment 8 Gerald (Jerry) Carter (dead mail address) 2005-11-09 10:35:44 UTC
I should note that if you are running SVN revisions you 
probably got bit by the same thing I did.  The release 
code requires you to manually migrate the policies.
But somewhere along the way Guenther played with automatic 
migration.  Which left my system in an unusable state since
the schema had not been updated.  There's actually a lot 
more of this same problem lurking in the code.