Bug 200969

Summary: fds trunk build not starting up on HP-UX due to broken instance path parsing
Product: [Retired] 389 Reporter: Ulf Weltman <ulf.weltman>
Component: Directory ServerAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: nkinder
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 17:04:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 152373, 240316, 427409    
Attachments:
Description Flags
diff proposal none

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.