Ticket #2419 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

configure script for mc-4.7.4 fails to set samba configdir

Reported by: jimklimov Owned by: andrew_b
Priority: major Milestone: 4.7.5
Component: mc-vfs Version: 4.7.4
Keywords: mc-vfs samba configdir Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

I am building mc-4.7.4 and mc-4.7.0.9 on Solaris (Sol 10 x86/SPARC).

I found that mc-4.7.4 (*unlike* mc-4.7.0.9) config script fails to replace "@configdir@" with the default path (/etc) or one explicitly provided with options

--with-smb-configdir=/etc --with-configdir=/etc

regardless - whether used alone or both at once.

As a result, the value hardcoded in the "mc" binary is
"@configdir@/smb.conf".

My current workaround is to manually fix lib/vfs/mc-vfs/Makefile around line 396 after running "./configure" before running "make":
-SAMBA_CFLAGS = -DCONFIGDIR=\""@configdir@"\"
+SAMBA_CFLAGS = -DCONFIGDIR=\""/etc"\"

Attachments

2419_smbconfigdir_4.7.4.patch (3.4 KB) - added by andrew_b 14 years ago.
Patch for 4.7.4 release
2419_smbconfigdir_master.patch (3.4 KB) - added by andrew_b 14 years ago.
Patch for master branch

Change History

comment:1 Changed 14 years ago by andrew_b

Would you try the 2419_smbconfigdir.patch patch?

comment:2 follow-up: ↓ 3 Changed 14 years ago by jimklimov

Well, the patch almost applies. Apparently your source version differs from mc-4.7.4 archive?

In my case the file "mc-vfs-samba.m4" ends with:

AM_CONDITIONAL([ENABLE_VFS_SMB], [test x"$enable_vfs_smb" = x"yes"])

and the patch expects that to be

AM_CONDITIONAL([ENABLE_VFS_SMB], [test "$enable_vfs" = "yes" -a x"$enable_vfs_smb" = x"yes"])

And apparently, Makefile.in (not only Makefile.am) files in lib/vfs/mc-vfs/samba/ and lib/vfs/mc-vfs/ should also be updated to use @smbconfigdir@ instead of @configdir@

But even so, at least in my case the problem remains in place. The generated final Makefile contains wrong strings:

$ grep configdir mc-4.7.4/lib/vfs/mc-vfs/samba/Makefile
CONFIGFILE = @smbconfigdir@/smb.conf
LMHOSTSFILE = @smbconfigdir@/lmhosts

These should have been real paths, like in mc-4.7.0.x:

$ egrep 'smb.conf|lmhosts' mc-4.7.0.10/lib/vfs/mc-vfs/samba/Makefile
# or in smb.conf (see smb.conf(5))
CONFIGFILE = /etc/smb.conf
LMHOSTSFILE = /etc/lmhosts

Something broke in the "replacer" which changes the @tag@ blocks, and it only occurs to this one tag. :\

comment:3 in reply to: ↑ 2 Changed 14 years ago by andrew_b

Replying to jimklimov:

Well, the patch almost applies. Apparently your source version differs from mc-4.7.4 archive?

In my case the file "mc-vfs-samba.m4" ends with:

AM_CONDITIONAL([ENABLE_VFS_SMB], [test x"$enable_vfs_smb" = x"yes"])

and the patch expects that to be

AM_CONDITIONAL([ENABLE_VFS_SMB], [test "$enable_vfs" = "yes" -a x"$enable_vfs_smb" = x"yes"])

This is patch for recent master. I'll provide a patch for 4.7.4 asap.

And apparently, Makefile.in (not only Makefile.am) files in lib/vfs/mc-vfs/samba/ and lib/vfs/mc-vfs/ should also be updated to use @smbconfigdir@ instead of @configdir@

No.

But even so, at least in my case the problem remains in place. The generated final Makefile contains wrong strings:

$ grep configdir mc-4.7.4/lib/vfs/mc-vfs/samba/Makefile
CONFIGFILE = @smbconfigdir@/smb.conf
LMHOSTSFILE = @smbconfigdir@/lmhosts

Leave @configdir@ here.

Changed 14 years ago by andrew_b

Patch for 4.7.4 release

Changed 14 years ago by andrew_b

Patch for master branch

comment:4 Changed 14 years ago by andrew_b

I've attached two patches: for 4.7.4 release and for current 'master' branch.

comment:5 follow-up: ↓ 6 Changed 14 years ago by jimklimov

These didn't help either :(

I tried comparing Makefiles and configure scripts in 4.7.0.10 and 4.7.4 versions, and it seems that while renaming the configure key (--enable-vfs-smb vs. --with-samba) the keys for [smb]configdir and codepagedit were lost altogether.

In 4.7.0.x generated Makefiles have lines line

configdir = @configdir@

and in 4.7.4 no such lines... maybe that's the culprit? :\

comment:6 in reply to: ↑ 5 Changed 14 years ago by andrew_b

Replying to jimklimov:

These didn't help either :(

What do you mean exactly?

I tried comparing Makefiles and configure scripts in 4.7.0.10 and 4.7.4 versions, and it seems that while renaming the configure key (--enable-vfs-smb vs. --with-samba) the keys for [smb]configdir and codepagedit were lost altogether.

In 4.7.0.x generated Makefiles have lines line

configdir = @configdir@

and in 4.7.4 no such lines... maybe that's the culprit? :\

Now configdir is a variable in lib/vfs/mc-vfs/samba locally. Global variable is named smbconfigdir now. I renamed previous global configdir to smbconfigdir to avoid possible confuse and to be matched with name of --with-smb-condigdir option. In all Makefiles.in exculding lib/vfs/mc-vfs/samba/Makefile.in you can find

smbconfigdir = @smbconfigdir@

comment:7 Changed 14 years ago by jimklimov

Exactly - I've tried to set in Makefile.am all the ways I thought of to set this definition, ending up with this monster:

if ENABLE_VFS_SMB
SAMBA_CFLAGS1 = -DCONFIGDIR=\""@smbconfigdir@"\"
SAMBA_CFLAGS2 = -DCONFIGDIR=\""@configdir@"\"
SAMBA_CFLAGS3 = -DCONFIGDIR=\""@SMBCONFIGDIR@"\"
SAMBA_CFLAGS = $(SAMBA_CFLAGS1)
SAMBA_SUBDIRS = samba
endif

All of these strings make it into the final Makefile unchanged.

Well, if it's only broken for me and works at least for you in the master branch - I'll see if it "magically" begins working in 4.7.5 release ;)

Or if anyone else complains into this ticket.

Maybe my hands are too "curly" these days...

comment:8 Changed 14 years ago by slavazanko

  • Blocked By 2409 added

comment:9 Changed 14 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • severity changed from no branch to on review
  • Milestone changed from 4.7 to 4.7.5

Created 2419_smb_configdir branch. Parent branch is master.
changeset:6d1405a5973c143d45bffc5a43eca990c0096670

comment:11 Changed 14 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:12 Changed 14 years ago by slavazanko

  • Blocking 2409 added

comment:13 Changed 14 years ago by angel_il

  • Votes for changeset changed from slavazanko to slavazanko angel_il
  • severity changed from on review to approved

comment:14 Changed 14 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko angel_il to committed-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:15 Changed 14 years ago by andrew_b

  • Status changed from testing to closed
  • Blocking 2409 removed
Note: See TracTickets for help on using tickets.