Unix Technical Forum

SVN Commit by andreas: r4385 - trunk/pgadmin3/src/schema

This is a discussion on SVN Commit by andreas: r4385 - trunk/pgadmin3/src/schema within the pgsql Interfaces Pgadmin Hackers forums, part of the PostgreSQL category; --> Author: andreas Date: 2005-08-01 14:45:10 +0100 (Mon, 01 Aug 2005) New Revision: 4385 Modified: trunk/pgadmin3/src/schema/pgServer.cpp Log: unix fix Modified: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces Pgadmin Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 05:27 PM
svn@pgadmin.org
 
Posts: n/a
Default SVN Commit by andreas: r4385 - trunk/pgadmin3/src/schema

Author: andreas
Date: 2005-08-01 14:45:10 +0100 (Mon, 01 Aug 2005)
New Revision: 4385

Modified:
trunk/pgadmin3/src/schema/pgServer.cpp
Log:
unix fix

Modified: trunk/pgadmin3/src/schema/pgServer.cpp
================================================== =================
--- trunk/pgadmin3/src/schema/pgServer.cpp 2005-08-01 13:20:34 UTC (rev 4384)
+++ trunk/pgadmin3/src/schema/pgServer.cpp 2005-08-01 13:45:10 UTC (rev 4385)
@@ -379,7 +379,7 @@
fname += wxT("\\pgpass.conf");

#else
- + wxT("\\.pgpass");
+ + wxT("/.pgpass");
#endif
return fname;
}
@@ -420,18 +420,17 @@

void pgServer::StorePassword()
{
-#ifndef WIN32
- int prevmask=umask(0600);
-#endif
-
wxString fname=passwordFilename();


wxUtfFile file;
- if (wxFile::Exists(fname))
- file.Open(fname, wxFile::read_write, wxFONTENCODING_SYSTEM);
- else
- file.Open(fname, wxFile::write, wxFONTENCODING_SYSTEM);
+ if (!wxFile::Exists(fname))
+ {
+ int fd=creat(fname.ToAscii(), S_IREAD | S_IWRITE);
+ if (fd > 0)
+ close(fd);
+ }
+ file.Open(fname, wxFile::read_write, wxFONTENCODING_SYSTEM);

if (file.IsOpened())
{
@@ -465,9 +464,6 @@

file.Close();
}
-#ifndef WIN32
- umask(prevmask);
-#endif
}


@@ -490,20 +486,20 @@
txt.Printf(_("Please enter password for user %s\non server %s (%s)"), username.c_str(), description.c_str(), GetName().c_str());
dlgConnect dlg(form, txt, GetStorePwd());

- switch (dlg.Go())
+ switch (dlg.Go())
{
- case wxID_OK:
- wxTheApp->Yield();
- break;
- case wxID_CANCEL:
+ case wxID_OK:
+ wxTheApp->Yield();
+ break;
+ case wxID_CANCEL:
case -1:
- wxTheApp->Yield();
- return PGCONN_ABORTED;
- default:
- wxTheApp->Yield();
- wxLogError(__("Couldn't create a connection dialogue!"));
- return PGCONN_BAD;
- }
+ wxTheApp->Yield();
+ return PGCONN_ABORTED;
+ default:
+ wxTheApp->Yield();
+ wxLogError(__("Couldn't create a connection dialogue!"));
+ return PGCONN_BAD;
+ }

iSetStorePwd(dlg.GetStorePwd());
password = dlg.GetPassword();
@@ -608,10 +604,10 @@
wxString idstr;
if (GetName().IsEmpty())
idstr.Printf(wxT("local:.s.PGSQL.%d"), port);
- else if (GetName().StartsWith(wxT("/")))
+ else if (GetName().StartsWith(wxT("/")))
idstr.Printf(wxT("local:%s/.s.PGSQL.%d"), GetName().c_str(), port);
- else
- idstr.Printf(wxT("%s:%d"), GetName().c_str(), port);
+ else
+ idstr.Printf(wxT("%s:%d"), GetName().c_str(), port);
return idstr;
}

@@ -725,16 +721,16 @@
AppendBrowserItem(browser, collection);
}
// Jobs
- // We only add the Jobs node if the appropriate objects are the initial DB.
- wxString exists = conn->ExecuteScalar(
- wxT("SELECT cl.oid FROM pg_class cl JOIN pg_namespace ns ON ns.oid=relnamespace\n")
- wxT(" WHERE relname='pga_job' AND nspname='pgagent'"));
+ // We only add the Jobs node if the appropriate objects are the initial DB.
+ wxString exists = conn->ExecuteScalar(
+ wxT("SELECT cl.oid FROM pg_class cl JOIN pg_namespace ns ON ns.oid=relnamespace\n")
+ wxT(" WHERE relname='pga_job' AND nspname='pgagent'"));

- if (!exists.IsNull())
- {
- collection = new pgCollection(PGA_JOBS, this);
- AppendBrowserItem(browser, collection);
- }
+ if (!exists.IsNull())
+ {
+ collection = new pgCollection(PGA_JOBS, this);
+ AppendBrowserItem(browser, collection);
+ }
// Groups
collection = new pgCollection(PG_GROUPS, this);
AppendBrowserItem(browser, collection);
@@ -757,10 +753,10 @@

properties->AppendItem(_("Description"), GetDescription());
if (GetName().IsEmpty() || GetName().StartsWith(wxT("/")))
- {
+ {
properties->AppendItem(_("Hostname"), wxT("local:") + GetName());
properties->AppendItem(_("Port"), (long)GetPort());
- }
+ }
else
{
properties->AppendItem(_("Hostname"), GetName());
@@ -854,7 +850,7 @@
pos++;
}

- delete stats;
+ delete stats;
}
}
}


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:39 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com