diff options
author | Martin Pool <mbp@samba.org> | 2002-01-16 02:20:34 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2002-01-16 02:20:34 +0000 |
commit | 3fee2ac712c5fe7a85b89ba3a3c19ab8801f0b22 (patch) | |
tree | 35f75a0cd0ed2d6f46ea35f742d87285c3f5f5f3 | |
parent | bf7c56665c8483c7731eedde4ab567b2b86a5bd6 (diff) | |
download | samba-3fee2ac712c5fe7a85b89ba3a3c19ab8801f0b22.tar.gz samba-3fee2ac712c5fe7a85b89ba3a3c19ab8801f0b22.tar.bz2 samba-3fee2ac712c5fe7a85b89ba3a3c19ab8801f0b22.zip |
Roll back PSTR insertion.
Just leave the fstrcpy/pstrcpy bugfix, and conversion to pstr_sprintf
rather than manual calculation of length.
(This used to be commit e38e7a2bdcf2901359035ac4aa79ebf33599e0c8)
-rw-r--r-- | source3/smbd/server.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 4f3a46bca1..08b9a63dd5 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -19,8 +19,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define PSTRING_SANCTIFY - #include "includes.h" extern fstring global_myworkgroup; @@ -119,7 +117,7 @@ static BOOL open_sockets_inetd(void) close_low_fds(); set_socket_options(smbd_server_fd(),"SO_KEEPALIVE"); - set_socket_options(smbd_server_fd(), PSTR(user_socket_options)); + set_socket_options(smbd_server_fd(), user_socket_options); return True; } @@ -185,7 +183,7 @@ max can be %d\n", /* ready to listen */ set_socket_options(s,"SO_KEEPALIVE"); - set_socket_options(s,PSTR(user_socket_options)); + set_socket_options(s,user_socket_options); if (listen(s, 5) == -1) { DEBUG(0,("listen: %s\n",strerror(errno))); @@ -207,7 +205,7 @@ max can be %d\n", /* ready to listen */ set_socket_options(s,"SO_KEEPALIVE"); - set_socket_options(s,PSTR(user_socket_options)); + set_socket_options(s,user_socket_options); if (listen(s, 5) == -1) { DEBUG(0,("open_sockets: listen: %s\n", @@ -301,7 +299,7 @@ max can be %d\n", am_parent = 0; set_socket_options(smbd_server_fd(),"SO_KEEPALIVE"); - set_socket_options(smbd_server_fd(),PSTR(user_socket_options)); + set_socket_options(smbd_server_fd(),user_socket_options); /* Reset global variables in util.c so that client substitutions will be @@ -358,9 +356,9 @@ BOOL reload_services(BOOL test) if (lp_loaded()) { pstring fname; pstrcpy(fname,lp_configfile()); - if (file_exist(PSTR(fname), NULL) && - !strcsequal(PSTR(fname), PSTR(dyn_CONFIGFILE))) { - pstrcpy(dyn_CONFIGFILE, PSTR(fname)); + if (file_exist(fname, NULL) && + !strcsequal(fname, dyn_CONFIGFILE)) { + pstrcpy(dyn_CONFIGFILE, fname); test = False; } } @@ -372,7 +370,7 @@ BOOL reload_services(BOOL test) lp_killunused(conn_snum_used); - ret = lp_load(PSTR(dyn_CONFIGFILE), False, False, True); + ret = lp_load(dyn_CONFIGFILE, False, False, True); load_printers(); @@ -387,7 +385,7 @@ BOOL reload_services(BOOL test) { if (smbd_server_fd() != -1) { set_socket_options(smbd_server_fd(),"SO_KEEPALIVE"); - set_socket_options(smbd_server_fd(), PSTR(user_socket_options)); + set_socket_options(smbd_server_fd(), user_socket_options); } } @@ -430,12 +428,12 @@ static BOOL dump_core(void) pstring dname; pstrcpy(dname,lp_logfile()); - if ((p=strrchr_m(PSTR(dname),'/'))) *p=0; + if ((p=strrchr_m(dname,'/'))) *p=0; pstrcat(dname,"/corefiles"); - mkdir(PSTR(dname),0700); - sys_chown(PSTR(dname),getuid(),getgid()); - chmod(PSTR(dname),0700); - if (chdir(PSTR(dname))) return(False); + mkdir(dname,0700); + sys_chown(dname,getuid(),getgid()); + chmod(dname,0700); + if (chdir(dname)) return(False); umask(~(0700)); #ifdef HAVE_GETRLIMIT @@ -453,7 +451,7 @@ static BOOL dump_core(void) #endif - DEBUG(0,("Dumping core in %s\n", PSTR(dname))); + DEBUG(0,("Dumping core in %s\n", dname)); abort(); return(True); } @@ -538,15 +536,15 @@ static void init_structs(void ) * set from the config file. */ - if (!*PSTR(global_myname)) { + if (!*global_myname) { char *p; pstrcpy( global_myname, myhostname() ); - p = strchr_m(PSTR(global_myname), '.' ); + p = strchr_m(global_myname, '.' ); if (p) *p = 0; } - strupper(PSTR_MUTABLE(global_myname)); + strupper(global_myname); conn_init(); @@ -622,7 +620,7 @@ static void usage(char *pname) case 'l': specified_logfile = True; pstr_sprintf(logfile, "%s/log.smbd", optarg); - lp_set_logfile(PSTR(logfile)); + lp_set_logfile(logfile); break; case 'a': @@ -684,8 +682,8 @@ static void usage(char *pname) append_log = True; if(!specified_logfile) { - pstr_sprintf(logfile, "%s/log.smbd", PSTR(dyn_LOGFILEBASE)); - lp_set_logfile(PSTR(logfile)); + pstr_sprintf(logfile, "%s/log.smbd", dyn_LOGFILEBASE); + lp_set_logfile(logfile); } fstrcpy(remote_machine, "smbd"); |