Bug 200969 - fds trunk build not starting up on HP-UX due to broken instance path parsing
Summary: fds trunk build not starting up on HP-UX due to broken instance path parsing
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Directory Server
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 152373 240316 FDS1.1.0
TreeView+ depends on / blocked
 
Reported: 2006-08-01 21:10 UTC by Ulf Weltman
Modified: 2015-12-07 17:04 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-07 17:04:50 UTC
Embargoed:


Attachments (Terms of Use)
diff proposal (1.76 KB, text/plain)
2006-08-01 21:17 UTC, Ulf Weltman
no flags Details

Description Ulf Weltman 2006-08-01 21:10:30 UTC
Both the Linux and HP-UX manpages for basename and dirname mention that they may
modify the argument, and that does seem to occur when a program is linked with
pthread HP-UX.

This breaks util.c:normalize_path() which is used to fix up the "-D" argument
from the commandline.  Subsequently starting FDS 1.0.2 on HP-UX results in this:
hptem145:/home/ulf/fds102/bin/slapd/server# ./ns-slapd -D
/home/ulf/fds102/slapd-hptem145 -i /home/ulf/fds102/slapd-hptem145/logs/pid -w
/home/ulf/fds102/slapd-hptem145/logs/startpid
Directory "/slapd-hptem145" is not accessible.: aborting now
usage: ns-slapd -D instancedir [-d debuglevel] [-i pidlogfile] [-v] [-V]

Comment 1 Ulf Weltman 2006-08-01 21:12:40 UTC
#include <stdio.h>
#include <libgen.h>
#include <string.h>

int main() {

       char* path = strdup( "/path/to/some/slapd-instance" );
       char* bnamep = NULL;
       printf( "path: %s\n", path );
       bnamep = basename( path );
       printf( "path: %s\n", path );
       return(0);
}


hptem145:/home/ulf/src/fedora/ldapserver/ldap/servers/slapd# cc -g -o z z.c
hptem145:/home/ulf/src/fedora/ldapserver/ldap/servers/slapd# ./z
path: /path/to/some/slapd-instance
path: /path/to/some/slapd-instance
hptem145:/home/ulf/src/fedora/ldapserver/ldap/servers/slapd# cc -g -o z z.c
-lpthread
hptem145:/home/ulf/src/fedora/ldapserver/ldap/servers/slapd# ./z
path: /path/to/some/slapd-instance
path: slapd-instance

Comment 2 Ulf Weltman 2006-08-01 21:18:00 UTC
Created attachment 133446 [details]
diff proposal

Sorry, it's a spiffy algorithm but it might be best to send scratch copies to
basename at least.  For dirname I guess it might not be needed since it's
called like "x = dirname(x)", at least on the HP-UX and Linux.

Comment 4 Nathan Kinder 2007-11-28 18:10:23 UTC
The server starts fine on HP-UX now, so marking this VERIFIED.


Note You need to log in before you can comment on or make changes to this bug.