[Pkg-owncloud-commits] [owncloud-client] 60/332: CSync & statedb: Remove uid/gid
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu Aug 14 21:06:38 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit b48ab79a920e86c1b83ec7e1473750ff29a77911
Author: Markus Goetz <markus at woboq.com>
Date: Wed Jun 4 16:01:05 2014 +0200
CSync & statedb: Remove uid/gid
Columns are still in the DB as we don't want to break any compatibility.
---
csync/src/csync.c | 5 -----
csync/src/csync.h | 7 -------
csync/src/csync_private.h | 10 ----------
csync/src/csync_statedb.c | 2 --
src/mirall/syncjournaldb.cpp | 10 +++++-----
src/mirall/syncjournalfilerecord.cpp | 4 ++--
src/mirall/syncjournalfilerecord.h | 2 --
test/testcsyncsqlite.h | 2 --
8 files changed, 7 insertions(+), 35 deletions(-)
diff --git a/csync/src/csync.c b/csync/src/csync.c
index ccad9e2..1ecf725 100644
--- a/csync/src/csync.c
+++ b/csync/src/csync.c
@@ -128,9 +128,6 @@ int csync_create(CSYNC **csync, const char *local, const char *remote) {
ctx->status_code = CSYNC_STATUS_OK;
- ctx->pwd.uid = getuid();
- ctx->pwd.euid = geteuid();
-
ctx->local.list = 0;
ctx->remote.list = 0;
ctx->current_fs = NULL;
@@ -400,8 +397,6 @@ static int _csync_treewalk_visitor(void *obj, void *data) {
trav.path = cur->path;
trav.size = cur->size;
trav.modtime = cur->modtime;
- trav.uid = cur->uid;
- trav.gid = cur->gid;
trav.mode = cur->mode;
trav.type = cur->type;
trav.instruction = cur->instruction;
diff --git a/csync/src/csync.h b/csync/src/csync.h
index 8ebf9a2..46410a2 100644
--- a/csync/src/csync.h
+++ b/csync/src/csync.h
@@ -165,13 +165,6 @@ struct csync_tree_walk_file_s {
int64_t size;
int64_t inode;
time_t modtime;
-#ifdef _WIN32
- uint32_t uid;
- uint32_t gid;
-#else
- uid_t uid;
- gid_t gid;
-#endif
mode_t mode;
enum csync_ftw_type_e type;
enum csync_instructions_e instruction;
diff --git a/csync/src/csync_private.h b/csync/src/csync_private.h
index 946a601..cc6e650 100644
--- a/csync/src/csync_private.h
+++ b/csync/src/csync_private.h
@@ -94,7 +94,6 @@ struct csync_s {
char *file;
sqlite3 *db;
int exists;
- int disabled;
sqlite3_stmt* by_hash_stmt;
sqlite3_stmt* by_fileid_stmt;
@@ -119,18 +118,11 @@ struct csync_s {
} remote;
struct {
- int sync_symbolic_links;
- int timeout;
#if defined(HAVE_ICONV) && defined(WITH_ICONV)
iconv_t iconv_cd;
#endif
} options;
- struct {
- uid_t uid;
- uid_t euid;
- } pwd;
-
/* replica we are currently walking */
enum csync_replica_e current;
@@ -164,8 +156,6 @@ struct csync_file_stat_s {
int64_t size; /* u64 */
size_t pathlen; /* u64 */
uint64_t inode; /* u64 */
- uid_t uid; /* u32 */
- gid_t gid; /* u32 */
mode_t mode; /* u32 */
int nlink; /* u32 */
int type; /* u32 */
diff --git a/csync/src/csync_statedb.c b/csync/src/csync_statedb.c
index 7e3d2e4..fee0b73 100644
--- a/csync/src/csync_statedb.c
+++ b/csync/src/csync_statedb.c
@@ -298,8 +298,6 @@ static int _csync_file_stat_from_metadata_table( csync_file_stat_t **st, sqlite3
name = (const char*) sqlite3_column_text(stmt, 2);
memcpy((*st)->path, (len ? name : ""), len + 1);
(*st)->inode = sqlite3_column_int64(stmt,3);
- (*st)->uid = sqlite3_column_int(stmt, 4);
- (*st)->gid = sqlite3_column_int(stmt, 5);
(*st)->mode = sqlite3_column_int(stmt, 6);
(*st)->modtime = strtoul((char*)sqlite3_column_text(stmt, 7), NULL, 10);
diff --git a/src/mirall/syncjournaldb.cpp b/src/mirall/syncjournaldb.cpp
index 1077909..c8e1014 100644
--- a/src/mirall/syncjournaldb.cpp
+++ b/src/mirall/syncjournaldb.cpp
@@ -383,8 +383,8 @@ bool SyncJournalDb::setFileRecord( const SyncJournalFileRecord& record )
_setFileRecordQuery->bindValue(1, plen);
_setFileRecordQuery->bindValue(2, record._path );
_setFileRecordQuery->bindValue(3, record._inode );
- _setFileRecordQuery->bindValue(4, record._uid );
- _setFileRecordQuery->bindValue(5, record._gid );
+ _setFileRecordQuery->bindValue(4, 0 ); // uid Not used
+ _setFileRecordQuery->bindValue(5, 0 ); // gid Not used
_setFileRecordQuery->bindValue(6, record._mode );
_setFileRecordQuery->bindValue(7, QString::number(Utility::qDateTimeToTime_t(record._modtime)));
_setFileRecordQuery->bindValue(8, QString::number(record._type) );
@@ -398,7 +398,7 @@ bool SyncJournalDb::setFileRecord( const SyncJournalFileRecord& record )
}
qDebug() << _setFileRecordQuery->lastQuery() << phash << plen << record._path << record._inode
- << record._uid << record._gid << record._mode
+ << record._mode
<< QString::number(Utility::qDateTimeToTime_t(record._modtime)) << QString::number(record._type)
<< record._etag << record._fileId;
_setFileRecordQuery->finish();
@@ -474,8 +474,8 @@ SyncJournalFileRecord SyncJournalDb::getFileRecord( const QString& filename )
bool ok;
rec._path = _getFileRecordQuery->value(0).toString();
rec._inode = _getFileRecordQuery->value(1).toInt(&ok);
- rec._uid = _getFileRecordQuery->value(2).toInt(&ok);
- rec._gid = _getFileRecordQuery->value(3).toInt(&ok);
+ //rec._uid = _getFileRecordQuery->value(2).toInt(&ok); Not Used
+ //rec._gid = _getFileRecordQuery->value(3).toInt(&ok); Not Used
rec._mode = _getFileRecordQuery->value(4).toInt(&ok);
rec._modtime = Utility::qDateTimeFromTime_t(_getFileRecordQuery->value(5).toLongLong(&ok));
rec._type = _getFileRecordQuery->value(6).toInt(&ok);
diff --git a/src/mirall/syncjournalfilerecord.cpp b/src/mirall/syncjournalfilerecord.cpp
index b501482..5c091ca 100644
--- a/src/mirall/syncjournalfilerecord.cpp
+++ b/src/mirall/syncjournalfilerecord.cpp
@@ -27,14 +27,14 @@
namespace Mirall {
SyncJournalFileRecord::SyncJournalFileRecord()
- :_inode(0), _type(0), _uid(0), _gid(0), _mode(0)
+ :_inode(0), _type(0), _mode(0)
{
}
SyncJournalFileRecord::SyncJournalFileRecord(const SyncFileItem &item, const QString &localFileName)
: _path(item._file), _modtime(Utility::qDateTimeFromTime_t(item._modtime)),
_type(item._type), _etag(item._etag), _fileId(item._fileId),
- _uid(0), _gid(0), _mode(0)
+ _mode(0)
{
// use the "old" inode coming with the item for the case where the
// filesystem stat fails. That can happen if the the file was removed
diff --git a/src/mirall/syncjournalfilerecord.h b/src/mirall/syncjournalfilerecord.h
index 669ca11..351e99c 100644
--- a/src/mirall/syncjournalfilerecord.h
+++ b/src/mirall/syncjournalfilerecord.h
@@ -39,8 +39,6 @@ public:
int _type;
QString _etag;
QString _fileId;
- int _uid;
- int _gid;
int _mode;
};
diff --git a/test/testcsyncsqlite.h b/test/testcsyncsqlite.h
index 3a649c6..92bdca2 100644
--- a/test/testcsyncsqlite.h
+++ b/test/testcsyncsqlite.h
@@ -55,8 +55,6 @@ private slots:
QCOMPARE( QString::number(st->pathlen), QString::number(13));
QCOMPARE( QString::fromUtf8(st->path), QLatin1String("test2/zu/zuzu") );
QCOMPARE( QString::number(st->inode), QString::number(1709554));
- QCOMPARE( QString::number(st->uid), QString::number(0));
- QCOMPARE( QString::number(st->gid), QString::number(0));
QCOMPARE( QString::number(st->mode), QString::number(0));
QCOMPARE( QString::number(st->modtime), QString::number(1384415006));
QCOMPARE( QString::number(st->type), QString::number(2));
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list