Changeset 953


Ignore:
Timestamp:
Aug 12, 2016, 1:07:15 AM (9 years ago)
Author:
dmik
Message:

samba server: Properly derive log file suffix from program name.

The code removing the path didn't expect back slashes or the
.exe extension in the name and could result into invalid
(no log file at all) or strange (ending with .exe) log file
names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/lib/popt_common.c

    r952 r953  
    5151
    5252        /* Find out basename of current program */
     53#ifdef __OS2__
     54        char *fname = SMB_STRDUP(_getname(poptGetInvocationName(con)));
     55        _remext(fname);
     56        pname = fname;
     57#else
    5358        pname = strrchr_m(poptGetInvocationName(con),'/');
    5459
     
    5762        else
    5863                pname++;
     64#endif
    5965
    6066        if (asprintf(&lfile, "%s/log.%s", arg, pname) < 0) {
     
    6672                lp_set_cmdline("log file", lfile);
    6773        }
     74        SAFE_FREE(fname);
    6875#endif
    6976
Note: See TracChangeset for help on using the changeset viewer.