Bug 200969 - fds trunk build not starting up on HP-UX due to broken instance path parsing
fds trunk build not starting up on HP-UX due to broken instance path parsing
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Directory Server (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Rich Megginson
Viktor Ashirov
:
Depends On:
Blocks: 152373 240316 FDS1.1.0
  Show dependency treegraph
 
Reported: 2006-08-01 17:10 EDT by Ulf Weltman
Modified: 2015-12-07 12:04 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 12:04:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Ulf Weltman 2006-08-01 17:10:30 EDT
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 17:12:40 EDT
#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 17:18:00 EDT
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 13:10:23 EST
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.