Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/dynconfig.c

    r690 r745  
    9999DEFINE_DYN_CONFIG_PARAM(CACHEDIR) /** Temporary cache files. Default LOCKDIR */
    100100DEFINE_DYN_CONFIG_PARAM(PIDDIR)
     101DEFINE_DYN_CONFIG_PARAM(NMBDSOCKETDIR)
    101102DEFINE_DYN_CONFIG_PARAM(NCALRPCDIR)
    102103DEFINE_DYN_CONFIG_PARAM(SMB_PASSWD_FILE)
    103104DEFINE_DYN_CONFIG_PARAM(PRIVATE_DIR)
     105DEFINE_DYN_CONFIG_PARAM(LOCALEDIR)
    104106
    105107#ifdef __OS2__
     108// @todo change this file so it also works for rpm
     109// @todo see what NMBDSOCKETDIR & LOCALEDIR are used for
    106110
    107111/* Directory the binary was called from, same as getbindir() */
     
    295299}
    296300
     301/* Directory holding the shared libs (same as libdir) */
     302const char *get_dyn_SHLIBEXT(void)
     303{
     304        static char buffer[1024] = "";
     305        if (!*buffer)
     306        {
     307                char exedir[1024] = "";
     308                if (!os2_GetExePath(exedir))
     309                {
     310                        snprintf(buffer, 260, "%s", LIBDIR);
     311                } else {
     312                        snprintf(buffer, 260, "%s/%s", exedir, "lib");
     313                }
     314        }
     315
     316        if (dyn_SHLIBEXT == NULL) {
     317                return buffer;
     318        }
     319        return dyn_SHLIBEXT;
     320}
     321
    297322/* Directory holding lock files */
    298323const char *get_dyn_LOCKDIR(void)
     
    309334}
    310335
     336/* Directory holding persistent state files */
     337const char *get_dyn_STATEDIR(void)
     338{
     339        static char buffer[1024] = "";
     340        if (!*buffer)
     341        {
     342                snprintf(buffer, 260, "%s/samba/lock", getenv("ETC"));
     343        }
     344        if (dyn_STATEDIR == NULL) {
     345                return buffer;
     346        }
     347        return dyn_STATEDIR;
     348}
     349
     350/* Temporary cache files. Default LOCKDIR */
     351const char *get_dyn_CACHEDIR(void)
     352{
     353        static char buffer[1024] = "";
     354        if (!*buffer)
     355        {
     356                snprintf(buffer, 260, "%s/samba/lock", getenv("ETC"));
     357        }
     358        if (dyn_CACHEDIR == NULL) {
     359                return buffer;
     360        }
     361        return dyn_CACHEDIR;
     362}
     363
    311364/* Directory holding the pid files */
    312365const char *get_dyn_PIDDIR(void)
     
    323376}
    324377
     378/* Directory holding the NMBDSOCKETDIR (whatever that is) */
     379const char *get_dyn_NMBDSOCKETDIR(void)
     380{
     381        static char buffer[1024] = "";
     382        if (!*buffer)
     383        {
     384                char exedir[1024] = "";
     385                if (!os2_GetExePath(exedir))
     386                {
     387                        snprintf(buffer, 260, "%s", NMBDSOCKETDIR);
     388                } else {
     389                        snprintf(buffer, 260, "%s/%s", exedir, "lib");
     390                }
     391        }
     392
     393        if (dyn_NMBDSOCKETDIR == NULL) {
     394                return buffer;
     395        }
     396        return dyn_NMBDSOCKETDIR;
     397}
     398
     399/* Directory holding the LOCALEDIR (whatever that is) */
     400const char *get_dyn_LOCALEDIR(void)
     401{
     402        static char buffer[1024] = "";
     403        if (!*buffer)
     404        {
     405                char exedir[1024] = "";
     406                if (!os2_GetExePath(exedir))
     407                {
     408                        snprintf(buffer, 260, "%s", LOCALEDIR);
     409                } else {
     410                        snprintf(buffer, 260, "%s/%s", exedir, "lib");
     411                }
     412        }
     413
     414        if (dyn_LOCALEDIR == NULL) {
     415                return buffer;
     416        }
     417        return dyn_LOCALEDIR;
     418}
     419
     420/* Directory holding the NCALRPCDIR (whatever that is) */
     421const char *get_dyn_NCALRPCDIR(void)
     422{
     423        static char buffer[1024] = "";
     424        if (!*buffer)
     425        {
     426                char exedir[1024] = "";
     427                if (!os2_GetExePath(exedir))
     428                {
     429                        snprintf(buffer, 260, "%s", NCALRPCDIR);
     430                } else {
     431                        snprintf(buffer, 260, "%s/%s", exedir, "lib");
     432                }
     433        }
     434
     435        if (dyn_NCALRPCDIR == NULL) {
     436                return buffer;
     437        }
     438        return dyn_NCALRPCDIR;
     439}
     440
    325441/* Location of smbpasswd */
    326442const char *get_dyn_SMB_PASSWD_FILE(void)
     
    351467}
    352468
    353 /* Directory holding the shared libs (same as libdir) */
    354 const char *get_dyn_SHLIBEXT(void)
    355 {
    356         static char buffer[1024] = "";
    357         if (!*buffer)
    358         {
    359                 char exedir[1024] = "";
    360                 if (!os2_GetExePath(exedir))
    361                 {
    362                         snprintf(buffer, 260, "%s", LIBDIR);
    363                 } else {
    364                         snprintf(buffer, 260, "%s/%s", exedir, "lib");
    365                 }
    366         }
    367 
    368         if (dyn_SHLIBEXT == NULL) {
    369                 return buffer;
    370         }
    371         return dyn_SHLIBEXT;
    372 }
    373 
    374 /* Directory holding the NCALRPCDIR (whatever that is) */
    375 const char *get_dyn_NCALRPCDIR(void)
    376 {
    377         static char buffer[1024] = "";
    378         if (!*buffer)
    379         {
    380                 char exedir[1024] = "";
    381                 if (!os2_GetExePath(exedir))
    382                 {
    383                         snprintf(buffer, 260, "%s", NCALRPCDIR);
    384                 } else {
    385                         snprintf(buffer, 260, "%s/%s", exedir, "lib");
    386                 }
    387         }
    388 
    389         if (dyn_NCALRPCDIR == NULL) {
    390                 return buffer;
    391         }
    392         return dyn_NCALRPCDIR;
    393 }
    394 
    395469#endif /* __OS2__ */
    396 
    397 /* In non-FHS mode, these should be configurable using 'lock dir =';
    398    but in FHS mode, they are their own directory.  Implement as wrapper
    399    functions so that everything can still be kept in dynconfig.c.
    400  */
    401 
    402 const char *get_dyn_STATEDIR(void)
    403 {
    404 #ifdef FHS_COMPATIBLE
    405         return STATEDIR;
    406 #else
    407         return lp_lockdir();
    408 #endif
    409 }
    410 
    411 const char *get_dyn_CACHEDIR(void)
    412 {
    413 #ifdef FHS_COMPATIBLE
    414         return CACHEDIR;
    415 #else
    416         return lp_lockdir();
    417 #endif
    418 }
Note: See TracChangeset for help on using the changeset viewer.