Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 176402 - samba sends wrong encoded parameters to "set primary group script"
Summary: samba sends wrong encoded parameters to "set primary group script"
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-28 20:06 UTC by Matthias Nagl
Modified: 2007-12-29 10:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
smbldap-groupmod with workaround (smbldap-groupmod,8.77 KB, text/plain)
2007-04-29 20:56 UTC, Matthias Nagl
Details
smbldap-usermod with workaround (smbldap-usermod,18.62 KB, text/plain)
2007-04-29 20:57 UTC, Matthias Nagl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Nagl 2007-04-28 20:06:31 UTC
When using a set primary group script, %u shoud get replaced by the username and %g by the groupname. However there are non-consistent encoding-problems:

When using for example german versions of windows and making a net rpc vampire to clone a pdc the groups are correctly created with the add group script:
if I enter echo '%g%' >> file as add group script I get
Domänen-Admins
Domänen-Benutzer
Domänen-Gäste

BUT

when the primary groups are set, the %g in the set primary group script call is replaced in another way (dumped with the same method):
Dom\C3\A4nen-Benutzer
Dom\C3\A4nen-G\C3\A4ste

This odd behaviour sadly brakes the smbldap-tools, produces a lot of error messages and a broken user-db.

Reproducible: Always

Steps to Reproduce:
1. setup samba pdc with smbldap-tools
2. net rpc vampire
3. error occurs (different %g-replacements)

Actual Results:  
the script-calls are not consistent and therefor don't work

Expected Results:  
the encoding for %g in the "set primary group script" call should be the same as for the "add group script" call

on a debian-mailinglist I found a similar bugreport where the reporter told it disappeared with samba 3.0.14. probably the debian-devs patched samba somehow?

gauss2 tmp # emerge --info
Portage 2.1.2.2 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.5-r0, 2.6.18-hardened i686)
=================================================================
System uname: 2.6.18-hardened i686 Intel(R) Pentium(R) III CPU family      1400MHz
Gentoo Base System release 1.12.9
Timestamp of tree: Sat, 28 Apr 2007 06:00:08 +0000
dev-java/java-config: 1.3.7, 2.0.31-r5
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.15-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/php/apache1-php5/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="berkdb bitmap-fonts cli cracklib crypt exiscan exiscan-acl fortran gdbm gpm gs iconv isdnlog jpeg jpeg2k kerberos ldap libg++ mailwrapper midi mysql ncurses nls nptl nptlonly pam pcre perl png ppds pppd python quotas readline reflection samba sasl session snmp spf spl ssl tcpd threads tiff truetype truetype-fonts type1-fonts unicode vhosts wmf x86 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

gauss2 tmp # emerge -pv samba smbldap-tools

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] net-fs/samba-3.0.24  USE="acl kerberos ldap pam python quotas readline -async -automount -caps -cups -doc -examples -fam -oav (-selinux) -swat -syslog -winbind" LINGUAS="-ja -pl" 0 kB 
[ebuild   R   ] net-nds/smbldap-tools-0.9.2a  USE="-doc" 0 kB
Comment 1 Matthias Nagl 2007-04-29 20:56:03 UTC
The wrong display of the umlauts in the upper example (Domänen-Gäste) was because my terminal was set to latin1 encoding while the server runs with utf8 - but this has nothing to do with the problem - setting the terminal to utf8 shows correctly "Domänen-Gäste".

I managed to workaround the problem by changing the scripts from smbldap-tools that are called by samba according to the attachment I'll immediatly post (my change is in both cases the line after the comment # Dirty Samba Workaround).

This problem should be fixed in samba because it is not understandable why different script-calls give different outputs. The "encoding" given by samba seems completely nonstandard and it took me two days to spot the problem an find a workaround.
Comment 2 Matthias Nagl 2007-04-29 20:56:36 UTC
Created attachment 117674 [details]
smbldap-groupmod with workaround
Comment 3 Matthias Nagl 2007-04-29 20:57:35 UTC
Created attachment 117676 [details]
smbldap-usermod with workaround
Comment 4 Tiziano Müller (RETIRED) gentoo-dev 2007-12-24 10:50:17 UTC
Could you please check whether this is fixed now with smbldap-tools-0.9.4?
Thanks.